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

Feature request: splash screen #28

Closed ketbra closed 9 years ago

ketbra commented 9 years ago

This is a nice to have. I have figured out a workaround for now.

The JavaAppLauncher does not load a splash screen as specified by the SplashScreen-Image attribute in the main jar. I am able to get it to load by copying the splash image into the app folder and then updating the Info.plist properties as follows:

<key>JVMOptions</key>
<array>
  <string>-splash:$APP_ROOT/Contents/Java/splash.png</string>
  ...
</array>

This works, and for now I will add a task to modify the plist after it has been generated, but it would be convenient if there was a way of adding this option ahead of time. Right now it looks like the only options you support this way are those that are of the form key=value which does not apply here.

From GenerateInfoPlistTask.groovy:

key('JVMOptions')
   array() {
       extension.javaProperties.each { k, v->
               string("-D$k=$v")
       }
       extension.javaExtras.each { k, v->
               string("$k=$v")
       }
   }

The reason I want a splash screen is because the bundled JRE seems to take a few seconds to initialize, and I'd prefer to have faster feedback for my users.

Thanks, Matt

crotwell commented 9 years ago

I think I can accommodate this by checking for a null value and just omit the equals in that case. Something like if (v != null) { string("$k=$v") } else { string("$k") }

crotwell commented 9 years ago

Done, hopefully next version will be shortly, once I figure out the new plugin publishing stuff