I need my artifact to be built with project.version
equals to snapshot git based version.
For example, default version after clean build
or idea build:
0.2-dev.#hash
I need: 1.1-SNAPSHOT
where 1.1 is from git tag, like when I run snapshot
task
I tried to change ReleasePluginExtension.groovy:
release {
defaultVersionStrategy = Strategies.SNAPSHOT
}
And
release {
versionStrategy(Strategies.SNAPSHOT)
}
Doesn't work
My current workaround to set project.version inside by build.gradle like in library code - create object of snapshot strategy and call #version() method:
release {
def gitRoot = project.hasProperty('git.root') ? project.property('git.root') : project.rootProject.projectDir
def git = Grgit.open(dir: gitRoot)
project.version = Strategies.SNAPSHOT.infer(project, git).version()
}
But i think it should be customizable by nebula-plugin.