Home | History | Annotate | Download | only in gradle
      1 import java.text.SimpleDateFormat
      2 
      3 apply plugin: 'signing'
      4 
      5 Date buildTimeAndDate = new Date()
      6 ext {
      7     buildTime = new SimpleDateFormat('yyyy-MM-dd').format(buildTimeAndDate)
      8     buildDate = new SimpleDateFormat('HH:mm:ss.SSSZ').format(buildTimeAndDate)
      9 }
     10 
     11 jar {
     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 
     24 javadoc {
     25     failOnError false
     26 }
     27 
     28 task javadocJar(type: Jar, dependsOn: javadoc) {
     29     classifier = 'javadoc'
     30     from 'build/docs/javadoc'
     31 }
     32 
     33 task sourcesJar(type: Jar) {
     34     from sourceSets.main.allSource
     35     classifier = 'sources'
     36 }
     37 
     38 artifacts {
     39     archives jar
     40     archives javadocJar
     41     archives sourcesJar
     42 }
     43 
     44 buildscript {
     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 
     55 apply from: 'gradle/publishing-maven.gradle'
     56 apply from: 'gradle/publishing-jcenter.gradle'
     57 
     58