在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
开源软件名称(OpenSource Name):stianh/gradle-release-plugin开源软件地址(OpenSource Url):https://github.com/stianh/gradle-release-plugin开源编程语言(OpenSource Language):Groovy 78.0%开源软件介绍(OpenSource Introduction):Gradle release plugin (Git and Subversion)This is a Gradle plugin that makes it very simple to automate release management when using git or Subversion as vcs. The plugin is responsible for knowing the version to build at all times. You should not use this plugin if you want/need to be in control of the version name/number. In the case of a normal gradle build, the plugin generates a version name based on the current branch name: ${branchName}-SNAPSHOT. If you run the task releasePrepare, the plugin will query git/svn for the latest release tag and add one to the number. The artifacts will have a version name like master-REL-1 (if this is the first time you run :releasePrepare). A release tag with the version name will be created in git/svn. (The tag will NOT be pushed in this task when using git.) If you want the artifacts to be uploaded and the releaseTag to be pushed, run the releasePerform task. This task depends on releasePrepare so it will run first. Notice: The build will fail if you try to run releasePrepare again, with an error message telling you that there is no changes since the last release tag. If you want to rebuild a release, just run a normal gradle build and the plugin will figure out that the current HEAD is a release tag and use the release version. The same applies if you checkout a release tag and run build. UsageAdd the following to your build file to setup where the plugin should be downloaded from: apply plugin: 'gitrelease' // or apply plugin: 'svnrelease'
buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath 'no.entitas.gradle:gradle-release-plugin:1.16'
}
} Notice: This must be in the root build file in a multi-module build, that is, the release plugin can only be applied at the top level. To setup where your artifacts should be deployed, use a regular uploadArchives.repositories.mavenDeployer {
uniqueVersion = false
repository(url: '...release distribution url...') {
// username/password resolved from gradle.properties
authentication(userName: project.username, password: project.password)
}
snapshotRepository(url: '...snapshot distribution url...') {
// username/password resolved from gradle.properties
authentication(userName: project.username, password: project.password)
}
} In a multi-module build this will typically be setup for each subproject that needs to be deployed. ConfigurationThe closure below shows the available configuration options and their default values: release {
failOnSnapshotDependencies = false
versionStrategy = { currentVersion ->
if (System.properties['release.version']) {
System.properties['release.version']
} else {
new BigDecimal(currentVersion).add(BigDecimal.ONE).toPlainString()
}
}
startVersion = { currentBranch -> "1" }
}
TasksreleasePrepare
releasePerform
Known issues and limitations
|
2023-10-27
2022-08-15
2022-08-17
2022-09-23
2022-08-13
请发表评论