Skip to content

Commit

Permalink
Applying build qualifier only to knn plugin version (#330)
Browse files Browse the repository at this point in the history
Signed-off-by: Martin Gaievski <[email protected]>
  • Loading branch information
martin-gaievski authored Mar 23, 2022
1 parent 9b8895b commit 8203524
Showing 1 changed file with 2 additions and 13 deletions.
15 changes: 2 additions & 13 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -9,24 +9,13 @@ import org.opensearch.gradle.test.RestIntegTestTask

buildscript {
ext {
// for opensearch that is used by plugin following version schema is in use:
// "<opensearch_version before first '-'>-<build.version_qualifier>-<SNAPSHOT optional>"
// for plugin artifacts produced by this script the version schema is very similar except for additional '0' as a minor version:
// "<opensearch_version before first '-'>.0-<build.version_qualifier>-<SNAPSHOT optional>"
// build.version_qualifier parameter applies to knn plugin artifacts only. OpenSearch version must be set
// explicitly as 'opensearch.version' property, for instance opensearch.version=2.0.0-alpha1-SNAPSHOT
opensearch_version = System.getProperty("opensearch.version", "2.0.0-SNAPSHOT")
knn_bwc_version = System.getProperty("bwc.version", "1.2.0.0-SNAPSHOT")
version_qualifier = System.getProperty("build.version_qualifier", "")
opensearch_bwc_version = "${knn_bwc_version}" - ".0-SNAPSHOT"
opensearch_group = "org.opensearch"

version_with_qualifier = opensearch_version.tokenize('-')[0]
if (version_qualifier) {
version_with_qualifier += "-${version_qualifier}"
}
if(opensearch_version.tokenize('-')[1]) {
version_with_qualifier += "-${opensearch_version.tokenize('-')[1]}"
}
opensearch_version = version_with_qualifier
}

// This isn't applying from repositories.gradle so repeating git diff it here
Expand Down

0 comments on commit 8203524

Please sign in to comment.