123 lines
4.0 KiB
Groovy
123 lines
4.0 KiB
Groovy
import com.carrotsearch.gradle.junit4.RandomizedTestingTask
|
|
import org.elasticsearch.gradle.BuildPlugin
|
|
|
|
evaluationDependsOn(xpackModule('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
|
|
extendedPlugins = ['x-pack-core']
|
|
}
|
|
archivesBaseName = 'x-pack-ml'
|
|
|
|
configurations {
|
|
nativeBundle {
|
|
resolutionStrategy.dependencySubstitution {
|
|
if (findProject(':ml-cpp') != null) {
|
|
substitute module("org.elasticsearch.ml:ml-cpp") with project(":ml-cpp")
|
|
} else {
|
|
substitute module("org.elasticsearch.ml:ml-cpp") with project("${project.path}: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 {
|
|
compileOnly project(path: xpackModule('core'), configuration: 'shadow')
|
|
testCompile project(path: xpackModule('core'), configuration: 'testArtifacts')
|
|
// This should not be here
|
|
testCompile project(path: xpackModule('security'), configuration: 'testArtifacts')
|
|
|
|
// ml deps
|
|
compile project(':libs:grok')
|
|
compile "net.sf.supercsv:super-csv:${versions.supercsv}"
|
|
nativeBundle "org.elasticsearch.ml:ml-cpp:${project.version}@zip"
|
|
testCompile 'org.ini4j:ini4j:0.5.2'
|
|
}
|
|
|
|
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
|
|
}
|
|
|
|
task extractNativeLicenses(type: Copy) {
|
|
dependsOn configurations.nativeBundle
|
|
into "${buildDir}"
|
|
from {
|
|
project.zipTree(configurations.nativeBundle.singleFile)
|
|
}
|
|
include 'platform/licenses/**'
|
|
}
|
|
project.afterEvaluate {
|
|
// Add an extra licenses directory to the combined notices
|
|
project.tasks.findByName('generateNotice').dependsOn extractNativeLicenses
|
|
project.tasks.findByName('generateNotice').licensesDir new File("${project.buildDir}/platform/licenses")
|
|
project.tasks.findByName('generateNotice').outputs.upToDateWhen {
|
|
extractNativeLicenses.state.upToDate
|
|
}
|
|
}
|
|
|
|
run {
|
|
plugin xpackModule('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
|
|
testClassesDirs = project.test.testClassesDirs
|
|
include '**/*IT.class'
|
|
systemProperty 'es.set.netty.runtime.available.processors', 'false'
|
|
}
|
|
|
|
check.dependsOn internalClusterTest
|
|
internalClusterTest.mustRunAfter test
|
|
|
|
// add all sub-projects of the qa sub-project
|
|
gradle.projectsEvaluated {
|
|
project.subprojects
|
|
.find { it.path == project.path + ":qa" }
|
|
.subprojects
|
|
.findAll { it.path.startsWith(project.path + ":qa") }
|
|
.each { check.dependsOn it.check }
|
|
}
|
|
|
|
// also add an "alias" task to make typing on the command line easier
|
|
task icTest {
|
|
dependsOn internalClusterTest
|
|
}
|