2016-11-18 10:21:39 -05:00
|
|
|
import org.elasticsearch.gradle.precommit.PrecommitTasks
|
2016-12-01 08:40:11 -05:00
|
|
|
import org.elastic.gradle.DownloadS3Task
|
2016-11-18 10:21:39 -05:00
|
|
|
|
|
|
|
apply plugin: 'elasticsearch.esplugin'
|
|
|
|
|
|
|
|
esplugin {
|
2017-01-10 08:40:16 -05:00
|
|
|
name 'ml'
|
2017-01-17 09:45:00 -05:00
|
|
|
description 'Machine Learning Plugin'
|
2017-01-10 08:40:16 -05:00
|
|
|
classname 'org.elasticsearch.xpack.ml.MlPlugin'
|
2016-11-18 10:21:39 -05:00
|
|
|
}
|
|
|
|
|
2016-12-02 10:17:40 -05:00
|
|
|
version = project.version
|
2016-11-18 10:21:39 -05:00
|
|
|
|
|
|
|
thirdPartyAudit.enabled = false
|
|
|
|
|
|
|
|
dependencies {
|
|
|
|
compile group: 'net.sf.supercsv', name: 'super-csv', version:"${supercsvVersion}"
|
2016-12-02 10:17:40 -05:00
|
|
|
testCompile group: 'org.ini4j', name: 'ini4j', version:"${ini4jVersion}"
|
2016-11-18 10:21:39 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
test {
|
|
|
|
exclude '**/*NoBootstrapTests.class'
|
|
|
|
}
|
|
|
|
|
|
|
|
task noBootstrapTest(type: Test,
|
|
|
|
dependsOn: test.dependsOn) {
|
|
|
|
classpath = project.test.classpath
|
|
|
|
testClassesDir = project.test.testClassesDir
|
|
|
|
include '**/*NoBootstrapTests.class'
|
|
|
|
}
|
|
|
|
check.dependsOn noBootstrapTest
|
|
|
|
noBootstrapTest.mustRunAfter test
|
|
|
|
|
|
|
|
integTest {
|
|
|
|
cluster {
|
|
|
|
//setting 'useNativeProcess', 'true'
|
|
|
|
distribution = 'zip'
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
integTest.mustRunAfter noBootstrapTest
|
|
|
|
|
2017-01-19 08:51:01 -05:00
|
|
|
String projectGroupPath = project.group.replaceAll("\\.", "/")
|
|
|
|
|
2016-12-01 08:40:11 -05:00
|
|
|
task downloadCppDist(type: DownloadS3Task) {
|
2017-01-17 09:45:00 -05:00
|
|
|
enabled project.cppLocalDists == ''
|
|
|
|
description = 'Download C++ zips from S3 Bucket'
|
2016-12-01 08:40:11 -05:00
|
|
|
bucket 'prelert-artifacts'
|
|
|
|
destDir file("${buildDir}/cppDist")
|
|
|
|
flatten true
|
2017-01-19 08:51:01 -05:00
|
|
|
download "maven/${projectGroupPath}/ml-cpp/${project.version}/ml-cpp-${project.version}-windows-x86_64.zip"
|
|
|
|
download "maven/${projectGroupPath}/ml-cpp/${project.version}/ml-cpp-${project.version}-linux-x86_64.zip"
|
|
|
|
download "maven/${projectGroupPath}/ml-cpp/${project.version}/ml-cpp-${project.version}-darwin-x86_64.zip"
|
|
|
|
outputs.file(file("${buildDir}/cppDist/ml-cpp-${project.version}-windows-x86_64.zip"))
|
|
|
|
outputs.file(file("${buildDir}/cppDist/ml-cpp-${project.version}-darwin-x86_64.zip"))
|
|
|
|
outputs.file(file("${buildDir}/cppDist/ml-cpp-${project.version}-linux-x86_64.zip"))
|
2016-12-01 08:40:11 -05:00
|
|
|
}
|
|
|
|
|
2016-11-18 10:21:39 -05:00
|
|
|
bundlePlugin {
|
2017-01-17 09:45:00 -05:00
|
|
|
if (project.cppLocalDists) {
|
2017-01-19 08:51:01 -05:00
|
|
|
String localZipFile = 'ml-cpp-${project.version}-' +
|
2017-01-17 09:45:00 -05:00
|
|
|
(project.isWindows ? "windows-x86_64" : (project.isMacOsX ? "darwin-x86_64" :
|
2017-01-19 08:51:01 -05:00
|
|
|
(project.isLinux ? "linux-x86_64" : "sunos-x86_64"))) + ".zip"
|
2017-01-17 09:45:00 -05:00
|
|
|
from { zipTree(cppLocalDists + '/' + localZipFile) }
|
2016-12-01 07:16:06 -05:00
|
|
|
} else {
|
2016-12-02 04:45:54 -05:00
|
|
|
for (outputFile in downloadCppDist.outputs.files) {
|
2017-01-17 09:45:00 -05:00
|
|
|
from(zipTree(outputFile)) {
|
|
|
|
duplicatesStrategy 'exclude'
|
|
|
|
}
|
2016-12-01 07:16:06 -05:00
|
|
|
}
|
2016-12-01 10:48:51 -05:00
|
|
|
dependsOn 'downloadCppDist'
|
2016-12-01 07:16:06 -05:00
|
|
|
}
|
2016-11-18 10:21:39 -05:00
|
|
|
}
|