gradle-macappbundle icon indicating copy to clipboard operation
gradle-macappbundle copied to clipboard

Dual build: With and without jre

Open subwiz opened this issue 9 years ago • 5 comments

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.

subwiz avatar May 29 '16 09:05 subwiz

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.

crotwell avatar May 31 '16 20:05 crotwell

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.

nilssonjulia avatar Jun 01 '16 09:06 nilssonjulia

@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? 😃

atistrcsn avatar Oct 09 '17 07:10 atistrcsn

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?

crotwell avatar Oct 09 '17 16:10 crotwell

Gladly. I have to find some free time too, but I will definitely give it a try 👌 Thanks.

atistrcsn avatar Oct 10 '17 07:10 atistrcsn