Skip to content

Commit

Permalink
Fixed build
Browse files Browse the repository at this point in the history
Signed-off-by: owaiskazi19 <[email protected]>
  • Loading branch information
owaiskazi19 committed Feb 9, 2024
1 parent a4ea6ee commit bd46c56
Showing 1 changed file with 32 additions and 27 deletions.
59 changes: 32 additions & 27 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,19 @@ buildscript {
ext {
opensearch_group = "org.opensearch"
opensearch_version = System.getProperty("opensearch.version", "2.12.0-SNAPSHOT")
isSnapshot = "true" == System.getProperty("build.snapshot", "true")
buildVersionQualifier = System.getProperty("build.version_qualifier", "")
isSnapshot = "true" == System.getProperty("build.snapshot", "true")
version_tokens = opensearch_version.tokenize('-')
opensearch_build = version_tokens[0] + '.0'
plugin_no_snapshot = opensearch_build
if (buildVersionQualifier) {
opensearch_build += "-${buildVersionQualifier}"
plugin_no_snapshot += "-${buildVersionQualifier}"
}
if (isSnapshot) {
opensearch_build += "-SNAPSHOT"
}
opensearch_no_snapshot = opensearch_build.replace("-SNAPSHOT","")
kotlin_version = System.getProperty("kotlin.version", "1.8.21")
}

Expand Down Expand Up @@ -46,14 +57,8 @@ repositories {
}

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

targetCompatibility = JavaVersion.VERSION_11
Expand Down Expand Up @@ -87,19 +92,19 @@ configurations {

task addJarsToClasspath(type: Copy) {
from(fileTree(dir: sqlJarDirectory)) {
include "opensearch-sql-${version}.jar"
include "ppl-${version}.jar"
include "protocol-${version}.jar"
include "opensearch-sql-${opensearch_build}.jar"
include "ppl-${opensearch_build}.jar"
include "protocol-${opensearch_build}.jar"
}
into("$buildDir/classes")

from(fileTree(dir: jsJarDirectory)) {
include "opensearch-job-scheduler-${version}.jar"
include "opensearch-job-scheduler-${opensearch_build}.jar"
}
into("$buildDir/classes")

from(fileTree(dir: adJarDirectory)) {
include "opensearch-anomaly-detection-${version}.jar"
include "opensearch-anomaly-detection-${opensearch_build}.jar"
}
into("$buildDir/classes")
}
Expand All @@ -114,23 +119,23 @@ dependencies {
compileOnly group: 'org.apache.commons', name: 'commons-text', version: '1.10.0'

// Plugin dependencies
compileOnly group: 'org.opensearch', name:'opensearch-ml-client', version: "${version}"
implementation fileTree(dir: jsJarDirectory, include: ["opensearch-job-scheduler-${version}.jar"])
implementation fileTree(dir: adJarDirectory, include: ["opensearch-anomaly-detection-${version}.jar"])
implementation fileTree(dir: sqlJarDirectory, include: ["opensearch-sql-${version}.jar", "ppl-${version}.jar", "protocol-${version}.jar"])
compileOnly "org.opensearch:common-utils:${version}"
compileOnly group: 'org.opensearch', name:'opensearch-ml-client', version: "${opensearch_build}"
implementation fileTree(dir: jsJarDirectory, include: ["opensearch-job-scheduler-${opensearch_build}.jar"])
implementation fileTree(dir: adJarDirectory, include: ["opensearch-anomaly-detection-${opensearch_build}.jar"])
implementation fileTree(dir: sqlJarDirectory, include: ["opensearch-sql-${opensearch_build}.jar", "ppl-${opensearch_build}.jar", "protocol-${opensearch_build}.jar"])
compileOnly "org.opensearch:common-utils:${opensearch_build}"
compileOnly "org.jetbrains.kotlin:kotlin-stdlib:${kotlin_version}"
compileOnly "org.opensearch:opensearch-job-scheduler-spi:${version}"
compileOnly "org.opensearch:opensearch-job-scheduler-spi:${opensearch_build}"


// ZipArchive dependencies used for integration tests
zipArchive group: 'org.opensearch.plugin', name:'opensearch-ml-plugin', version: "${version}"
zipArchive group: 'org.opensearch.plugin', name:'opensearch-job-scheduler', version: "${version}"
zipArchive group: 'org.opensearch.plugin', name:'opensearch-anomaly-detection', version: "${version}"
zipArchive group: 'org.opensearch.plugin', name:'opensearch-sql-plugin', version: "${version}"
zipArchive group: 'org.opensearch.plugin', name:'opensearch-knn', version: "${version}"
zipArchive group: 'org.opensearch.plugin', name:'neural-search', version: "${version}"
zipArchive group: 'org.opensearch.plugin', name:'alerting', version: "${version}"
zipArchive group: 'org.opensearch.plugin', name:'opensearch-ml-plugin', version: "${opensearch_build}"
zipArchive group: 'org.opensearch.plugin', name:'opensearch-job-scheduler', version: "${opensearch_build}"
zipArchive group: 'org.opensearch.plugin', name:'opensearch-anomaly-detection', version: "${opensearch_build}"
zipArchive group: 'org.opensearch.plugin', name:'opensearch-sql-plugin', version: "${opensearch_build}"
zipArchive group: 'org.opensearch.plugin', name:'opensearch-knn', version: "${opensearch_build}"
zipArchive group: 'org.opensearch.plugin', name:'neural-search', version: "${opensearch_build}"
zipArchive group: 'org.opensearch.plugin', name:'alerting', version: "${opensearch_build}"

// Test dependencies
testImplementation "org.opensearch.test:framework:${opensearch_version}"
Expand Down

0 comments on commit bd46c56

Please sign in to comment.