Skip to content

Commit

Permalink
Use common variable for versioning (#32)
Browse files Browse the repository at this point in the history
Signed-off-by: Sayali Gaikawad <[email protected]>
  • Loading branch information
gaiksaya authored and mgodwan committed Sep 26, 2024
1 parent fec2c39 commit 702d79a
Showing 1 changed file with 9 additions and 8 deletions.
17 changes: 9 additions & 8 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,13 @@ buildscript {
opensearch_version = System.getProperty("opensearch.version", "2.17.0-SNAPSHOT")
isSnapshot = "true" == System.getProperty("build.snapshot", "true")
buildVersionQualifier = System.getProperty("build.version_qualifier", "")
plugin_version = opensearch_version.tokenize('-')[0] + '.0'
if (buildVersionQualifier) {
plugin_version += "-${buildVersionQualifier}"
}
if (isSnapshot) {
plugin_version += "-SNAPSHOT"
}
}

repositories {
Expand Down Expand Up @@ -73,13 +80,7 @@ configurations {

allprojects {
group 'org.opensearch'
version = opensearch_version.tokenize('-')[0] + '.0'
if (buildVersionQualifier) {
version += "-${buildVersionQualifier}"
}
if (isSnapshot) {
version += "-SNAPSHOT"
}
version plugin_version

java {
targetCompatibility = JavaVersion.VERSION_11
Expand All @@ -96,7 +97,7 @@ opensearchplugin {
}

dependencies {
zipArchive group: 'org.opensearch.plugin', name:'opensearch-custom-codecs', version: "2.17.0.0-SNAPSHOT"
zipArchive group: 'org.opensearch.plugin', name:'opensearch-custom-codecs', version: plugin_version
}

allprojects {
Expand Down

0 comments on commit 702d79a

Please sign in to comment.