Created
February 8, 2015 21:22
-
-
Save arthurtsang/a0f4db90e175481c71f5 to your computer and use it in GitHub Desktop.
gradle shadow plugin with build date in manifest
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
buildscript { | |
repositories { | |
jcenter() | |
} | |
dependencies { | |
classpath 'io.ratpack:ratpack-gradle:0.9.13' | |
classpath 'com.github.jengelman.gradle.plugins:shadow:1.2.0' | |
} | |
} | |
apply plugin: "io.ratpack.ratpack-java" | |
apply plugin: "com.github.johnrengelman.shadow" | |
version = '1.0' | |
mainClassName = 'com.acme.core.AppMain' | |
import java.text.SimpleDateFormat | |
shadowJar { | |
mergeServiceFiles() | |
manifest { | |
attributes 'Built-Date': (new SimpleDateFormat("yyyy/MM/dd")).format(new Date()) //today's date | |
attributes 'Built-By': System.getProperty('user.name') | |
attributes 'Build-Jdk': System.getProperty('java.version') | |
attributes 'Implementation-Title': project.name | |
attributes 'Implementation-Version': project.version | |
attributes 'Implementation-Vendor-Id': project.group | |
} | |
exclude 'server.log' | |
exclude '*.log.gz' | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment