crotwell / gradle-macappbundle

A Gradle Plugin to create a Mac OSX .app application and dmg based on the project.
Apache License 2.0
94 stars 33 forks source link

adding the plugin executes 10 of the 13 tasks when doing a gradle build #39

Closed tessus closed 8 years ago

tessus commented 8 years ago

I've added the following to my build.gradle file:

plugins {
    id "edu.sc.seis.macAppBundle" version "2.1.4"
}

macAppBundle {
    mainClassName = "..."
    icon          = "myApp.icns"
    volumeName    = "myApp"
    dmgName       = "myApp"
    javaProperties.put("apple.laf.useScreenMenuBar", "true")
    // Uncomment the next line to bundle the JRE with the Mac OS X application
    //bundleJRE     = true
}

When I run a gradlew build, all tasks from your bundle are run, except codeSign, createAppZip, runSetFile.

I never specified it anywhere that any of the tasks are run. The problem is that on Windows a gradlew build tries to run createDmg and fails (naturally).

Why are any MacAppBundle tasks run when doing a gradlew build?

Is there a way that none of the MacAppBundle tasks are run for a gradlew build?

crotwell commented 8 years ago

The tasks are run because "assemble" depends on them, basically if you add the macAppBundle plugin,you are saying that a app is an output of the build and so it is generated. I believe this is the expected behavior, for example if you use the war plugin, the war file will be generated on gradle build. If you don't want everything generated, you can always just call gradle jar to only build the jar file.

But the windows issue should be fixed in 2.1.5. Now assemble depends on createDmg on mac, but on createAppZip on windows and linux.

tessus commented 8 years ago

Hmm, so build includes assemble and assemble includes the 10 tasks. Ok, I'll try 2.1.5. Thanks.