Skip to content

Instantly share code, notes, and snippets.

@166MMX
Last active December 16, 2015 13:29
Show Gist options
  • Save 166MMX/5442238 to your computer and use it in GitHub Desktop.
Save 166MMX/5442238 to your computer and use it in GitHub Desktop.
task distJar(type: Jar, dependsOn: jar) {
group = DistributionPlugin.DISTRIBUTION_GROUP
classifier = 'all'
from {
configurations.runtime.collect {
it.isDirectory() ? it : zipTree(it)
}
}
from {
jar.outputs.files.collect {
it.isDirectory() ? it : zipTree(it)
}
}
exclude 'META-INF/MANIFEST.MF'
exclude 'META-INF/*.SF'
exclude 'META-INF/*.DSA'
exclude 'META-INF/*.RSA'
manifest {
attributes = [
'Implementation-Title': '',
'Implementation-Version': version,
'Built-By': System.getProperty('user.name'),
'Built-Date': new Date(),
'Built-JDK': System.getProperty('java.version'),
'Built-Gradle': gradle.gradleVersion,
'Main-Class': mainClassName,
//'Class-Path': configurations.runtime.collect { it.name }.join(' '),
]
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment