sdk
sdk copied to clipboard
Switch from Gradle + Ant to Maven
Switch from Gradle + Ant to Maven. Currently the SDK is using Gradle to do some priming magic and Ant to actually build the SDK. Along with some SH scripts to fill in the gaps. This makes the build very complicated. Especially shunning away any newcomer to the project. Really a hassle to setup the SDK. I think we can replace all of this with Maven.
Current issues:
- Complicated, I mean two different build systems, c'mon
- Feels like a lot of workarounds are used (probably things supported by Maven project directly and just hacked to Ant)
- Difficult to open SDK as a NB platform project in Netbeans as it is detected as a Gradle project in modern Netbeans versions
- No dependency control in our modules, just need to include JARs manually, they never get upgraded etc.
Maven platform project type is officially supported by Netbeans. Ant is also still but not recommended. Gradle unfortunately is not supported, so I would outright forget it. There was some unofficial plugin for creating this support but I have my doubts. And this Mavenizing should be now much easier as we don't build the engine anymore so less stuff needs to be re-invented.
All the current issues listed would ideally be solved by the Maven system but here are some points that require special attention:
- Downloading JDKs and bundling them (currently handled by a script and Ant)
- Handling the harness overrides, a.k.a. our icon used in the launcher
- Coining the versions (look at version.gradle)
- Dealing with the jME test project template (currently sources downloaded and extracted by the build.gradle)
- Dealing with the other Ant project templates (currently build.gradle does a lot of tweaks to update these automatically to the version set for the dependencies)
- I totally recommend not changing the directory structure to Maven default (src/tests/etc) to avoid too big PR, this default structure can be overridden in the configs
I suspect that the versions could be replaced just with a variable in Maven build which would needed to be upgraded manually before creating a new version. And for the others as well I have done some preliminary research and seems everything is doable and even simplifies things compared to the current setup.
For the Ant project templates we have however... Could be little bit tricky. We now have the Gradle template too which is the highly recommended one. So if this proves too difficult to implement.. We could even drop these. Or replace with Maven templates to go alongside the Gradle template. Although the latter would again bring more to support for what I think is very little value...
An admirable task! I'd vote for dropping Ant, if it causes problems. 95% of users would probably not care which build system is used as long as it just works. And those that want to change something would probably not want to use Ant, anyway. :)
I only have a bit of a panic with dropping gradle, because it was the easiest way to script build related things, I don't know how custom goals work with maven. Or well, actually, I know, you need to compile some jar, define some arbitrary pom and add it to mavenLocal, afair.
Anyway, we should definately migrate the shell scripts to maven/gradle. Exciting but big undertaking :)
Edit: Another point may be a ant->gradle project template updater if possible, because we have a lot of (broken) code that makes sdk ant projects special. Ideally those should be gradle plugins and moved to the engine side (e.g. the whole iOS procedure, downloading and bundling a jvm, mostly deployment)
Yeah, there are lot of these unknowns. There might not be a direct way to convert something from Gradle/Ant to Maven. It requires to get this Maven mindset and do things the Maven way. Some I know are lot more simple than now with the current setup..