import org.opensearch.gradle.test.RestIntegTestTask apply plugin: 'java' apply plugin: 'idea' apply plugin: 'opensearch.opensearchplugin' apply plugin: 'opensearch.yaml-rest-test' apply plugin: 'opensearch.pluginzip' apply plugin: 'jacoco' group = 'org.opensearch' def pluginName = 'search-processor' def pluginDescription = 'Make Opensearch results more relevant.' def projectPath = 'org.opensearch' def pathToPlugin = 'search.relevance' def pluginClassName = 'SearchRelevancePlugin' publishing { publications { pluginZip(MavenPublication) { publication -> pom { name = pluginName description = pluginDescription licenses { license { name = "The Apache License, Version 2.0" url = "http://www.apache.org/licenses/LICENSE-2.0.txt" } } developers { developer { name = "OpenSearch" url = "https://github.com/opensearch-project/search-processor" } } } } } } opensearchplugin { name "opensearch-${pluginName}-${plugin_version}.0" description pluginDescription classname "${projectPath}.${pathToPlugin}.${pluginClassName}" licenseFile rootProject.file('LICENSE') noticeFile rootProject.file('NOTICE') } // This requires an additional Jar not published as part of build-tools loggerUsageCheck.enabled = false // No need to validate pom, as we do not upload to maven/sonatype validateNebulaPom.enabled = false buildscript { ext { isSnapshot = "true" == System.getProperty("build.snapshot", "true") opensearch_version = System.getProperty("opensearch.version", "3.0.0") plugin_version = opensearch_version if (isSnapshot) { opensearch_version += "-SNAPSHOT" } } repositories { mavenLocal() maven { url "https://aws.oss.sonatype.org/content/repositories/snapshots" } mavenCentral() maven { url "https://plugins.gradle.org/m2/" } } dependencies { classpath "org.opensearch.gradle:build-tools:${opensearch_version}" } } repositories { mavenLocal() maven { url "https://aws.oss.sonatype.org/content/repositories/snapshots" } mavenCentral() maven { url "https://plugins.gradle.org/m2/" } } dependencies { implementation 'com.ibm.icu:icu4j:57.2' implementation 'org.apache.commons:commons-lang3:3.12.0' implementation 'org.apache.httpcomponents:httpclient:4.5.14' implementation 'org.apache.httpcomponents:httpcore:4.4.16' implementation 'com.fasterxml.jackson.core:jackson-databind:2.15.0' implementation 'com.fasterxml.jackson.core:jackson-core:2.15.2' implementation 'com.fasterxml.jackson.core:jackson-annotations:2.15.0' implementation 'commons-logging:commons-logging:1.2' implementation 'com.amazonaws:aws-java-sdk-sts:1.12.300' implementation 'com.amazonaws:aws-java-sdk-core:1.12.300' implementation 'com.amazonaws:aws-java-sdk-personalizeruntime:1.12.300' } allprojects { plugins.withId('jacoco') { jacoco.toolVersion = '0.8.9' } } test { include '**/*Tests.class' finalizedBy jacocoTestReport } task integTest(type: RestIntegTestTask) { description = "Run tests against a cluster" testClassesDirs = sourceSets.test.output.classesDirs classpath = sourceSets.test.runtimeClasspath } tasks.named("check").configure { dependsOn(integTest) } integTest { // The --debug-jvm command-line option makes the cluster debuggable; this makes the tests debuggable if (System.getProperty("test.debug") != null) { jvmArgs '-agentlib:jdwp=transport=dt_socket,server=y,suspend=y,address=*:5005' } } testClusters.integTest { testDistribution = "ARCHIVE" // This installs our plugin into the testClusters plugin(project.tasks.bundlePlugin.archiveFile) } run { useCluster testClusters.integTest } sourceSets { main { resources { srcDirs = ["config"] includes = ["**/*.yml"] } } } jacocoTestReport { dependsOn test reports { xml.required = true html.required = true } } // TODO: Enable these checks dependencyLicenses.enabled = false thirdPartyAudit.enabled = false loggerUsageCheck.enabled = false