在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
开源软件名称(OpenSource Name):ari/gradle-release-plugin开源软件地址(OpenSource Url):https://github.com/ari/gradle-release-plugin开源编程语言(OpenSource Language):Groovy 100.0%开源软件介绍(OpenSource Introduction):Gradle release pluginGradle releases made easy. Other release processes force you to store your versioning information inside the project files such as build.gradle; this plugin keeps versions where they belong, in your version control system. We currently support subversion or git. Additional SCM choices are easy to add. This plugin doesn't try to take over your release management process. Maven's release plugin will create two or three commits, alter the pom twice and have a number of unusual side effects. Instead, this plugin does two simple and clear things: Other similar pluginsBecause this plugin hasn't been worked on for a while, you might like to take a look at https://github.com/IntershopCommunicationsAG/scmversion-gradle-plugin which has similar goals with regard to generating a version number from the branch structure. I haven't used it, but it looks nice. What this plugin does1. Version numberingUse this plugin to give your project a version number aligned to the branch or tag you are building from. The plugin generates a version name based on the current branch name. So let's say you are building a project in subversion and your working copy was checked out from https://svn.acme.com/project/trunk. In this case, the gradle property release.projectVersion will be set to 'trunk-SNAPSHOT'. If you are building code checked out from https://svn.acme.com/project/tags/1.2, release.projectVersion will be '1.2'. And if you are building from https://svn.acme.com/project/branches/big-refactor, the you'll get 'big-refactor-SNAPSHOT'. Git is just the same. The version will automatically be set to the tag name or branch name. No longer will you be changing the version in build.gradle or properties as you make new branches or tag your code. No longer will some plugin be guessing what the next release version will be. The main effect of this plugin in regular use is to set the variable "release.projectVersion". What you do with it is up to you, but typically you would have a line:
At any time you can override the version number which this plugin creates by adding a property on the command line:
2. Release taggingWhen you release, the plugin will not try to guess the release version of the product. Instead you pass it on the command line (or add a property to your CI system such as Jenkins).
Once the build is complete, the release plugin will create a tag in your SCM. UsageAdd the following to your build.gradle file: buildscript {
repositories {
mavenCentral()
maven {
url 'http://maven.tmatesoft.com/content/repositories/releases/'
}
}
dependencies {
classpath 'au.com.ish.gradle:release:2.2.2'
}
}
apply plugin: 'release'
release {
failOnSnapshotDependencies = true
allowLocalModifications = false
releaseDryRun = false
scm = 'svn'
username = 'fred'
password = 'secret01'
}
version = release.projectVersion Most of the above is self-explanatory. Include the buildscript section to pull this plugin into your project. Apply the plugin, and set your project version from the output of this plugin. Make sure the above configuration is at the top build.gradle file. The options avilable are:
PropertiesYou can access two properties from this plugin once you have configured it: release.projectVersion Read only property for getting the version of this project. The version is derived from the following rules:
release.scmVersion Read only property for getting the version from the source control system. This will return the svn commit number or the git hash for the current state of the local repository. This value may be useful for putting into the manifest file of a Java project or since it can be more reliable (but not as pretty) as the public-facing version numbering. TasksMany people will want to call their build task like this to build, test, tag and upload their release artifacts.
Release notes2.2.2 (12 January 2014)Oops. Typo in the previous commit... can't set a Java property as a boolean, only as a string. 2.2.1 (4 January 2014)
2.2 (29 November 2013)
2.2b1 (25 August 2013)
2.1.3 (29 March 2013)
2.1.2 (18 February 2013)
2.1.1 (30 January 2013)
2.1 (3 December 2012)
2.0 (November 2012)
Releasing to maven centralThese notes are for the developers of this plugin only.
|
2023-10-27
2022-08-15
2022-08-17
2022-09-23
2022-08-13
请发表评论