-
Notifications
You must be signed in to change notification settings - Fork 0
Convenient Exe Task
You want to package your jar as a great-looking exe quickly. This is easier than ever with the Launch4jTemplateTask Gradle task.
buildscript {
repositories {
jcenter() // for plugin dependencies
maven {
url "https://dl.bintray.com/alessandroscarlatti/maven"
}
}
dependencies {
classpath 'com.scarlatti:launch4j-gradle-plugin:1.0.1'
}
}
apply plugin: 'java' // and other plugins...
apply plugin: 'com.scarlatti.launch4j.integration'
If your build produces an executable jar this can be extremely simple.
import com.scarlatti.launch4j.Launch4jTemplateTask
task simpleExe(type: Launch4jTemplateTask) {
}
Go ahead and run the simpleExe task. You should now have an exe waiting for you at /build/launch4j/basicExe/basicExe.exe.
That's it.
The Launch4jTemplateTask takes an opinionated view on providing resources, such as an icon. You may provide an icon (.ico) file at /exe/icon.ico and the task will automatically use it for the exe.
You may provide an splash (.bmp only) file at /exe/splash.bmp and the task will automatically use it for the exe.
Of course, properties of the actual Launch4j task can be configured.
task simpleExe(type: Launch4jExeTemplateTask) {
// configure the actual launch4j task
// more details at https://github.com/TheBoegl/gradle-launch4j
config {
companyName = "My Awesome Company"
}
}
The Launch4j plugin documentation provides details on all the configuration options available.