From 1f939fc2a4029256141332810ae63fe83fac4271 Mon Sep 17 00:00:00 2001 From: Arnout Engelen Date: Wed, 8 Aug 2018 16:33:10 +0200 Subject: [PATCH] Allow dashes in tags on travis (#334) * Allow dashes in tag for Maven travis build * Allow tags with dashes for the Gradle build --- .travis.yml | 4 ++-- gradle-plugin/build.gradle | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.travis.yml b/.travis.yml index d026316da..b7ae2c46d 100644 --- a/.travis.yml +++ b/.travis.yml @@ -17,9 +17,9 @@ jobs: env: SBT-JAVA - script: sbt publishLocal && cd plugin-tester-scala && sbt compile env: SBT-SCALA - - script: sbt publishM2 && cd plugin-tester-java && mvn -Dakka.grpc.project.version=`git describe --tags | sed -e "s/v\([0-9]*.[0-9]*\)-\([0-9]*\).*/\\1+\\2-/"``git rev-parse HEAD | head -c8` akka-grpc:generate compile + - script: sbt publishM2 && cd plugin-tester-java && mvn -Dakka.grpc.project.version=`git describe --tags | sed -e "s/v\(.*\)-\([0-9][0-9]*\).*/\\1+\\2-/"``git rev-parse HEAD | head -c8` akka-grpc:generate compile env: MAVEN-JAVA - - script: sbt publishM2 && cd plugin-tester-scala && mvn -Dakka.grpc.project.version=`git describe --tags | sed -e "s/v\([0-9]*.[0-9]*\)-\([0-9]*\).*/\\1+\\2-/"``git rev-parse HEAD | head -c8` akka-grpc:generate scala:compile + - script: sbt publishM2 && cd plugin-tester-scala && mvn -Dakka.grpc.project.version=`git describe --tags | sed -e "s/v\(.*\)-\([0-9][0-9]*\).*/\\1+\\2-/"``git rev-parse HEAD | head -c8` akka-grpc:generate scala:compile env: MAVEN-SCALA - script: sbt publishM2 && cd plugin-tester-java && ./gradlew --include-build ../gradle-plugin clean compileJava env: GRADLE-JAVA diff --git a/gradle-plugin/build.gradle b/gradle-plugin/build.gradle index 6ddbc537c..8c043aaea 100644 --- a/gradle-plugin/build.gradle +++ b/gradle-plugin/build.gradle @@ -21,7 +21,7 @@ group = "com.lightbend.akka.grpc" // https://github.com/palantir/gradle-git-version/issues/97 def tag = "git describe --tags".execute().text.substring(1).split("-g")[0].replace("\n", "") -def finalVersion = (tag == versionDetails().lastTag.substring(1)) ? tag : tag.replace("-", "+") + "-" + versionDetails().gitHash.substring(0, 8) +def finalVersion = (tag == versionDetails().lastTag.substring(1)) ? tag : tag.reverse().replaceFirst("-", "+").reverse() + "-" + versionDetails().gitHash.substring(0, 8) version = finalVersion