Skip to content

Commit

Permalink
Merge branch 'release/1.0.2'
Browse files Browse the repository at this point in the history
  • Loading branch information
Nils Druyen committed Aug 9, 2019
2 parents fdaa1d9 + 2ca4d3a commit 5e589ec
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 2 deletions.
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,11 @@ Use the gradle task 'printVersions' to print out all relevant version informatio

In Android projects use the gradle task 'printApkNames' to print out all file names for each flavor to the gradle console.

### Gradle tasks
- clean build
- publishToMavenLocal
- bintrayUpload -PbintrayUser=XXX -PbintrayApiKey=XXX

## License

Copyright (c) 2017 appcom interactive GmbH
Expand Down
1 change: 1 addition & 0 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ bintray {
key = project.hasProperty('bintrayApiKey') ? project.property('bintrayApiKey') : System.getenv('BINTRAY_API_KEY')
configurations = ['archives']
publications = ['Publication']
publish = true
pkg {
repo = 'Maven'
name = projectName
Expand Down
9 changes: 7 additions & 2 deletions src/main/kotlin/eu/appcom/gradle/git/Versioning.kt
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,11 @@ object Versioning {
if (branch == "master" || branch.contains("release/") || branch.contains("hotfix/")) {
if (branch.contains("release/")) {
val tag = branch.split("/")[1]
return "$tag-rc_${getCommitCountOnBranch()}"
return try {
"$tag-rc_${getCommitCountOnBranch()}"
} catch (e: Exception) {
"$tag-rc_${getCommitCountOnBranch(getTag())}"
}
}
return getTag()
} else {
Expand All @@ -36,5 +40,6 @@ object Versioning {
return "git describe --tags $revList".get()
}

private fun getCommitCountOnBranch(): Int = "git rev-list --count develop..HEAD".getInteger()
private fun getCommitCountOnBranch(since: String = "develop"): Int =
"git rev-list --count --no-merges $since..HEAD".getInteger()
}

0 comments on commit 5e589ec

Please sign in to comment.