I just started to experiment with the plugin, and started with the following block:
gitVersion {
rules {
onBranch('master') {
version = '1.0.0-master'
}
onBranch(~/release\/v(\d+\.\d+\.\d+)/) {
version = matches[1]
version.prereleaseTag = "-rc." + countCommitsSince(branchPoint('origin/develop'))
}
}
}
Running ./gradlew showGitVersion on branch release/v1.2.3:
$ ./gradlew cleanDetermineGitVersion showGitVersion
> Task :showGitVersion
1.2.3--rc.1
Note the duplicate --, due to my inserting it into the prereleaseTag manually.
I then removed that additional -, and reran showGitVersion:
$ ./gradlew showGitVersion
> Task :showGitVersion
1.2.3--rc.1
Browsing through your sources, I saw something about a cache, and ran ./gradlew cleanDetermineGitVersion showGitVersion:
$ ./gradlew cleanDetermineGitVersion showGitVersion
> Task :showGitVersion
1.2.3-rc.1
So it looks like changes to the branching rules are not picked up by Gradle's up-to-date checks. Probably because you tagged the rules container in DetermineGitVersion as @Internal instead of @Input.
I just started to experiment with the plugin, and started with the following block:
Running
./gradlew showGitVersionon branchrelease/v1.2.3:Note the duplicate
--, due to my inserting it into the prereleaseTag manually.I then removed that additional
-, and reranshowGitVersion:Browsing through your sources, I saw something about a cache, and ran
./gradlew cleanDetermineGitVersion showGitVersion:So it looks like changes to the branching rules are not picked up by Gradle's up-to-date checks. Probably because you tagged the rules container in
DetermineGitVersionas@Internalinstead of@Input.