Skip to content

Commit

Permalink
Allow dashes in tags on travis (#334)
Browse files Browse the repository at this point in the history
* Allow dashes in tag for Maven travis build
* Allow tags with dashes for the Gradle build
  • Loading branch information
raboof authored and chbatey committed Aug 8, 2018
1 parent fff5651 commit 1f939fc
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion gradle-plugin/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit 1f939fc

Please sign in to comment.