I'm converting my application from maven to gradle, and I'm looking for maven-release-plugin alternative for gradle.
All I need from the plugin is:
I guess, the most popular one is Gradle Release Plugin (https://github.com/researchgate/gradle-release). It works just fine, however, it stores the version in a separate file "gradle.properties". I need to store this version in "build.gradle" file (like a version in pom.xml).
I also tested following plugins, but they don't store version in build.gradle too:
Are there any Gradle plugins which can work with version in "build.gradle" file?
You could e. g. make
plugins {
id 'net.researchgate.release' version '2.4.0'
}
version = '1.2.3'
release {
versionPropertyFile = 'build.gradle'
}
updateVersion.doLast {
def buildGradle = file('build.gradle')
buildGradle.text = buildGradle.text.replaceFirst(~/version = (\d++\.\d++\.\d++)/, 'version = \'$1\'')
}