I would like to use the git commitId in the manifest.mf file. In the current gradle-release-plugin version tagging will be done after build task. So git commitId can not be used in manifest.mf file. Are there any plans to support something like that? Any ideas for using git commitId in manifest.mf file?
Asked
Active
Viewed 699 times
1 Answers
0
Hey you can do this without touching the plugin but using the executor to help you.
Tested with gradle 2.13
import net.researchgate.release.cli.Executor
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'net.researchgate:gradle-release:2.4.0'
}
}
apply plugin: 'java'
apply plugin: 'net.researchgate.release'
jar {
def executor = new Executor(logger)
def version = executor.exec(['git', 'rev-parse', 'HEAD'], errorMessage: 'Error while getting last git commit id')
manifest {
attributes("Implementation-Title": "Gradle",
"Implementation-Version": version)
}
}

Hillkorn
- 633
- 4
- 12