OpenSearch/plugin/ml/build.gradle

107 lines
3.5 KiB
Groovy
Raw Normal View History

import com.carrotsearch.gradle.junit4.RandomizedTestingTask
import org.elasticsearch.gradle.BuildPlugin
evaluationDependsOn(':x-pack-elasticsearch:plugin:core')
apply plugin: 'elasticsearch.esplugin'
esplugin {
name 'x-pack-ml'
description 'Elasticsearch Expanded Pack Plugin - Machine Learning'
classname 'org.elasticsearch.xpack.ml.MachineLearning'
hasNativeController true
requiresKeystore true
extendedPlugins = ['x-pack-core']
licenseFile project(':x-pack-elasticsearch').file('LICENSE.txt')
noticeFile project(':x-pack-elasticsearch').file('NOTICE.txt')
}
archivesBaseName = 'x-pack-ml'
licenseHeaders.enabled = false
configurations {
nativeBundle {
resolutionStrategy.dependencySubstitution {
if (findProject(':machine-learning-cpp') != null) {
substitute module("org.elasticsearch.ml:ml-cpp") with project(":machine-learning-cpp")
} else {
substitute module("org.elasticsearch.ml:ml-cpp") with project("${project.parent.path}:ml-cpp-snapshot")
}
}
}
}
bundlePlugin {
dependsOn configurations.nativeBundle
from {
project.zipTree(configurations.nativeBundle.singleFile)
}
// We don't ship the individual nativeBundle licenses - instead
// they get combined into the top level NOTICES file we ship
exclude 'platform/licenses/**'
}
compileJava.options.compilerArgs << "-Xlint:-deprecation,-rawtypes,-serial,-try,-unchecked"
compileTestJava.options.compilerArgs << "-Xlint:-deprecation,-rawtypes,-serial,-try,-unchecked"
dependencies {
provided "org.elasticsearch:elasticsearch:${version}"
provided "org.elasticsearch.plugin:x-pack-core:${version}"
testCompile project(path: ':x-pack-elasticsearch:plugin:core', configuration: 'testArtifacts')
// This should not be here
testCompile project(path: ':x-pack-elasticsearch:plugin:security', configuration: 'testArtifacts')
// ml deps
compile 'net.sf.supercsv:super-csv:2.4.0'
nativeBundle "org.elasticsearch.ml:ml-cpp:${project.version}@zip"
testCompile 'org.ini4j:ini4j:0.5.2'
}
// TODO: we have a test jar so qa/ml-native-tests can use this stuff..fix that...
configurations {
testArtifacts.extendsFrom testRuntime
}
task testJar(type: Jar) {
appendix 'test'
from sourceSets.test.output
}
artifacts {
// normal es plugins do not publish the jar but we need to since users need it for Transport Clients and extensions
archives jar
testArtifacts testJar
}
dependencyLicenses {
ignoreSha 'x-pack-core'
}
run {
plugin ':x-pack-elasticsearch:plugin:core'
}
// xpack modules are installed in real clusters as the meta plugin, so
// installing them as individual plugins for integ tests doesn't make sense,
// so we disable integ tests
integTest.enabled = false
// Instead we create a separate task to run the
// tests based on ESIntegTestCase
task internalClusterTest(type: RandomizedTestingTask,
group: JavaBasePlugin.VERIFICATION_GROUP,
description: 'Multi-node tests',
dependsOn: test.dependsOn) {
configure(BuildPlugin.commonTestConfig(project))
classpath = project.test.classpath
testClassesDir = project.test.testClassesDir
include '**/*IT.class'
systemProperty 'es.set.netty.runtime.available.processors', 'false'
}
check.dependsOn internalClusterTest
internalClusterTest.mustRunAfter test
// also add an "alias" task to make typing on the command line easier
task icTest {
dependsOn internalClusterTest
}