2010-02-08 08:30:06 -05:00
|
|
|
import java.text.SimpleDateFormat
|
|
|
|
|
2010-03-01 09:30:07 -05:00
|
|
|
defaultTasks "clean", "release"
|
2010-02-08 08:30:06 -05:00
|
|
|
|
2010-04-02 08:47:27 -04:00
|
|
|
apply plugin: 'base'
|
2010-02-08 08:30:06 -05:00
|
|
|
|
|
|
|
archivesBaseName = 'elasticsearch'
|
|
|
|
|
|
|
|
buildTime = new Date()
|
|
|
|
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss");
|
|
|
|
sdf.setTimeZone(TimeZone.getTimeZone("UTC"));
|
|
|
|
buildTimeStr = sdf.format(buildTime)
|
|
|
|
|
2011-04-23 16:56:12 -04:00
|
|
|
versionNumber = '0.17.0-SNAPSHOT'
|
2010-02-08 08:30:06 -05:00
|
|
|
|
|
|
|
explodedDistDir = new File(distsDir, 'exploded')
|
|
|
|
explodedDistLibDir = new File(explodedDistDir, 'lib')
|
|
|
|
explodedDistBinDir = new File(explodedDistDir, 'bin')
|
|
|
|
explodedDistConfigDir = new File(explodedDistDir, 'config')
|
|
|
|
|
2010-08-20 10:50:04 -04:00
|
|
|
mavenRepoUrl = System.getenv("REPO_URL");
|
|
|
|
if (mavenRepoUrl == null) {
|
|
|
|
// mavenRepoUrl = "file://localhost/" + projectDir.absolutePath + "/build/maven/repository"
|
|
|
|
mavenRepoUrl = "http://oss.sonatype.org/service/local/staging/deploy/maven2/"
|
|
|
|
}
|
|
|
|
mavenSnapshotRepoUrl = System.getenv("SNAPSHOT_REPO_URL");
|
|
|
|
if (mavenSnapshotRepoUrl == null) {
|
|
|
|
// mavenSnapshotRepoUrl = "file://localhost/" + projectDir.absolutePath + "/build/maven/snapshotRepository"
|
|
|
|
mavenSnapshotRepoUrl = "http://oss.sonatype.org/content/repositories/snapshots"
|
|
|
|
}
|
|
|
|
mavenRepoUser = System.getenv("REPO_USER")
|
2010-04-14 01:34:47 -04:00
|
|
|
mavenRepoPass = System.getenv("REPO_PASS")
|
2010-02-08 08:30:06 -05:00
|
|
|
|
2010-06-15 09:51:38 -04:00
|
|
|
jarjarArchivePath = project(":jarjar").file("build/libs/jarjar-$versionNumber" + ".jar").absolutePath
|
|
|
|
|
2010-02-08 08:30:06 -05:00
|
|
|
allprojects {
|
|
|
|
group = 'org.elasticsearch'
|
|
|
|
version = versionNumber
|
|
|
|
|
|
|
|
plugins.withType(JavaPlugin).whenPluginAdded {
|
|
|
|
sourceCompatibility = 1.6
|
|
|
|
targetCompatibility = 1.6
|
2011-01-20 07:24:12 -05:00
|
|
|
compileJava {
|
|
|
|
sourceCompatibility = 1.6
|
|
|
|
targetCompatibility = 1.6
|
|
|
|
options.encoding = "UTF8"
|
|
|
|
}
|
|
|
|
javadoc {
|
|
|
|
maxMemory = "1g"
|
|
|
|
options.encoding = "UTF8"
|
|
|
|
}
|
|
|
|
|
2010-12-30 09:08:38 -05:00
|
|
|
|
|
|
|
test {
|
|
|
|
useTestNG()
|
|
|
|
String testSuiteName = project.name
|
|
|
|
suiteName = project.name
|
|
|
|
workingDir = rootProject.projectDir
|
|
|
|
options {
|
|
|
|
suiteNamte = testSuiteName
|
|
|
|
listeners << 'org.elasticsearch.util.testng.Listeners'
|
|
|
|
}
|
2011-02-09 13:45:21 -05:00
|
|
|
maxHeapSize = '1g'
|
|
|
|
systemProperties["es.logger.prefix"] = ""
|
2010-12-30 09:08:38 -05:00
|
|
|
systemProperties["es.test.log.conf"] = System.getProperty("es.test.log.conf", "log4j-gradle.properties")
|
|
|
|
systemProperties["es.test.log.conf"] = System.getProperty("es.test.log.conf", "log4j-gradle.properties")
|
|
|
|
}
|
|
|
|
|
|
|
|
dependencies {
|
|
|
|
if (project.name != "test-testng") {
|
|
|
|
testCompile project(':test-testng')
|
|
|
|
}
|
|
|
|
testCompile('org.testng:testng:5.14.6') { transitive = false }
|
|
|
|
testCompile('com.beust:jcommander:1.5') { transitive = false }
|
|
|
|
testCompile('org.beanshell:bsh:2.0b4') { transitive = false }
|
|
|
|
testCompile('org.hamcrest:hamcrest-core:1.3.RC2') { transitive = false }
|
|
|
|
testCompile('org.hamcrest:hamcrest-library:1.3.RC2') { transitive = false }
|
|
|
|
}
|
2010-02-08 08:30:06 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
repositories {
|
|
|
|
mavenCentral()
|
2010-05-14 11:23:10 -04:00
|
|
|
mavenRepo urls: 'https://repository.jboss.org/nexus/content/groups/public'
|
2010-06-13 20:15:23 -04:00
|
|
|
mavenRepo urls: 'http://repository.codehaus.org/'
|
2010-04-27 07:47:32 -04:00
|
|
|
mavenRepo urls: 'http://elasticsearch.googlecode.com/svn/maven'
|
2010-06-23 14:51:29 -04:00
|
|
|
mavenRepo urls: 'http://oss.sonatype.org/content/repositories/releases'
|
2010-07-22 16:33:38 -04:00
|
|
|
mavenRepo urls: 'http://oss.sonatype.org/content/repositories/snapshots'
|
2010-10-30 13:40:24 -04:00
|
|
|
mavenRepo urls: 'http://download.java.net/maven/2/'
|
2010-02-08 08:30:06 -05:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
configurations {
|
|
|
|
dists
|
|
|
|
distLib {
|
|
|
|
visible = false
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2010-08-16 05:56:45 -04:00
|
|
|
//task run(dependsOn: [configurations.distLib], description: 'Runs') << {
|
|
|
|
// ant.java(classname: "org.elasticsearch.bootstrap.Bootstrap", fork: "true", classpath: configurations.distLib.asPath,
|
|
|
|
// jvmargs: "-Des-foreground=yes")
|
|
|
|
//}
|
|
|
|
|
2010-02-08 08:30:06 -05:00
|
|
|
dependencies {
|
|
|
|
distLib project(':elasticsearch')
|
|
|
|
}
|
|
|
|
|
|
|
|
task explodedDist(dependsOn: [configurations.distLib], description: 'Builds a minimal distribution image') << {
|
2010-05-13 07:41:50 -04:00
|
|
|
ant.delete(dir: explodedDistDir) // clean the exploded dir
|
2010-02-08 08:30:06 -05:00
|
|
|
[explodedDistDir, explodedDistLibDir, explodedDistBinDir, explodedDistConfigDir]*.mkdirs()
|
|
|
|
// remove old elasticsearch files
|
|
|
|
ant.delete { fileset(dir: explodedDistLibDir, includes: "$archivesBaseName-*.jar") }
|
|
|
|
|
|
|
|
copy {
|
|
|
|
from configurations.distLib
|
|
|
|
into explodedDistLibDir
|
|
|
|
}
|
|
|
|
|
|
|
|
copy { from('bin'); into explodedDistBinDir }
|
|
|
|
copy { from('config'); into explodedDistConfigDir }
|
2010-05-06 14:07:24 -04:00
|
|
|
copy { from('lib'); into explodedDistLibDir }
|
2010-02-08 08:30:06 -05:00
|
|
|
|
|
|
|
copy {
|
|
|
|
from('.')
|
|
|
|
into explodedDistDir
|
|
|
|
include 'LICENSE.txt'
|
|
|
|
include 'NOTICE.txt'
|
|
|
|
include 'README.textile'
|
|
|
|
}
|
|
|
|
|
2010-07-07 10:15:26 -04:00
|
|
|
ant.replace(dir: explodedDistBinDir, token: "@ES_VERSION@", value: versionNumber)
|
|
|
|
|
2010-04-09 10:06:09 -04:00
|
|
|
ant.delete { fileset(dir: explodedDistLibDir, includes: "$archivesBaseName-*-javadoc.jar") }
|
|
|
|
ant.delete { fileset(dir: explodedDistLibDir, includes: "$archivesBaseName-*-sources.jar") }
|
2010-04-20 17:29:42 -04:00
|
|
|
ant.delete { fileset(dir: explodedDistLibDir, includes: "slf4j-*.jar") } // no need for slf4j
|
2010-06-15 09:51:38 -04:00
|
|
|
ant.delete { fileset(dir: explodedDistLibDir, includes: "jarjar-*.jar") } // no need jackson, we jarjar it
|
2010-05-06 14:07:24 -04:00
|
|
|
ant.delete { fileset(dir: explodedDistLibDir, includes: "sigar-*.jar") } // no need sigar directly under lib...
|
2010-04-09 10:06:09 -04:00
|
|
|
|
2010-02-08 08:30:06 -05:00
|
|
|
ant.chmod(dir: "$explodedDistDir/bin", perm: "ugo+rx", includes: "**/*")
|
|
|
|
}
|
|
|
|
|
2010-04-02 08:47:27 -04:00
|
|
|
task zip(type: Zip, dependsOn: ['explodedDist']) {
|
2010-11-05 19:28:10 -04:00
|
|
|
rootFolder = "$archivesBaseName-${-> version}"
|
2010-04-02 08:47:27 -04:00
|
|
|
from(explodedDistDir) {
|
2010-11-05 19:28:10 -04:00
|
|
|
into rootFolder
|
2010-04-02 13:39:27 -04:00
|
|
|
exclude 'bin/elasticsearch'
|
2010-05-03 03:49:50 -04:00
|
|
|
exclude 'bin/plugin'
|
2010-04-02 08:47:27 -04:00
|
|
|
}
|
|
|
|
from(explodedDistDir) {
|
2010-11-05 19:28:10 -04:00
|
|
|
into rootFolder
|
2010-04-02 13:39:27 -04:00
|
|
|
include 'bin/elasticsearch'
|
2010-05-03 03:49:50 -04:00
|
|
|
include 'bin/plugin'
|
2010-04-02 13:39:27 -04:00
|
|
|
fileMode = 0755
|
2010-02-08 08:30:06 -05:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2010-11-05 19:28:10 -04:00
|
|
|
task tar(type: Tar, dependsOn: ['explodedDist']) {
|
|
|
|
compression = Compression.GZIP
|
|
|
|
extension = "tar.gz"
|
|
|
|
rootFolder = "$archivesBaseName-${-> version}"
|
|
|
|
from(explodedDistDir) {
|
|
|
|
into rootFolder
|
|
|
|
exclude 'bin/*.bat'
|
|
|
|
exclude 'bin/elasticsearch'
|
|
|
|
exclude 'bin/plugin'
|
|
|
|
exclude 'lib/sigar/*win*'
|
|
|
|
}
|
|
|
|
from(explodedDistDir) {
|
|
|
|
into rootFolder
|
|
|
|
include 'bin/elasticsearch'
|
|
|
|
include 'bin/plugin'
|
|
|
|
fileMode = 0755
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
task release(dependsOn: [zip, tar]) << {
|
2010-03-29 06:53:09 -04:00
|
|
|
ant.delete(dir: explodedDistDir)
|
2010-02-08 08:30:06 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
task wrapper(type: Wrapper) {
|
2011-06-13 07:38:00 -04:00
|
|
|
gradleVersion = '1.0-milestone-3'
|
2010-02-08 08:30:06 -05:00
|
|
|
}
|