Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change js to jar dependency #74

Merged
20 changes: 3 additions & 17 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,6 @@ apply plugin: 'opensearch.testclusters'
apply plugin: 'opensearch.pluginzip'

def sqlJarDirectory = "$buildDir/dependencies/opensearch-sql-plugin"
def jsJarDirectory = "$buildDir/dependencies/opensearch-job-scheduler"
def adJarDirectory = "$buildDir/dependencies/opensearch-time-series-analytics"

configurations {
Expand All @@ -91,11 +90,6 @@ task addJarsToClasspath(type: Copy) {
}
into("$buildDir/classes")

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

from(fileTree(dir: adJarDirectory)) {
include "opensearch-time-series-analytics-${version}.jar"
}
Expand All @@ -113,15 +107,15 @@ dependencies {

// Plugin dependencies
compileOnly group: 'org.opensearch', name:'opensearch-ml-client', version: "${version}"
implementation fileTree(dir: jsJarDirectory, include: ["opensearch-job-scheduler-${version}.jar"])
implementation group: 'org.opensearch', name: 'opensearch-job-scheduler', version: "${version}"
// implementation group: 'org.opensearch', name: 'opensearch-time-series-analytics', version: "${version}"
//TODO change this to jar dependency once ad successfully published jars.
implementation fileTree(dir: adJarDirectory, include: ["opensearch-time-series-analytics-${version}.jar"])
implementation fileTree(dir: sqlJarDirectory, include: ["opensearch-sql-${version}.jar", "ppl-${version}.jar", "protocol-${version}.jar"])
compileOnly "org.opensearch:common-utils:${version}"

// ZipArchive dependencies used for integration tests
zipArchive group: 'org.opensearch.plugin', name:'opensearch-ml-plugin', version: "${version}"
//JS plugin is published to `org/opensearch` instead of `org/opensearch/plugin` under local maven repo: https://mvnrepository.com/artifact/org.opensearch/opensearch-job-scheduler.
zipArchive group: 'org.opensearch', name:'opensearch-job-scheduler', version: "${version}"
zipArchive "org.opensearch.plugin:opensearch-anomaly-detection:${version}"
zipArchive group: 'org.opensearch.plugin', name:'opensearch-sql-plugin', version: "${version}"

Expand All @@ -146,20 +140,13 @@ task extractSqlJar(type: Copy) {
into sqlJarDirectory
}

task extractJsJar(type: Copy) {
mustRunAfter()
from(zipTree(configurations.zipArchive.find { it.name.startsWith("opensearch-job-scheduler")}))
into jsJarDirectory
}

task extractAdJar(type: Copy) {
mustRunAfter()
from(zipTree(configurations.zipArchive.find { it.name.startsWith("opensearch-anomaly-detection")}))
into adJarDirectory
}

tasks.addJarsToClasspath.dependsOn(extractSqlJar)
tasks.addJarsToClasspath.dependsOn(extractJsJar)
tasks.addJarsToClasspath.dependsOn(extractAdJar)
project.tasks.delombok.dependsOn(addJarsToClasspath)
tasks.publishNebulaPublicationToMavenLocal.dependsOn ':generatePomFileForPluginZipPublication'
Expand Down Expand Up @@ -204,7 +191,6 @@ spotless {

compileJava {
dependsOn extractSqlJar
dependsOn extractJsJar
dependsOn extractAdJar
dependsOn delombok
options.compilerArgs.addAll(["-processor", 'lombok.launch.AnnotationProcessorHider$AnnotationProcessor'])
Expand Down
Loading