瀏覽代碼

CURRENT should not be a -SNAPSHOT version if build.snapshot is false (#27512)

David Turner 8 年之前
父節點
當前提交
e8c2e5d6dd
共有 1 個文件被更改,包括 6 次插入0 次删除
  1. 6 0
      buildSrc/src/main/groovy/org/elasticsearch/gradle/VersionCollection.groovy

+ 6 - 0
buildSrc/src/main/groovy/org/elasticsearch/gradle/VersionCollection.groovy

@@ -95,6 +95,12 @@ class VersionCollection {
             prevConsideredVersion = currConsideredVersion
             prevConsideredVersion = currConsideredVersion
         }
         }
 
 
+        // If we're making a release build then the current should not be a snapshot after all.
+        final boolean currentIsSnapshot = "true" == System.getProperty("build.snapshot", "true")
+        if (false == currentIsSnapshot) {
+            versions[-1] = new Version(versions[-1].major, versions[-1].minor, versions[-1].revision, versions[-1].suffix, false, null)
+        }
+
         this.versions = Collections.unmodifiableList(versions)
         this.versions = Collections.unmodifiableList(versions)
     }
     }