在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
开源软件名称(OpenSource Name):researchgate/gradle-release开源软件地址(OpenSource Url):https://github.com/researchgate/gradle-release开源编程语言(OpenSource Language):Groovy 100.0%开源软件介绍(OpenSource Introduction):gradle-release pluginIntroductionThe gradle-release plugin is designed to work similar to the Maven release plugin.
The
Current SCM support: Bazaar, Git (1.7.2 or newer), Mercurial, and Subversion InstallationThe gradle-release plugin will work with Gradle 6.0 and beyond Legacy plugin applicationbuildscript {
repositories {
maven {
url 'https://plugins.gradle.org/m2/'
}
}
dependencies {
classpath 'net.researchgate:gradle-release:3.0.0'
}
}
apply plugin: 'net.researchgate.release' Plugin DSLplugins {
id 'net.researchgate.release' version '3.0.0'
} Please refer to the Gradle DSL PluginDependenciesSpec to understand the behavior and limitations when using the new syntax to declare plugin dependencies. UsageAfter you have your ConfigurationAs described above, the plugin will check for un-committed files and SNAPSHOT dependencies. By default the plugin will fail when any un-committed, or SNAPSHOT dependencies are found. Below are some properties of the Release Plugin Convention that can be used to make your release process more lenient
Below are some properties of the Release Plugin Convention that can be used to customize the build
Below are some properties of the Release Plugin Convention that are specific to version control.
To set any of these properties to false, add a "release" configuration to your project's
Eg. To ignore upstream changes, change 'failOnUpdateNeeded' to false:
This are all possible configuration options and its default values: release {
failOnCommitNeeded = true
failOnPublishNeeded = true
failOnSnapshotDependencies = true
failOnUnversionedFiles = true
failOnUpdateNeeded = true
revertOnFail = true
preCommitText = ''
preTagCommitMessage = '[Gradle Release Plugin] - pre tag commit: '
tagCommitMessage = '[Gradle Release Plugin] - creating tag: '
newVersionCommitMessage = '[Gradle Release Plugin] - new version commit: '
tagTemplate = '${version}'
versionPropertyFile = 'gradle.properties'
versionProperties = []
snapshotSuffix = '-SNAPSHOT'
buildTasks = ['build']
ignoredSnapshotDependencies = []
versionPatterns = [
/(\d+)([^\d]*$)/: { Matcher m, Project p -> m.replaceAll("${(m[0][1] as int) + 1}${m[0][2]}") }
]
pushReleaseVersionBranch = null
scmAdapters = [
net.researchgate.release.GitAdapter,
net.researchgate.release.SvnAdapter,
net.researchgate.release.HgAdapter,
net.researchgate.release.BzrAdapter
]
git {
requireBranch = 'main'
pushToRemote = 'origin'
pushToBranchPrefix = ''
commitVersionFileOnly = false
signTag = false
}
svn {
username = null
password = null
pinExternals = false // allows to pin the externals when tagging, requires subversion client >= 1.9.0
}
} Kotlin DSL Exampleimport net.researchgate.release.ReleaseExtension
repositories {
maven {
url 'https://plugins.gradle.org/m2/'
}
}
dependencies {
classpath 'net.researchgate:gradle-release:3.0.0'
}
apply(plugin = "base")
apply(plugin = "net.researchgate.release")
configure<ReleaseExtension> {
ignoredSnapshotDependencies.set(listOf("net.researchgate:gradle-release"))
with(git) {
requireBranch = "master"
}
} Custom release stepsTo add a step to the release process is very easy. Gradle provides a very nice mechanism for manipulating existing tasks. There are two available hooks provided: For example, if we wanted to make sure afterReleaseBuild.dependsOn uploadArchives Multi-Project BuildsSupport for multi-project builds isn't complete, but will work given some assumptions. The gradle-release plugin assumes and expects that only one version control system is used by both root and sub projects. Apply the plugin separately to each subproject that you wish to release. Release using a qualified task name, e.g.: ./gradlew :sub:release # release a subproject named "sub"
./gradlew :release # release the root project Working in Continuous IntegrationIn a continuous integration environment like Jenkins or Hudson, you don't want to have an interactive release process. To avoid having to enter any information manually during the process, you can tell the plugin to automatically set and update the version number. You can do this by setting the gradle release -Prelease.useAutomaticVersion=true -Prelease.releaseVersion=1.0.0 -Prelease.newVersion=1.1.0-SNAPSHOT Getting HelpTo ask questions please use stackoverflow or github issues.
To report bugs, please use the GitHub project.
|
2023-10-27
2022-08-15
2022-08-17
2022-09-23
2022-08-13
请发表评论