So the versioning.gradle, using the version.txt, handles the part about building either a snapshot, release candidate or release.
Then when building, either the milestoneNumber, rcNumber or finalRelease is provided as a property to the build.
gradle build -PmilestoneNumber=1
gradle build -PrcNumber=1
gradle build -PfinalRelease
What CI server do Gradle use?
How does the promotionBuild work?
- Git change
– CI builds a snapshot
- Git change + version.txt
– CI builds a release (rc or final)
The properties rcNumber and finalRelease must come from the CI, but how are they determined? It can’t be by parsing the version.txt, because that is read after the properties are read in versioning.gradle.
We are using Jenkins to build our projects with gradle.
Currently we are using git tags to determine to build either a snapshot or release.
- Manually create a git tag to release
- Jenkins detects the new git tag
- Manually start the tag build (this could though be done automatically in Jenkins)
Thus we do not need a version.txt to increment and get git commit for version bumps, but a person do need to inspect the git tags to determine the next version before tagging. Thought this could be done automatically with a gradle task.
gradle nextRelease -PrcNumber=1