Skip to content

Instantly share code, notes, and snippets.

@grimrose
Created April 29, 2017 12:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save grimrose/1259d22acc51a07a97664316ca7d5a42 to your computer and use it in GitHub Desktop.
Save grimrose/1259d22acc51a07a97664316ca7d5a42 to your computer and use it in GitHub Desktop.
shadow + launch4j plugin study
buildscript {
repositories {
maven {
url "https://plugins.gradle.org/m2/"
}
}
dependencies {
classpath 'gradle.plugin.edu.sc.seis.gradle:launch4j:2.3.0'
classpath "com.github.jengelman.gradle.plugins:shadow:1.2.4"
}
}
apply plugin: 'groovy'
apply plugin: 'application'
apply plugin: 'edu.sc.seis.launch4j'
apply plugin: "com.github.johnrengelman.shadow"
repositories {
jcenter()
}
dependencies {
compile 'org.codehaus.groovy:groovy-all:2.4.10'
compile group: 'org.slf4j', name: 'slf4j-api', version: '1.7.25'
compile group: 'ch.qos.logback', name: 'logback-classic', version: '1.2.3'
}
mainClassName = 'org.grimrose.sandbox.groovy.Main'
shadowJar {
baseName = project.name
}
launch4j {
copyConfigurable = project.tasks.shadowJar.outputs.files
jar = "lib/${project.tasks.shadowJar.archiveName}"
headerType = 'console'
}
task createZip(type: Zip) {
classifier = distZip.classifier
from "${project.buildDir}/${launch4j.outputDir}/${project.name}.exe"
}
createZip.dependsOn createExe
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment