Switch to gradle build system.

See elastic/elasticsearchelastic/elasticsearch#13930

Original commit: elastic/x-pack-elasticsearch@b8d26ebd2a
This commit is contained in:
Ryan Ernst 2015-10-29 11:44:48 -07:00
parent c088d19da4
commit d1b5d020f5
8 changed files with 328 additions and 1 deletions

97
build.gradle Normal file
View File

@ -0,0 +1,97 @@
buildscript {
repositories {
mavenCentral()
maven {
name 'sonatype-snapshots'
url 'http://oss.sonatype.org/content/repositories/snapshots/'
}
}
dependencies {
classpath 'org.elasticsearch.gradle:build-tools:3.0.0-SNAPSHOT'
classpath 'org.elasticsearch.gradle:project-attachment-plugin:1.0.0-SNAPSHOT'
}
}
apply plugin: 'elasticsearch.project-attachment'
allprojects {
apply plugin: 'idea'
apply plugin: 'eclipse'
}
subprojects {
project.group = 'org.elasticsearch'
project.version = '3.0.0-SNAPSHOT'
project.ext {
luceneSnapshotRevision = '1710880'
}
repositories {
mavenCentral()
maven {
name 'sonatype-snapshots'
url 'http://oss.sonatype.org/content/repositories/snapshots/'
}
maven {
name 'lucene-snapshots'
url "http://s3.amazonaws.com/download.elasticsearch.org/lucenesnapshots/${luceneSnapshotRevision}"
}
}
}
<repository>
<id>elasticsearch-releases</id>
<url>http://maven.elasticsearch.org/releases</url>
<releases>
<enabled>true</enabled>
<updatePolicy>daily</updatePolicy>
</releases>
<snapshots>
<enabled>false</enabled>
</snapshots>
</repository>
<repository>
<id>elasticsearch-internal-snapshots</id>
<url>http://maven.elasticsearch.org/artifactory/internal-snapshots</url>
<releases>
<enabled>false</enabled>
</releases>
<snapshots>
<enabled>true</enabled>
<updatePolicy>always</updatePolicy>
</snapshots>
</repository>
*/
/*
subprojects {
task artifacts {
group = "Help"
description = "Displays the artifacts associated with each configuration of " + project
doFirst {
configurations.findAll().each { config ->
println "${config}:"
config.allArtifacts.getFiles().each { file -> println "" + file}
println ' '
}
}
}
}
*/
// ================= Local Elasticsearch attachment ===============
if ('elasticsearch' in attachments) {
subprojects {
it.ext.projectsPrefix = ':elasticsearch'
configurations {
all {
resolutionStrategy {
dependencySubstitution {
substitute module("org.elasticsearch:rest-api-spec:${version}") with project(":elasticsearch:rest-api-spec")
substitute module("org.elasticsearch:elasticsearch:${version}") with project(":elasticsearch:core")
substitute module("org.elasticsearch:test-framework:${version}") with project(":elasticsearch:test-framework")
substitute module("org.elasticsearch.distribution.zip:elasticsearch:${version}") with project(":elasticsearch:distribution:zip")
}
}
}
}
}
}

29
buildSrc/build.gradle Normal file
View File

@ -0,0 +1,29 @@
apply plugin: 'groovy'
buildscript {
repositories {
maven {
name 'sonatype-snapshots'
url 'http://oss.sonatype.org/content/repositories/snapshots/'
}
}
dependencies {
classpath 'org.elasticsearch.gradle:project-attachment-plugin:1.0.0-SNAPSHOT'
}
}
apply plugin: 'elasticsearch.project-attachment'
repositories {
mavenCentral()
maven {
name 'sonatype-snapshots'
url "https://oss.sonatype.org/content/repositories/snapshots/"
}
}
subprojects {
rootProject.dependencies {
runtime project(path)
}
}

13
buildSrc/settings.gradle Normal file
View File

@ -0,0 +1,13 @@
buildscript {
repositories {
maven {
name 'sonatype-snapshots'
url 'http://oss.sonatype.org/content/repositories/snapshots/'
}
}
dependencies {
classpath 'org.elasticsearch.gradle:project-attachment-plugin:1.0.0-SNAPSHOT'
}
}
apply plugin: 'elasticsearch.project-settings-attachment'

53
marvel/build.gradle Normal file
View File

@ -0,0 +1,53 @@
import org.elasticsearch.gradle.MavenFilteringHack
apply plugin: 'elasticsearch.esplugin'
esplugin {
name 'marvel-agent'
description 'Elasticsearch Marvel'
classname 'org.elasticsearch.marvel.MarvelPlugin'
isolated false
}
configurations {
licensePluginZip
}
dependencies {
licensePluginZip project(path: ':license:plugin') // zip
provided project(path: ':license:plugin', configuration: 'runtime')
provided project(path: ':shield', configuration: 'runtime')
testCompile 'org.elasticsearch:securemock:1.1'
testCompile 'com.squareup.okhttp:mockwebserver:2.3.0'
}
compileJava.options.compilerArgs << '-Xlint:-rawtypes,-unchecked'
compileTestJava.options.compilerArgs << '-Xlint:-rawtypes,-unchecked'
ext.expansions = [
'project.version': version,
'integ.http.port': integTest.cluster.httpPort
]
processResources {
inputs.properties(expansions)
MavenFilteringHack.filter(it, expansions)
}
processTestResources {
inputs.properties(expansions)
MavenFilteringHack.filter(it, expansions)
}
integTest {
dependsOn configurations.licensePluginZip
cluster {
plugin 'installLicensePlugin', configurations.licensePluginZip
}
}
bundlePlugin {
from(projectDir) {
include 'LICENSE.txt'
include 'NOTICE.txt'
}
}

25
settings.gradle Normal file
View File

@ -0,0 +1,25 @@
rootProject.name = 'x-plugins'
buildscript {
repositories {
maven {
name 'sonatype-snapshots'
url 'http://oss.sonatype.org/content/repositories/snapshots/'
}
}
dependencies {
classpath 'org.elasticsearch.gradle:project-attachment-plugin:1.0.0-SNAPSHOT'
}
}
apply plugin: 'elasticsearch.project-settings-attachment'
include 'license:core2'
project(':license:core2').projectDir = new File(project(':license').projectDir, 'core')
include 'license:licensor'
include 'license:plugin-api'
include 'license:plugin'
include 'license:found-plugin'
include 'shield'
include 'watcher'
include 'marvel'

45
shield/build.gradle Normal file
View File

@ -0,0 +1,45 @@
apply plugin: 'elasticsearch.esplugin'
esplugin {
description 'Elasticsearch Shield (security)'
classname 'org.elasticsearch.shield.ShieldPlugin'
isolated false
}
configurations.create('jar')
artifacts {
jar project.jar
}
dependencies {
compile project(':license:plugin-api')
compile project(path: ':license:plugin', configuration: 'runtime')
compile 'dk.brics.automaton:automaton:1.11-8'
compile 'com.unboundid:unboundid-ldapsdk:2.3.8'
testCompile "org.elasticsearch:test-framework:${version}"
testCompile 'org.slf4j:slf4j-log4j12:1.6.2'
testCompile 'org.elasticsearch:securemock:1.1'
}
forbiddenPatterns {
exclude '**/*.p12'
}
compileJava.options.compilerArgs << "-Xlint:-deprecation,-rawtypes,-serial,-try,-unchecked"
compileTestJava.options.compilerArgs << "-Xlint:-deprecation,-rawtypes,-serial,-try,-unchecked"
// no integ tests...
integTest.enabled = false
// TODO: standardize packaging config for plugins
bundlePlugin {
from(projectDir) {
include 'LICENSE.txt'
include 'NOTICE.txt'
}
from('bin/shield') {
into 'bin'
}
from('config/shield') {
into 'config'
}
}

65
watcher/build.gradle Normal file
View File

@ -0,0 +1,65 @@
import org.elasticsearch.gradle.MavenFilteringHack
apply plugin: 'elasticsearch.esplugin'
esplugin {
description 'Elasticsearch Watcher'
classname 'org.elasticsearch.watcher.WatcherPlugin'
isolated false
}
configurations {
licensePluginZip
}
dependencies {
licensePluginZip project(path: ':license:plugin') // zip
provided project(path: ':license:plugin', configuration: 'runtime')
provided project(path: ':shield', configuration: 'runtime')
compile 'com.googlecode.owasp-java-html-sanitizer:owasp-java-html-sanitizer:r239'
compile 'com.sun.mail:javax.mail:1.5.3'
compile 'javax.activation:activation:1.1.1'
// this should be "provided"...
provided 'com.github.spullara.mustache.java:compiler:0.9.1'
testCompile "org.elasticsearch:test-framework:${version}"
testCompile('org.subethamail:subethasmtp:3.1.7') {
exclude group: 'javax.mail', module: 'mail'
}
testCompile 'com.squareup.okhttp:mockwebserver:2.3.0'
testCompile 'org.slf4j:slf4j-log4j12:1.6.2'
testCompile 'org.elasticsearch:securemock:1.1'
}
compileJava.options.compilerArgs << "-Xlint:-deprecation,-rawtypes,-serial,-try,-unchecked"
compileTestJava.options.compilerArgs << "-Xlint:-deprecation,-rawtypes,-serial,-try,-unchecked"
/*ext.expansions = [
'integ.http.port': integTest.cluster.httpPort
]
processTestResources {
inputs.properties(expansions)
with copySpec {
MavenFilteringHack.filter(it, expansions)
}
}
*/
integTest {
dependsOn configurations.licensePluginZip
cluster {
plugin 'installLicensePlugin', configurations.licensePluginZip
}
}
// TODO: standardize packaging config for plugins
bundlePlugin {
from(projectDir) {
include 'LICENSE.txt'
include 'NOTICE.txt'
}
from('bin/watcher') {
into 'bin'
}
}

View File

@ -23,7 +23,7 @@
"http": { "http": {
"request": { "request": {
"host": "localhost", "host": "localhost",
"port": ${integ.http.port}, "port": 9400,
"path": "/_cluster/health", "path": "/_cluster/health",
"auth" : { "auth" : {
"basic" : { "basic" : {