• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1import java.text.SimpleDateFormat
2
3Date buildTimeAndDate = new Date()
4ext {
5    buildTime = new SimpleDateFormat('yyyy-MM-dd').format(buildTimeAndDate)
6    buildDate = new SimpleDateFormat('HH:mm:ss.SSSZ').format(buildTimeAndDate)
7    cedricVersion = '1.51'
8}
9
10apply plugin: 'maven-publish'
11apply plugin: 'com.jfrog.bintray'
12
13jar {
14    manifest {
15        attributes(
16            'Built-By': System.properties['user.name'],
17            'Created-By': System.properties['java.version'] + " (" + System.properties['java.vendor'] + " " + System.getProperty("java.vm.version") + ")",
18            'Build-Date': project.buildTime,
19            'Build-Time': project.buildDate,
20            'Specification-Title': project.name,
21            'Specification-Version': project.version,
22        )
23    }
24}
25
26publishing {
27    publications {
28        mavenCustom(MavenPublication) {
29            from components.java
30            artifact sourceJar
31
32            groupId 'com.beust'
33            artifactId 'jcommander'
34            version project.version
35
36//            pom.withXml {
37//                asNode().children().last() + pomConfig
38//            }
39        }
40    }
41}
42
43task install(dependsOn: publishToMavenLocal)
44
45Properties properties = new Properties()
46properties.load(project.rootProject.file('local.properties').newDataInputStream())
47
48bintray {
49    user = properties.getProperty("bintray.user")
50    key = properties.getProperty("bintray.apikey")
51    publications = ['mavenCustom']
52    pkg {
53        repo = 'maven'
54        name = 'jcommander'
55        desc = 'Command line parsing for Java'
56        licenses = ['Apache-2.0']
57        labels = ['java']
58
59        version {
60            name = project.version //Bintray logical version name
61        }
62    }
63}
64