在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
开源软件名称(OpenSource Name):amkay/gradle-gitflow开源软件地址(OpenSource Url):https://github.com/amkay/gradle-gitflow开源编程语言(OpenSource Language):Groovy 100.0%开源软件介绍(OpenSource Introduction):gradle-gitflowAn opinionated plugin that provides Semantic Versioning for Gradle projects that use Gitflow. This plugin is heavily inspired by the gradle-git plugin.
This inferred version is set as the project version of the Gradle project to which it is applied. VersioningVersion rulesThe rules applied when inferring the version are that simple:
Version structureThe inferred versions consist of the following components: 1.2.3-dev.65+sha.9066228.dirty | | | | | | | | | | | | | | | indicates if the repository is dirty | | | | | | | | | | | | | abbreviated SHA of the current commit | | | | | | | | | | | prefix of the SHA | | | | | | | | | # of commits since the last tag | | | | | | | denotes the current branch | | | | | patch version | | | minor version | major version Mapping between Gitflow branches and pre-release identifiersThe following table shows the mapping between Gitflow branches and the corresponding pre-release identifiers that indicate these branches.
UsageInclude the following in the project on which you want to apply the plugin: buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.github.amkay:gradle-gitflow:0.2.0'
}
}
apply plugin: 'com.github.amkay.gitflow'
ConfigurationThe plugin registers an extension object named gitflow {
// Use a different Git repository
repositoryRoot 'foo/bar' // defaults to project.projectDir
// Pre-release identifiers based on Gitflow branches
preReleaseIds {
release 'foo' // defaults to ''
develop 'foo' // defaults to 'dev'
preRelease 'foo' // defaults to 'pre'
detachedHead 'foo' // defaults to 'detached'
// The following ones are used as prefixes
feature 'foo' // defaults to 'feature'
hotfix 'foo' // defaults to 'fix'
support 'foo' // defaults to 'support'
}
// Build metadata identifiers that are used as static text
buildMetadataIds {
sha 'foo' // Defaults to 'sha'
dirty 'foo' // Defaults to 'dirty'
}
} Gitflow plugins for GitIf you do not use one of the mentioned plugins and differ from the default names mentioned in Mapping between Gitflow branches and pre-release identifiers, you will have to manually set the branch names and prefixes of the Gitflow branches and prefixes in The following example shows the default configuration of the above plugins: [gitflow "branch"] master = master develop = develop [gitflow "prefix"] feature = feature/ release = release/ hotfix = hotfix/ support = support/ versiontag =
Additional functionality of the version objectThe following additional functionality is provided by the version object that this plugin provides. You can have a look at the Groovydoc documentation for further information. Version typeThe type of the inferred version is derived from the current branch and corresponds to the branches mentioned in Mapping between Gitflow branches and pre-release identifiers. This can be used in your buildscripts for distinguishing between development and production builds, e.g. for deploying to staging and production as seen in the following example. import static com.github.amkay.gradle.gitflow.version.VersionType.*
task deploy << {
if (version.type == DEVELOP) {
// Deploy to staging...
} else if (version.type == RELEASE) {
// Deploy to production...
}
}
|
2023-10-27
2022-08-15
2022-08-17
2022-09-23
2022-08-13
请发表评论