2010-02-08 08:30:06 -05:00
|
|
|
dependsOn(':test-testng')
|
|
|
|
|
2010-04-02 08:47:27 -04:00
|
|
|
apply plugin: 'java'
|
|
|
|
apply plugin: 'maven'
|
2010-02-08 08:30:06 -05:00
|
|
|
|
|
|
|
archivesBaseName = "$project.archivesBaseName"
|
|
|
|
|
2010-06-15 09:51:38 -04:00
|
|
|
// make sure we jarjar things before we compile Java
|
|
|
|
compileJava.dependsOn << ":jarjar:jar"
|
|
|
|
|
2010-02-08 08:30:06 -05:00
|
|
|
processResources.doLast {
|
|
|
|
Properties versionProps = new Properties();
|
|
|
|
versionProps.setProperty("number", rootProject.version)
|
|
|
|
versionProps.setProperty("date", buildTimeStr)
|
|
|
|
|
|
|
|
File versionFile = new File(sourceSets.main.classesDir, "/org/elasticsearch/version.properties")
|
|
|
|
versionFile.parentFile.mkdirs()
|
|
|
|
versionFile.withOutputStream {
|
|
|
|
versionProps.store(it, '')
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// no need to use the resource dir
|
2010-10-31 04:50:35 -04:00
|
|
|
sourceSets.main.resources.srcDirs 'src/main/java'
|
2010-04-20 18:17:19 -04:00
|
|
|
sourceSets.test.resources.srcDirs 'src/test/java'
|
2010-02-08 08:30:06 -05:00
|
|
|
|
|
|
|
dependencies {
|
2010-06-15 09:51:38 -04:00
|
|
|
compile files(rootProject.jarjarArchivePath)
|
|
|
|
|
2010-02-08 08:30:06 -05:00
|
|
|
compile('jline:jline:0.9.94') { transitive = false }
|
2010-05-06 14:07:24 -04:00
|
|
|
compile files(rootProject.file("lib/sigar/sigar-1.6.3.jar").absolutePath)
|
2010-02-08 08:30:06 -05:00
|
|
|
|
2010-06-15 09:51:38 -04:00
|
|
|
|
2010-04-17 17:51:17 -04:00
|
|
|
compile 'org.slf4j:slf4j-api:1.5.11'
|
|
|
|
compile('org.slf4j:slf4j-log4j12:1.5.11') { transitive = false }
|
2010-02-08 08:30:06 -05:00
|
|
|
compile('log4j:log4j:1.2.15') { transitive = false }
|
|
|
|
|
2010-10-30 13:40:24 -04:00
|
|
|
compile('net.java.dev.jna:jna:3.2.7') { transitive = false }
|
|
|
|
|
2010-06-19 18:04:39 -04:00
|
|
|
compile 'org.apache.lucene:lucene-core:3.0.2'
|
|
|
|
compile 'org.apache.lucene:lucene-analyzers:3.0.2'
|
|
|
|
compile 'org.apache.lucene:lucene-queries:3.0.2'
|
|
|
|
compile 'org.apache.lucene:lucene-fast-vector-highlighter:3.0.2'
|
2010-02-08 08:30:06 -05:00
|
|
|
|
|
|
|
testCompile project(':test-testng')
|
|
|
|
testCompile('org.testng:testng:5.10:jdk15') { transitive = false }
|
2010-04-20 17:57:11 -04:00
|
|
|
testCompile('org.hamcrest:hamcrest-all:1.1') { transitive = false }
|
2010-02-08 08:30:06 -05:00
|
|
|
}
|
|
|
|
|
2010-04-30 12:00:17 -04:00
|
|
|
configurations {
|
|
|
|
deployerJars
|
|
|
|
tools
|
|
|
|
}
|
|
|
|
|
|
|
|
dependencies {
|
|
|
|
deployerJars "org.apache.maven.wagon:wagon-http:1.0-beta-2"
|
|
|
|
}
|
|
|
|
|
2010-05-13 07:41:50 -04:00
|
|
|
jar {
|
2010-04-30 12:00:17 -04:00
|
|
|
// from sourceSets.main.allJava
|
2010-05-13 07:41:50 -04:00
|
|
|
manifest {
|
|
|
|
attributes("Implementation-Title": "ElasticSearch", "Implementation-Version": rootProject.version, "Implementation-Date": buildTimeStr)
|
|
|
|
}
|
|
|
|
}
|
2010-04-30 12:00:17 -04:00
|
|
|
|
|
|
|
jar << {
|
2010-06-15 09:51:38 -04:00
|
|
|
mergedArchivePath = new File(jar.archivePath.absolutePath + ".merged.jar")
|
2010-04-30 12:00:17 -04:00
|
|
|
project.ant {
|
2010-06-15 09:51:38 -04:00
|
|
|
jar(destfile: mergedArchivePath) {
|
|
|
|
zipFileSet(src: jar.archivePath)
|
|
|
|
zipFileSet(src: rootProject.jarjarArchivePath)
|
2010-04-30 12:00:17 -04:00
|
|
|
}
|
|
|
|
delete(file: jar.archivePath)
|
2010-06-15 09:51:38 -04:00
|
|
|
move(file: mergedArchivePath, tofile: jar.archivePath)
|
2010-04-30 12:00:17 -04:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2010-04-03 18:23:58 -04:00
|
|
|
javadoc {
|
|
|
|
maxMemory = "1g"
|
|
|
|
}
|
|
|
|
|
2010-02-08 08:30:06 -05:00
|
|
|
test {
|
|
|
|
useTestNG()
|
|
|
|
jmvArgs = ["-ea", "-Xmx1024m"]
|
2010-04-02 08:47:27 -04:00
|
|
|
suiteName = project.name
|
|
|
|
listeners = ["org.elasticsearch.util.testng.Listeners"]
|
|
|
|
systemProperties["es.test.log.conf"] = System.getProperty("es.test.log.conf", "log4j-gradle.properties")
|
2010-02-08 08:30:06 -05:00
|
|
|
}
|
2010-03-01 10:19:07 -05:00
|
|
|
|
2010-04-06 04:44:41 -04:00
|
|
|
task sourcesJar(type: Jar, dependsOn: classes) {
|
|
|
|
classifier = 'sources'
|
|
|
|
from sourceSets.main.allSource
|
|
|
|
}
|
|
|
|
|
|
|
|
task javadocJar(type: Jar, dependsOn: javadoc) {
|
|
|
|
classifier = 'javadoc'
|
|
|
|
from javadoc.destinationDir
|
|
|
|
}
|
|
|
|
|
|
|
|
artifacts {
|
|
|
|
archives sourcesJar
|
|
|
|
archives javadocJar
|
|
|
|
}
|
|
|
|
|
2010-03-01 10:19:07 -05:00
|
|
|
uploadArchives {
|
|
|
|
repositories.mavenDeployer {
|
2010-04-02 14:24:28 -04:00
|
|
|
configuration = configurations.deployerJars
|
2010-04-14 01:34:47 -04:00
|
|
|
repository(url: rootProject.mavenRepoUrl) {
|
|
|
|
authentication(userName: rootProject.mavenRepoUser, password: rootProject.mavenRepoPass)
|
2010-04-02 14:24:28 -04:00
|
|
|
}
|
2010-04-14 01:34:47 -04:00
|
|
|
snapshotRepository(url: rootProject.mavenSnapshotRepoUrl) {
|
|
|
|
authentication(userName: rootProject.mavenRepoUser, password: rootProject.mavenRepoPass)
|
2010-04-02 14:24:28 -04:00
|
|
|
}
|
2010-04-02 12:08:33 -04:00
|
|
|
|
2010-04-02 09:54:01 -04:00
|
|
|
pom.project {
|
|
|
|
inceptionYear '2009'
|
|
|
|
name 'elasticsearch'
|
|
|
|
description 'Open Source, Distributed, RESTful Search Engine'
|
|
|
|
licenses {
|
|
|
|
license {
|
|
|
|
name 'The Apache Software License, Version 2.0'
|
|
|
|
url 'http://www.apache.org/licenses/LICENSE-2.0.txt'
|
|
|
|
distribution 'repo'
|
|
|
|
}
|
|
|
|
}
|
|
|
|
scm {
|
|
|
|
connection 'git://github.com/elasticsearch/elasticsearch.git'
|
|
|
|
developerConnection 'git@github.com:elasticsearch/elasticsearch.git'
|
|
|
|
url 'http://github.com/elasticsearch/elasticsearch'
|
|
|
|
}
|
|
|
|
}
|
2010-04-02 12:08:33 -04:00
|
|
|
|
|
|
|
pom.whenConfigured {pom ->
|
|
|
|
pom.dependencies = pom.dependencies.findAll {dep -> dep.scope != 'test' } // removes the test scoped ones
|
2010-10-30 13:40:24 -04:00
|
|
|
pom.dependencies = pom.dependencies.findAll {dep -> !dep.artifactId.contains('jna') } // remove jna, its optional
|
2010-06-15 09:51:38 -04:00
|
|
|
pom.dependencies = pom.dependencies.findAll {dep -> !dep.artifactId.contains('jarjar') }
|
2010-04-20 17:29:42 -04:00
|
|
|
pom.dependencies = pom.dependencies.findAll {dep -> !dep.artifactId.contains('log4j') }
|
|
|
|
pom.dependencies = pom.dependencies.findAll {dep -> !dep.artifactId.contains('slf4j') }
|
|
|
|
pom.dependencies = pom.dependencies.findAll {dep -> !dep.artifactId.contains('jline') }
|
2010-04-02 12:08:33 -04:00
|
|
|
}
|
2010-03-01 10:19:07 -05:00
|
|
|
}
|
|
|
|
}
|