jgitver / jgitver/gradle-jgitver-plugin
Gradle jgitver configuration to automatically increase minor version
- Dominant language
- Java
- Stars
- 47
- Forks
- 10
- PR merge metrics
- No merged PRs in 30d
Description
I want that on the development branch version automatically gets increased by **minor** version as mostly commits do include new functionality. With default configuration patch version gets increased.
current latest tag is 1.4.0.
```
jgitver {
strategy = 'MAVEN'
nonQualifierBranches = "master,develop" // Dont add branch names to version when on specified branches.
}
```
resulting in 1.4.1
If I try to configure a pattern so that the NEXT_MINOR_VERSION would be take I get exception in version calculation
For example this works
```
jgitver {
strategy = fr.brouillard.oss.jgitver.Strategies.PATTERN
versionPattern("\${meta.CURRENT_VERSION_MAJOR}.\${meta.CURRENT_VERSION_MINOR}.\${meta.CURRENT_VERSION_PATCH}")
nonQualifierBranches = "master,develop" // Dont add branch names to version when on specified branches.
}
```
resulting in 1.4.0
while with changing the minor version to ${meta.NEXT_MINOR_VERSION}
```
jgitver {
strategy = fr.brouillard.oss.jgitver.Strategies.PATTERN
versionPattern("\${meta.CURRENT_VERSION_MAJOR}.\${meta.NEXT_MINOR_VERSION}.\${meta.CURRENT_VERSION_PATCH}")
nonQualifierBranches = "master,develop" // Dont add branch names to version when on specified branches.
}
```
I get following exception
```
Caused by: fr.brouillard.oss.jgitver.impl.VersionCalculationException: cannot compute version
at fr.brouillard.oss.jgitver.impl.PatternVersionStrategy.build(PatternVersionStrategy.java:122)
at fr.brouillard.oss.jgitver.impl.GitVersionCalculatorImpl.buildVersion(GitVersionCalculatorImpl.java:341)
... 202 more
Caused by: java.lang.IllegalStateException: cannot parse 1..0 as a semver compatible version
at fr.brouillard.oss.jgitver.Version.parse(Version.java:154)
```
Using latest stable version (quite old) 0.9.1, tried with 0.10.0-rc03 as well with the same result.
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.