Skip to content

Commit f5a146b

Browse files
committed
Set abbreviation length of hashes to a fixed 7, since the length is dynamic in som git versions.
1 parent b97ed88 commit f5a146b

3 files changed

Lines changed: 12 additions & 2 deletions

File tree

CONTRIBUTORS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
Mikael Brännström
22
Anders Lindgren
3+
Morgan Johansson
34

build.gradle

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,16 @@ task (fixPublishPlugins) {
121121
// Gradle Plugin Portal does not support signed artifacts, but Maven Central requires signed artifacts.
122122
// Remove signed artifacts if publishing to Gradle Plugin Portal
123123
doFirst {
124-
configurations.archives.artifacts.removeAll { it.extension == "asc" }
124+
configurations.archives.artifacts.with { archives ->
125+
def jarArtifact
126+
archives.each {
127+
if (it.extension == 'asc') {
128+
jarArtifact = it
129+
}
130+
}
131+
remove(jarArtifact)
132+
}
125133
}
126134
}
127135
publishPlugins.dependsOn fixPublishPlugins
136+

src/main/groovy/com/cinnober/gradle/semver_git/SemverGitPlugin.groovy

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ class SemverGitPlugin implements Plugin<Project> {
3535
if (proc.exitValue() == 0) {
3636
return checkVersion(proc.text.trim());
3737
}
38-
proc =("git describe " + gitArgs).execute(null, projectDir);
38+
proc =("git describe --abbrev=7 " + gitArgs).execute(null, projectDir);
3939
proc.waitFor();
4040
if (proc.exitValue() == 0) {
4141
def describe = proc.text.trim()

0 commit comments

Comments
 (0)