在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
开源软件名称(OpenSource Name):palantir/gradle-gitsemver开源软件地址(OpenSource Url):https://github.com/palantir/gradle-gitsemver开源编程语言(OpenSource Language):Java 98.4%开源软件介绍(OpenSource Introduction):Gitsemver plugin for gradleWhy?To create an alternative to using How does it work?
Example:Suppose we have a git history that looks like this (newest on top):
For each ref that I could checkout, the version would be:
Finally, if I were on the develop branch and had uncommitted changes the version would be v0.1.0-dev+3.geeeeeee.dirty Can you explain your modified semver sort?Sure. Standard semantic versioning sorts words alphabetically. This is not wanted if you're going to be creating tags like Adding to your buildbuildscript {
repositories {
mavenCentral()
maven {
url "http://dl.bintray.com/palantir/releases"
}
}
dependencies {
classpath 'com.palantir:gradle-gitsemver:0.6.0'
}
}
apply plugin: 'gitsemver'
version semverVersion() Now verify that the version is being applied: $ gradle properties | grep version
version: v0.0.0-58-g5f78071.dirty Prefix tagsGitsemver supports a special mode of operation where it looks for tags with a given prefix. This can be done using the apply plugin: 'gitsemver'
version semverVersionPrefix("projecta") This will look for all tags with form This is useful in cases in which multiple subprojects need to be independently versioned. Topological SemverIt's also possible to have the tags sorted by how far from HEAD they are. To use the topological sorting, copy this into your build file: apply plugin: 'gitsemver'
version semverVersionTopo() Topological sorting will then find the closest tag to HEAD, and use that tag as the base for the version. It will strip off the prefix. Topological Prefixed SemverIt's possible to combine the prefix and topological methods. This will work just like topological semver except will choose the closest one with the prefix. apply plugin: 'gitsemver'
version semverVersionTopoPrefix('myprefixed') Version ObjectThe plugin's version methods return a class SemverVersion {
String toString() // The full version string
String tagName // The matched tag
String gitHash // The git commit hash of the HEAD commit
Integer commitCountFromTag // The number of commits HEAD is from the matched tag
Integer buildNumber // The value of the BUILD_NUMBER environment variable
boolean dirty // Is the git repo dirty?
} |
2023-10-27
2022-08-15
2022-08-17
2022-09-23
2022-08-13
请发表评论