2015-11-25 18:28:45 -05:00
|
|
|
import org.elasticsearch.gradle.MavenFilteringHack
|
2016-01-18 18:20:33 -05:00
|
|
|
import org.elasticsearch.gradle.test.NodeInfo
|
2015-11-25 18:28:45 -05:00
|
|
|
|
|
|
|
apply plugin: 'elasticsearch.esplugin'
|
|
|
|
esplugin {
|
2016-02-05 05:13:30 -05:00
|
|
|
name 'xpack'
|
2015-11-25 18:28:45 -05:00
|
|
|
description 'Elasticsearch Expanded Pack Plugin'
|
|
|
|
classname 'org.elasticsearch.xpack.XPackPlugin'
|
2015-12-01 09:57:01 -05:00
|
|
|
// FIXME we still can't be isolated due to shield custom realms
|
|
|
|
isolated false
|
2015-11-25 18:28:45 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
ext.versions = [
|
|
|
|
okhttp: '2.3.0'
|
|
|
|
]
|
|
|
|
|
2015-12-01 14:16:29 -05:00
|
|
|
// TODO: fix this! https://github.com/elastic/x-plugins/issues/1066
|
|
|
|
ext.compactProfile = 'full'
|
|
|
|
|
2015-12-03 11:16:41 -05:00
|
|
|
dependencyLicenses.enabled = false
|
|
|
|
|
2015-11-25 18:28:45 -05:00
|
|
|
dependencies {
|
|
|
|
// license deps
|
|
|
|
compile project(':x-plugins:elasticsearch:license:plugin-api')
|
|
|
|
testCompile project(':x-plugins:elasticsearch:license:licensor')
|
|
|
|
|
|
|
|
// shield deps
|
|
|
|
compile 'dk.brics.automaton:automaton:1.11-8'
|
|
|
|
compile 'com.unboundid:unboundid-ldapsdk:2.3.8'
|
|
|
|
testCompile 'com.google.jimfs:jimfs:1.0'
|
|
|
|
|
|
|
|
// watcher deps
|
|
|
|
compile 'com.googlecode.owasp-java-html-sanitizer:owasp-java-html-sanitizer:r239'
|
|
|
|
compile 'com.google.guava:guava:16.0.1' // needed by watcher and shield tests for jimfs
|
|
|
|
compile 'com.google.code.findbugs:jsr305:3.0.1' // TODO: remove this
|
|
|
|
compile 'com.sun.mail:javax.mail:1.5.3'
|
2015-12-10 08:47:55 -05:00
|
|
|
// fork of mustache: https://github.com/elastic/x-plugins/issues/1116
|
|
|
|
compile 'com.github.spullara.mustache.java:compiler:0.9.1' // TODO: remove this
|
2015-11-25 18:28:45 -05:00
|
|
|
testCompile 'org.subethamail:subethasmtp:3.1.7'
|
|
|
|
|
|
|
|
// common test deps
|
2015-12-10 15:26:05 -05:00
|
|
|
testCompile 'org.elasticsearch:securemock:1.2'
|
2015-11-25 18:28:45 -05:00
|
|
|
testCompile 'org.slf4j:slf4j-log4j12:1.6.2'
|
|
|
|
testCompile 'org.slf4j:slf4j-api:1.6.2'
|
|
|
|
|
|
|
|
// mock web server
|
|
|
|
testCompile "com.squareup.okhttp:mockwebserver:${versions.okhttp}"
|
|
|
|
testCompile "com.squareup.okhttp:okhttp:${versions.okhttp}"
|
|
|
|
testCompile "com.squareup.okhttp:okhttp-ws:${versions.okhttp}"
|
|
|
|
testCompile 'com.squareup.okio:okio:1.3.0'
|
|
|
|
testCompile 'org.bouncycastle:bcprov-jdk15on:1.50'
|
|
|
|
}
|
|
|
|
|
|
|
|
// we keep the source directories in the original structure of split plugins,
|
|
|
|
// in order to facilitate backports to 2.x. TODO: remove after 5.0 release
|
2015-11-26 11:05:19 -05:00
|
|
|
for (String module : ['', 'license-plugin/', 'shield/', 'watcher/', 'marvel/']) {
|
2015-11-25 18:28:45 -05:00
|
|
|
sourceSets {
|
|
|
|
main {
|
|
|
|
java.srcDir("${module}src/main/java")
|
|
|
|
resources.srcDir("${module}src/main/resources")
|
|
|
|
}
|
|
|
|
test {
|
|
|
|
java.srcDir("${module}src/test/java")
|
|
|
|
resources.srcDir("${module}src/test/resources")
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
compileJava.options.compilerArgs << "-Xlint:-deprecation,-rawtypes,-serial,-try,-unchecked"
|
|
|
|
compileTestJava.options.compilerArgs << "-Xlint:-deprecation,-rawtypes,-serial,-try,-unchecked"
|
|
|
|
|
|
|
|
ext.expansions = [
|
|
|
|
'project.version': version,
|
2015-12-17 17:01:32 -05:00
|
|
|
// Used in marvel index templates
|
2016-02-10 20:18:21 -05:00
|
|
|
'monitoring.template.version': '1',
|
|
|
|
// Used in watcher index templates
|
2016-02-09 03:39:07 -05:00
|
|
|
'watcher.template.version': '1',
|
2015-11-25 18:28:45 -05:00
|
|
|
]
|
|
|
|
|
|
|
|
processResources {
|
2015-12-01 07:23:32 -05:00
|
|
|
from(sourceSets.main.resources.srcDirs) {
|
|
|
|
exclude '**/public.key'
|
|
|
|
inputs.properties(expansions)
|
|
|
|
MavenFilteringHack.filter(it, expansions)
|
|
|
|
}
|
2015-11-25 18:28:45 -05:00
|
|
|
String licenseKeyName = System.getProperty('license.key', 'dev')
|
|
|
|
String licenseKeyPath = "license-plugin/keys/${licenseKeyName}/public.key"
|
|
|
|
if (file(licenseKeyPath).exists() == false) {
|
|
|
|
throw new GradleException("no public key found for '${licenseKeyName}'")
|
2015-12-17 17:01:32 -05:00
|
|
|
}
|
|
|
|
from licenseKeyPath
|
2015-11-25 18:28:45 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
processTestResources {
|
2015-11-26 11:05:19 -05:00
|
|
|
from(sourceSets.test.resources.srcDirs) {
|
|
|
|
exclude '**/*.key'
|
|
|
|
exclude '**/*.jks'
|
|
|
|
exclude '**/*.p12'
|
|
|
|
inputs.properties(expansions)
|
|
|
|
MavenFilteringHack.filter(it, expansions)
|
|
|
|
}
|
2015-11-25 18:28:45 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
forbiddenPatterns {
|
|
|
|
exclude '**/*.key'
|
|
|
|
exclude '**/*.p12'
|
|
|
|
}
|
|
|
|
|
|
|
|
// TODO: standardize packaging config for plugins
|
|
|
|
bundlePlugin {
|
|
|
|
from(projectDir) {
|
|
|
|
include 'LICENSE.txt'
|
|
|
|
include 'NOTICE.txt'
|
|
|
|
}
|
2016-02-09 08:35:37 -05:00
|
|
|
from('shield/bin/xpack') {
|
2015-11-25 18:28:45 -05:00
|
|
|
into 'bin'
|
|
|
|
}
|
2016-02-09 08:35:37 -05:00
|
|
|
from('shield/config/xpack') {
|
2015-11-25 18:28:45 -05:00
|
|
|
into 'config'
|
|
|
|
}
|
2016-02-09 08:35:37 -05:00
|
|
|
from('watcher/bin/xpack') {
|
2015-11-25 18:28:45 -05:00
|
|
|
into 'bin'
|
|
|
|
}
|
2015-12-11 21:23:01 -05:00
|
|
|
}
|
2015-12-01 09:57:01 -05:00
|
|
|
|
2015-12-11 21:23:01 -05:00
|
|
|
integTest {
|
2015-12-11 21:24:27 -05:00
|
|
|
// TODO: fix this rest test to not depend on a hardcoded port!
|
2015-12-11 21:23:01 -05:00
|
|
|
systemProperty 'tests.rest.blacklist', 'getting_started/10_monitor_cluster_health/*'
|
|
|
|
cluster {
|
2016-02-05 05:13:30 -05:00
|
|
|
setupCommand 'setupDummyUser', 'bin/xpack/esusers', 'useradd', 'test_user', '-p', 'changeme', '-r', 'admin'
|
2016-01-18 18:20:33 -05:00
|
|
|
waitCondition = { NodeInfo node, AntBuilder ant ->
|
|
|
|
File tmpFile = new File(node.cwd, 'wait.success')
|
|
|
|
ant.get(src: "http://${node.httpUri()}",
|
|
|
|
dest: tmpFile.toString(),
|
|
|
|
username: "test_user",
|
|
|
|
password: "changeme",
|
|
|
|
ignoreerrors: true, // do not fail on error, so logging buffers can be flushed by the wait task
|
|
|
|
retries: 10)
|
|
|
|
return tmpFile.exists()
|
|
|
|
}
|
2015-12-01 09:57:01 -05:00
|
|
|
}
|
2015-11-25 18:28:45 -05:00
|
|
|
}
|
2015-12-01 14:16:29 -05:00
|
|
|
|
|
|
|
// TODO: don't publish test artifacts just to run messy tests, fix the tests!
|
|
|
|
// https://github.com/elastic/x-plugins/issues/724
|
|
|
|
configurations {
|
|
|
|
testArtifacts.extendsFrom testRuntime
|
|
|
|
}
|
|
|
|
task testJar(type: Jar) {
|
|
|
|
classifier "test"
|
|
|
|
from sourceSets.test.output
|
|
|
|
}
|
|
|
|
artifacts {
|
|
|
|
testArtifacts testJar
|
|
|
|
}
|
2015-12-16 18:57:05 -05:00
|
|
|
|
2016-01-18 18:20:33 -05:00
|
|
|
run {
|
2016-02-05 05:13:30 -05:00
|
|
|
setupCommand 'setupDummyUser', 'bin/xpack/esusers', 'useradd', 'test_user', '-p', 'changeme', '-r', 'admin'
|
2016-01-18 18:20:33 -05:00
|
|
|
}
|
|
|
|
|
2015-12-16 18:57:05 -05:00
|
|
|
// classes are missing, e.g. com.ibm.icu.lang.UCharacter
|
|
|
|
thirdPartyAudit.excludes = [
|
|
|
|
// uses internal java api: sun.misc.Unsafe
|
|
|
|
'com.google.common.cache.Striped64',
|
|
|
|
'com.google.common.cache.Striped64$1',
|
|
|
|
'com.google.common.cache.Striped64$Cell',
|
|
|
|
'com.google.common.primitives.UnsignedBytes$LexicographicalComparatorHolder$UnsafeComparator',
|
|
|
|
'com.google.common.primitives.UnsignedBytes$LexicographicalComparatorHolder$UnsafeComparator$1',
|
|
|
|
]
|
2015-12-18 13:27:52 -05:00
|
|
|
|
|
|
|
// someone figure out what the x-plugins logic should be
|
|
|
|
licenseHeaders.enabled = false
|