Reputation: 5311
I have a JavafX project which I would like to export for Ipad only. I found out that the Gluon framework can do that for me. Unfortunately, the JavaFX project I have uses Ant, not Gradle as shown in the Gluon docs.
Is there any way I can put the Gluon dependency in the Ant task and generate the IOS output executable? If not, then is it possible to convert this project into a Gradle Project.
Please note I am using Ubuntu Linux. I don't know what is required to create Ipad executables. It is possible that my understanding of this might be wrong as I have not dealt with Mac systems before.
Here is the build.xml for ant :
<?xml version="1.0" encoding="ASCII"?>
<anttasks:AntTask xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:anttasks="http://org.eclipse.fx.ide.jdt/1.0" buildDirectory="${project}/build" cssToBin="true">
<deploy packagingFormat="exe">
<application name="Test" mainclass="application.Main" version="1.0"/>
<info title="Frontend" vendor="NAME"/>
</deploy>
<signjar/>
</anttasks:AntTask>
That's all I have in the entire project, other are just Java files I have created myself. Any help would be nice. Thank you.
Update
As per the answer received, I created a Gradle project and moved the files there. After that I added the libraries for Gluon from here, but I keep getting this error :
Error:(14, 0) Build script error, unsupported Gradle DSL method found: 'androidRuntime()'!
Possible causes could be:
- you are using Gradle version where the method is absent (<a href="open_gradle_settings">Fix Gradle settings</a>)
- you didn't apply Gradle plugin which provides the method (<a href="apply_gradle_plugin">Apply Gradle plugin</a>)
- or there is a mistake in a build script (<a href="goto_source">Goto source</a>)
Update-2
So, what I finally did was install the Gluon plugin for Intellij Idea, and then created a Gluon project. As suggested on the webpage, I have added ANDROID_HOME parameter and the directory point to android-sdk for Linux. Still, when I call run the program, I keep getting the error:
Error:Android Source Generator: [GluonBasicProject] Android SDK is not specified
My gradle.properties looks like this :
gradlePropertiesProp=gradlePropertiesValue
systemProjectProp=shouldBeOverWrittenBySystemProp
envProjectProp=shouldBeOverWrittenByEnvProp
systemProp.system=systemValue
ANDROID_HOME=/home/akshay/Downloads/android-sdk-linux
Please note, when creating this project I had selected default gradle-wrapper, and I found 4 gradle distributions on my system, so I updated the ANDROId_HOME value in all four of them.
build.gradle :
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'org.javafxports:jfxmobile-plugin:1.0.0-b10'
}
}
apply plugin: 'org.javafxports.jfxmobile'
repositories {
jcenter()
}
mainClassName = 'com.gluonapplication.GluonApplication'
jfxmobile {
android {
manifest = 'src/android/AndroidManifest.xml'
}
ios {
infoPList = file('src/ios/Default-Info.plist')
}
}
Upvotes: 1
Views: 581
Reputation: 45456
The solution is to create a Gradle project, and add your Java/JavaFX sources. Ant won't be required, and gradle will manage everything for you.
To make things easier, Gluon has a plugin for the major IDEs (NetBeans, IntelliJ and Eclipse). You just need to install that plugin and it will allow creating a simple gradle project with all that you need to add your own sources and build it and deploy it on desktop, Android and iOS devices.
You can find several post about installing the plugin and creating projects from the scratch on Gluon's site:
In order to do this, you need some prerequisites. The most critical in your case will be having a Mac in order to deploy to iPhone/iPad. The rest is software required and minor configuration.
Notice that using Gradle you will have to work with Tasks
.
You can run from command line (as well as from your IDE) the task you require:
./gradlew clean build
./gradlew run
./gradlew androidInstall
./gradlew launchIOSDevice
...
Note that for deploying to iOS you will need some settings on the build script. Also, read this about Apple free provisioning.
Upvotes: 2