summaryrefslogtreecommitdiff
path: root/gradle/publishing.gradle
diff options
context:
space:
mode:
Diffstat (limited to 'gradle/publishing.gradle')
-rw-r--r--gradle/publishing.gradle63
1 files changed, 63 insertions, 0 deletions
diff --git a/gradle/publishing.gradle b/gradle/publishing.gradle
new file mode 100644
index 0000000..e65a133
--- /dev/null
+++ b/gradle/publishing.gradle
@@ -0,0 +1,63 @@
+import java.text.SimpleDateFormat
+
+Date buildTimeAndDate = new Date()
+ext {
+ buildTime = new SimpleDateFormat('yyyy-MM-dd').format(buildTimeAndDate)
+ buildDate = new SimpleDateFormat('HH:mm:ss.SSSZ').format(buildTimeAndDate)
+ cedricVersion = '1.51'
+}
+
+apply plugin: 'maven-publish'
+apply plugin: 'com.jfrog.bintray'
+
+jar {
+ manifest {
+ attributes(
+ 'Built-By': System.properties['user.name'],
+ 'Created-By': System.properties['java.version'] + " (" + System.properties['java.vendor'] + " " + System.getProperty("java.vm.version") + ")",
+ 'Build-Date': project.buildTime,
+ 'Build-Time': project.buildDate,
+ 'Specification-Title': project.name,
+ 'Specification-Version': project.version,
+ )
+ }
+}
+
+publishing {
+ publications {
+ mavenCustom(MavenPublication) {
+ from components.java
+ artifact sourceJar
+
+ groupId 'com.beust'
+ artifactId 'jcommander'
+ version project.version
+
+// pom.withXml {
+// asNode().children().last() + pomConfig
+// }
+ }
+ }
+}
+
+task install(dependsOn: publishToMavenLocal)
+
+Properties properties = new Properties()
+properties.load(project.rootProject.file('local.properties').newDataInputStream())
+
+bintray {
+ user = properties.getProperty("bintray.user")
+ key = properties.getProperty("bintray.apikey")
+ publications = ['mavenCustom']
+ pkg {
+ repo = 'maven'
+ name = 'jcommander'
+ desc = 'Command line parsing for Java'
+ licenses = ['Apache-2.0']
+ labels = ['java']
+
+ version {
+ name = project.version //Bintray logical version name
+ }
+ }
+}