Issue
I have an app that works on 2 platforms: Android and JavaFX.
Basically, my sources look like this:
java
|
|---android //android specific sources
|
|---common //plain java common sources
|
|---fx //JavaFX specific sources
For the moment I'm using 2 different build files one of them build.android.gradle
and the other build.fx.gradle
and instantly renaming them to build.gradle
depending on the situation. I mean it is an odd and real nightmare.
My intention is to have either 2 different build.gradle
files (placed in different folders?) or a single build.gradle
which builds APK for Android and JAR for JavaFX
The question is: how to achieve this?
Solution
I suggest using gradles suggested project structure and have both code bases and the java core be a separate subproject. The project JavaFx and Android can both depend on the java project. Then you can either build just one of them or both. Gradle will automatically rebuild the java base as well, when needed.
Answered By - 3Fish
Answer Checked By - Gilberto Lyons (JavaFixing Admin)