You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by us...@apache.org on 2020/08/23 17:26:49 UTC

[lucene-solr] branch master updated: LUCENE-9474: Make the version number configurable from outside. This mainly allows Jenkins to set a different suffix than "SNAPSHOT"

This is an automated email from the ASF dual-hosted git repository.

uschindler pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/lucene-solr.git


The following commit(s) were added to refs/heads/master by this push:
     new ee6cf4c  LUCENE-9474: Make the version number configurable from outside. This mainly allows Jenkins to set a different suffix than "SNAPSHOT"
ee6cf4c is described below

commit ee6cf4c418af8cdc5b10e258df6d77d8a05ffa1f
Author: Uwe Schindler <us...@apache.org>
AuthorDate: Sun Aug 23 19:26:40 2020 +0200

    LUCENE-9474: Make the version number configurable from outside. This mainly allows Jenkins to set a different suffix than "SNAPSHOT"
---
 build.gradle | 19 ++++++++++++++++---
 1 file changed, 16 insertions(+), 3 deletions(-)

diff --git a/build.gradle b/build.gradle
index f145c73..571ab30 100644
--- a/build.gradle
+++ b/build.gradle
@@ -26,10 +26,24 @@ plugins {
   id "de.undercouch.download" version "4.0.2" apply false
 }
 
-// Project version.
-version = "9.0.0-SNAPSHOT"
+apply from: file('gradle/defaults.gradle')
 
 // General metadata.
+
+// Calculate project version:
+version = {
+  // Release manager: update base version here after release:
+  String baseVersion = '9.0.0'
+
+  // On a release explicitly set release version in one go:
+  //  -Dversion.release=x.y.z
+  
+  // Jenkins can just set just a suffix, overriding SNAPSHOT, e.g. using build id:
+  //  -Dversion.suffix=jenkins123
+  
+  String versionSuffix = propertyOrDefault('version.suffix', 'SNAPSHOT')
+  return propertyOrDefault('version.release', "${baseVersion}-${versionSuffix}")
+}()
 description = 'Grandparent project for Apache Lucene Core and Apache Solr'
 
 // Propagate version and derived properties across projects.
@@ -91,7 +105,6 @@ apply from: file('gradle/ant-compat/folder-layout.gradle')
 
 // Set up defaults and configure aspects for certain modules or functionality
 // (java, tests)
-apply from: file('gradle/defaults.gradle')
 apply from: file('gradle/defaults-java.gradle')
 apply from: file('gradle/testing/defaults-tests.gradle')
 apply from: file('gradle/testing/randomization.gradle')