Skip to content

Commit

Permalink
Fix snapshot build using OpenSearch 1.1.
Browse files Browse the repository at this point in the history
Signed-off-by: dblock <[email protected]>
  • Loading branch information
dblock committed Aug 20, 2021
1 parent 83aafb1 commit e4f37c4
Showing 1 changed file with 9 additions and 10 deletions.
19 changes: 9 additions & 10 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
buildscript {

ext {
opensearch_version = System.getProperty("opensearch.version", "1.0.0")
opensearch_version = System.getProperty("opensearch.version", "1.1.0-SNAPSHOT")
}

// Used to resolve build file dependencies
Expand Down Expand Up @@ -68,7 +68,6 @@ spotbugsTest {
}

ext {
opensearchVersion = '1.0.0'
isSnapshot = "true" == System.getProperty("build.snapshot", "true")

// The RCA branch that will be built. Default value is main.
Expand All @@ -82,7 +81,7 @@ ext {
}

group = "org.opensearch"
version = "${opensearchVersion}.0"
version = opensearch_version - '-SNAPSHOT' + '.0'
if (isSnapshot) {
version += "-SNAPSHOT"
}
Expand Down Expand Up @@ -248,7 +247,7 @@ dependencies {
compile 'org.apache.commons:commons-lang3:3.9'
compile 'org.bouncycastle:bcprov-jdk15on:1.68'
compile 'org.bouncycastle:bcpkix-jdk15on:1.68'
compile 'org.opensearch:performanceanalyzer-rca:1.0.0.0'
compile "org.opensearch:performanceanalyzer-rca:${version}"
compile "com.fasterxml.jackson.core:jackson-annotations:${jacksonVersion}"
compile "com.fasterxml.jackson.core:jackson-databind:${jacksonVersion}"
compile "com.fasterxml.jackson.module:jackson-module-paranamer:${jacksonVersion}"
Expand Down Expand Up @@ -331,26 +330,26 @@ task buildRca() {
dependsOn(cloneGitRepo)

doFirst {
logger.info("Building performance-analyzer-rca project in ${rcaProjectDir}")
logger.info("Building performance-analyzer-rca project in ${rcaProjectDir} with -Dopensearch.version=${opensearch_version}")
}

doLast {
exec {
workingDir("$rcaProjectDir")
commandLine './gradlew', 'build', '-x', 'test'
commandLine './gradlew', 'build', '-x', 'test', "-Dopensearch.version=${opensearch_version}"
}
exec {
workingDir("$rcaProjectDir")
commandLine './gradlew', 'publishToMavenLocal'
commandLine './gradlew', 'publishToMavenLocal', "-Dopensearch.version=${opensearch_version}"
}
exec {
def licenseDir = "$projectDir/licenses"
workingDir("$licenseDir")
commandLine 'rm', "-f", "performanceanalyzer-rca-1.0.0.0.jar.sha1"
commandLine 'rm', "-f", "performanceanalyzer-rca-${project.version}.jar.sha1"
}
exec {
workingDir("$projectDir")
commandLine './gradlew', 'updateShas'
commandLine './gradlew', 'updateShas', "-Dopensearch.version=${opensearch_version}"
}
}
}
Expand All @@ -360,7 +359,7 @@ def rcaArtifactsDir

task unpackRca(type: Copy) {
dependsOn(buildRca)
from(zipTree("$rcaProjectDir/build/distributions/performance-analyzer-rca.zip")) {
from(zipTree("$rcaProjectDir/build/distributions/performance-analyzer-rca-${version}.zip")) {
}
into "$rcaProjectDir/build/distributions"
rcaArtifactsDir = "$rcaProjectDir/build/distributions/performance-analyzer-rca/"
Expand Down

0 comments on commit e4f37c4

Please sign in to comment.