1+ import java.text.SimpleDateFormat
2+
13buildscript {
24 repositories {
35 mavenCentral()
@@ -13,9 +15,26 @@ apply plugin: 'groovy'
1315apply plugin : ' maven-publish'
1416apply plugin : ' com.jfrog.bintray'
1517
18+ def getDevelopmentVersion () {
19+ def output = new StringBuilder ()
20+ def error = new StringBuilder ()
21+ def gitShortHash = " git -C ${ projectDir} rev-parse --short HEAD" . execute()
22+ gitShortHash. waitForProcessOutput(output, error)
23+ def gitHash = output. toString(). trim()
24+ if (gitHash. isEmpty()) {
25+ println " git hash is empty: error: ${ error.toString()} "
26+ throw new IllegalStateException (" git hash could not be determined" )
27+ }
28+ new SimpleDateFormat (' yyyy-MM-dd\' T\' HH-mm-ss' ). format(new Date ()) + " -" + gitHash
29+ }
30+
31+
32+ def releaseVersion = System . env. RELEASE_VERSION
33+ version = releaseVersion ? releaseVersion : getDevelopmentVersion()
1634group = ' com.graphql-java'
17- version = ' 0.0.1-SNAPSHOT '
35+
1836sourceCompatibility = 1.8
37+ targetCompatibility = 1.8
1938
2039repositories {
2140 mavenCentral()
@@ -50,9 +69,9 @@ publishing {
5069 publications {
5170 maven(MavenPublication ) {
5271 from components. java
53- groupId ' com.graphql-java '
72+ groupId group
5473 artifactId ' graphql-java-extended-scalars'
55- version project . version
74+ version version
5675
5776 artifact sourcesJar
5877 artifact javadocJar
0 commit comments