Skip to content

Commit

Permalink
Merge pull request #34 from palantir/feature/make-version-code-make-m…
Browse files Browse the repository at this point in the history
…ore-sense

Feature/make version code make more sense
  • Loading branch information
joelea committed Mar 10, 2016
2 parents 97f0d60 + addfb90 commit c85a3f3
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 4 deletions.
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ apply from: "gradle/idea.gradle"
apply plugin: 'java'

group = 'com.palantir.docker.compose'
version "git describe --tags --dirty".execute().text.trim().replaceAll(/^v/, '')
version "git describe --tags --dirty".execute().text.trim()

apply plugin: 'com.palantir.baseline-checkstyle'
apply plugin: 'com.palantir.baseline-eclipse'
Expand Down
2 changes: 1 addition & 1 deletion circle.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ general:

deployment:
release:
tag: /v?[0-9]+(\.[0-9]+)+/
tag: /[0-9]+(\.[0-9]+)+/
commands:
- ./gradlew -i bintrayUpload

Expand Down
12 changes: 10 additions & 2 deletions gradle/publish.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,16 @@ bintray {
}

bintrayUpload.onlyIf {
System.out.println("Publishing with project version: " + project.version.toString())
System.env.BINTRAY_USER && System.env.BINTRAY_KEY && project.version.toString() ==~ /v?\d+\.\d+\.\d+/
println "Attempting to publish with project version: " + project.version.toString()

def versionIsInCorrectFormat = project.version.toString() ==~ /\d+\.\d+\.\d+/

if (!versionIsInCorrectFormat) {
println "Cannot publish project with version " + project.version.toString() +
"; it must be in form 'major.minor.patch'"
}

System.env.BINTRAY_USER && System.env.BINTRAY_KEY && versionIsInCorrectFormat
}

bintrayUpload.dependsOn 'generatePomFileForBintrayPublication', 'build'
Expand Down

0 comments on commit c85a3f3

Please sign in to comment.