2018-01-25 04:38:34 -05:00
|
|
|
import com.carrotsearch.gradle.junit4.RandomizedTestingTask
|
|
|
|
import org.elasticsearch.gradle.BuildPlugin
|
|
|
|
|
2018-01-27 00:48:30 -05:00
|
|
|
evaluationDependsOn(xpackModule('core'))
|
2018-01-22 10:55:03 -05:00
|
|
|
|
2018-01-20 00:30:17 -05:00
|
|
|
apply plugin: 'elasticsearch.esplugin'
|
|
|
|
esplugin {
|
|
|
|
name 'x-pack-ml'
|
|
|
|
description 'Elasticsearch Expanded Pack Plugin - Machine Learning'
|
|
|
|
classname 'org.elasticsearch.xpack.ml.MachineLearning'
|
|
|
|
hasNativeController true
|
|
|
|
extendedPlugins = ['x-pack-core']
|
|
|
|
}
|
2017-12-08 11:41:32 -05:00
|
|
|
archivesBaseName = 'x-pack-ml'
|
|
|
|
|
|
|
|
configurations {
|
2017-12-08 16:42:50 -05:00
|
|
|
nativeBundle {
|
|
|
|
resolutionStrategy.dependencySubstitution {
|
2018-03-09 17:53:38 -05:00
|
|
|
if (findProject(':ml-cpp') != null) {
|
|
|
|
substitute module("org.elasticsearch.ml:ml-cpp") with project(":ml-cpp")
|
2017-12-08 16:42:50 -05:00
|
|
|
} else {
|
2018-01-26 23:14:07 -05:00
|
|
|
substitute module("org.elasticsearch.ml:ml-cpp") with project("${project.path}:cpp-snapshot")
|
2017-12-08 16:42:50 -05:00
|
|
|
}
|
|
|
|
}
|
2017-12-08 11:41:32 -05:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2018-01-20 00:30:17 -05:00
|
|
|
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"
|
|
|
|
|
2017-12-08 11:41:32 -05:00
|
|
|
dependencies {
|
2018-02-09 14:30:43 -05:00
|
|
|
compileOnly "org.elasticsearch.plugin:x-pack-core:${version}"
|
2018-01-27 00:48:30 -05:00
|
|
|
testCompile project(path: xpackModule('core'), configuration: 'testArtifacts')
|
2018-01-20 00:30:17 -05:00
|
|
|
// This should not be here
|
2018-01-27 00:48:30 -05:00
|
|
|
testCompile project(path: xpackModule('security'), configuration: 'testArtifacts')
|
2017-12-08 11:41:32 -05:00
|
|
|
|
|
|
|
// 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'
|
|
|
|
}
|
|
|
|
|
2018-01-25 04:38:34 -05:00
|
|
|
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
|
|
|
|
}
|
|
|
|
|
2018-01-20 00:30:17 -05:00
|
|
|
run {
|
2018-01-27 00:48:30 -05:00
|
|
|
plugin xpackModule('core')
|
2017-12-08 11:41:32 -05:00
|
|
|
}
|
2018-01-25 04:38:34 -05:00
|
|
|
|
|
|
|
// 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
|
|
|
|
}
|