Skip to content

Commit

Permalink
Set abbreviation length of hashes to a fixed 7, since the length is d…
Browse files Browse the repository at this point in the history
…ynamic in som git versions.
  • Loading branch information
mojote committed Jan 16, 2018
1 parent b97ed88 commit f5a146b
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 2 deletions.
1 change: 1 addition & 0 deletions CONTRIBUTORS
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
Mikael Brännström
Anders Lindgren
Morgan Johansson

11 changes: 10 additions & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,16 @@ task (fixPublishPlugins) {
// Gradle Plugin Portal does not support signed artifacts, but Maven Central requires signed artifacts.
// Remove signed artifacts if publishing to Gradle Plugin Portal
doFirst {
configurations.archives.artifacts.removeAll { it.extension == "asc" }
configurations.archives.artifacts.with { archives ->
def jarArtifact
archives.each {
if (it.extension == 'asc') {
jarArtifact = it
}
}
remove(jarArtifact)
}
}
}
publishPlugins.dependsOn fixPublishPlugins

Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ class SemverGitPlugin implements Plugin<Project> {
if (proc.exitValue() == 0) {
return checkVersion(proc.text.trim());
}
proc =("git describe " + gitArgs).execute(null, projectDir);
proc =("git describe --abbrev=7 " + gitArgs).execute(null, projectDir);
proc.waitFor();
if (proc.exitValue() == 0) {
def describe = proc.text.trim()
Expand Down

0 comments on commit f5a146b

Please sign in to comment.