Skip to content

Commit e8c2e5d

Browse files
authored
CURRENT should not be a -SNAPSHOT version if build.snapshot is false (#27512)
1 parent 43a91f4 commit e8c2e5d

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

buildSrc/src/main/groovy/org/elasticsearch/gradle/VersionCollection.groovy

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,12 @@ class VersionCollection {
9595
prevConsideredVersion = currConsideredVersion
9696
}
9797

98+
// If we're making a release build then the current should not be a snapshot after all.
99+
final boolean currentIsSnapshot = "true" == System.getProperty("build.snapshot", "true")
100+
if (false == currentIsSnapshot) {
101+
versions[-1] = new Version(versions[-1].major, versions[-1].minor, versions[-1].revision, versions[-1].suffix, false, null)
102+
}
103+
98104
this.versions = Collections.unmodifiableList(versions)
99105
}
100106

0 commit comments

Comments
 (0)