Skip to content

Commit

Permalink
Fix gradle plugin publish
Browse files Browse the repository at this point in the history
* Travis command had missing quote
* Versions that are a tag still ended up with a commit hash
  • Loading branch information
chbatey committed Aug 8, 2018
1 parent ec375f4 commit 8c91906
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ jobs:
script: git branch -f "$TRAVIS_BRANCH" && git checkout "$TRAVIS_BRANCH" && sbt whitesourceCheckPolicies whitesourceUpdate
- stage: publish
script: sbt publish
- script: cd gradle-plugin && echo "gradle.publish.key=AwHNbsVBKA20KPzWQyCRbgGQHWa9Us5Y\ngradle.publish.secret=$GRADLE_SECRET' > ~/.gradle/gradle.properties && ./gradlew publishPlugins
- script: cd gradle-plugin && echo "gradle.publish.key=AwHNbsVBKA20KPzWQyCRbgGQHWa9Us5Y\ngradle.publish.secret=$GRADLE_SECRET" > ~/.gradle/gradle.properties && ./gradlew publishPlugins
- stage: techhub-ping
script: curl -I https://ci.lightbend.com/job/techhub-publisher/build?token=$TECH_HUB_TOKEN

Expand Down
6 changes: 5 additions & 1 deletion gradle-plugin/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,11 @@ plugins {

group = "com.lightbend.akka.grpc"
// https://github.com/palantir/gradle-git-version/issues/97
version "git describe --tags".execute().text.substring(1).split("-g")[0].replace('-', '+') + "-" + versionDetails().gitHash.substring(0, 8)

def tag = "git describe --tags".execute().text.substring(1).split("-g")[0].replace("\n", "")
def suffix = (tag == versionDetails().lastTag.substring(1)) ? "" : "+" + versionDetails().gitHash.substring(0, 8)

version = tag + suffix

gradlePlugin {
plugins {
Expand Down

0 comments on commit 8c91906

Please sign in to comment.