Skip to content

Instantly share code, notes, and snippets.

@johnrengelman
Created August 19, 2014 03:11
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 johnrengelman/eb3c40f37101ee580214 to your computer and use it in GitHub Desktop.
Save johnrengelman/eb3c40f37101ee580214 to your computer and use it in GitHub Desktop.
Shadow & Release plugin
buildscript {
repositories {
jcenter()
maven { url "https://oss.sonatype.org/content/groups/public"}
}
dependencies {
classpath 'com.github.jengelman.gradle.plugins:shadow:1.0.3'
classpath 'com.github.townsfolk:gradle-release:1.2'
}
}
apply plugin: 'java'
apply plugin: 'release'
apply plugin: 'com.github.johnrengelman.shadow'
version '1.0'
repositories {
jcenter()
}
dependencies {
compile 'com.github.jengelman.gradle.plugins:shadow:1.0.3'
runtime 'com.github.townsfolk:gradle-release:1.2'
}
def versionDependency = "version_dependencies.conf"
shadowJar {
classifier = ''
from versionDependency
mergeServiceFiles()
}
jar {
manifest {
attributes('Implementation-Title': 'Gradle',
'Implementation-Version': version,
'Built-By': System.getProperty('user.name'),
'Built-Date': new Date(),
'Built-JDK': System.getProperty('java.version'),
'Class-Path': configurations.runtime.files.collect { it.name }.join(' '))
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment