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?
In Android Studio, go to File > Project Structure. Then select the "project" tab on the left. Your Gradle version will be displayed here.
The gradle-release plugin is designed to work similar to the Maven release plugin. The gradle release task defines the following as the default release process: The plugin checks for any un-committed files (Added, modified, removed, or un-versioned). Checks for any incoming or outgoing changes.
Gradle declares dependencies on JAR files inside your project's module_name /libs/ directory (because Gradle reads paths relative to the build.gradle file). This declares a dependency on version 12.3 of the "app-magic" library, inside the "com.example.android" namespace group.
Verify Gradle Installation. Now open the command prompt. In the command prompt, enter Gradle -version. It will display the current version of Gradle just installed on the screen.
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\'')
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With