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

Builing DMG often fails when background image is set #59

Closed victorkifer closed 6 years ago

victorkifer commented 6 years ago

Info: OS: High Sierra 10.13.5 (APFS) Gradle Version: 4.8 Plugin Version: 2.2.1

The plugin configuration is as follow. I have a custom background image for the DMG.

macAppBundle {
    appName = "App"
    appStyle = "Oracle"
    icon = "src/res/icon.icns"
    bundleIdentifier = "com.example"

    mainClassName = "MainKt"

    bundleJRE = true
    jreHome = "/Library/Java/JavaVirtualMachines/jdk1.8.0_171.jdk/Contents/Home"
    jvmVersion = "1.8"
    jarTask = "jar"
    backgroundImage = "src/main/deploy/background.png"
}

The creation of DMG without background image always succeeds. With background image set it fails most of the time (sometimes rarely succeeds). The error I'm getting is:

Problem running applescript to set dmg background image: 1 78:82: execution error: Finder got an error: Can’t get disk "DiskName". (-1728)

I believe this is due to some kind of racing condition. If you need some extra info, feel free to ask.

victorkifer commented 6 years ago

I opened a pull request which fixes the issue. Please have a look: https://github.com/crotwell/gradle-macappbundle/pull/60

crotwell commented 6 years ago

Thanks for the pull request. Will be in the next version, 2.2.2.

https://plugins.gradle.org/plugin/edu.sc.seis.macAppBundle