1import java.text.SimpleDateFormat 2 3apply plugin: 'signing' 4 5Date buildTimeAndDate = new Date() 6ext { 7 buildTime = new SimpleDateFormat('yyyy-MM-dd').format(buildTimeAndDate) 8 buildDate = new SimpleDateFormat('HH:mm:ss.SSSZ').format(buildTimeAndDate) 9} 10 11jar { 12 manifest { 13 attributes( 14 'Built-By': System.properties['user.name'], 15 'Created-By': System.properties['java.version'] + " (" + System.properties['java.vendor'] + " " + System.getProperty("java.vm.version") + ")", 16 'Build-Date': project.buildTime, 17 'Build-Time': project.buildDate, 18 'Specification-Title': project.name, 19 'Specification-Version': project.version, 20 ) 21 } 22} 23 24javadoc { 25 failOnError false 26} 27 28task javadocJar(type: Jar, dependsOn: javadoc) { 29 classifier = 'javadoc' 30 from 'build/docs/javadoc' 31} 32 33task sourcesJar(type: Jar) { 34 from sourceSets.main.allSource 35 classifier = 'sources' 36} 37 38artifacts { 39 archives jar 40 archives javadocJar 41 archives sourcesJar 42} 43 44buildscript { 45 repositories { 46 jcenter() 47 48 } 49 dependencies { 50 //Check for the latest version here: http://plugins.gradle.org/plugin/com.jfrog.artifactory 51 classpath "org.jfrog.buildinfo:build-info-extractor-gradle:3.0.3" 52 } 53} 54 55apply from: 'gradle/publishing-maven.gradle' 56apply from: 'gradle/publishing-jcenter.gradle' 57 58