Dual build: With and without jre
I want to build both the jre-bundled and non-bundled version of my app in single build command. Now, it seems I need to edit the bundleJRE before triggering new builds.
It may be possible within gradle to run a task twice with two different configurations, but I don't know how. Perhaps check the gradle docs and/or post to the gradle forum. If there is something I can change programatically to make it easier, I will consider it if you can give details of what needs to change.
You cannot run the same task twice in gradle https://discuss.gradle.org/t/is-there-possibility-to-run-single-task-twice-during-build-script-execution/6312.
If, for example, createApp had been a class extending DefaultTask one could easily have created tasks with createApp as type and provide the configuration needed.
My workaround for this has been to create multiple subprojects, each of them applying the plugin, configuring macappbundle and having a task buildApp. Then multiple apps can be built with
gradle buildApp.
@crotwell I'm subscribing. I aggree with @Codinghi, the solution would be this:
If, for example, createApp had been a class extending DefaultTask one could easily have created tasks with createApp as type and provide the configuration needed.
I am struggling with the same problem. I need to build multiple app bundle in one run. Are you considering to refactor the tasks? 😃
I am not opposed to changing createApp to extend DefaultTask. I am short on time to work on this now. Could you give the modification a try and submit a pull request?
Gladly. I have to find some free time too, but I will definitely give it a try 👌 Thanks.