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)
|
|
|
|
|
2010-04-09 11:19:37 -04:00
|
|
|
versionNumber = '0.7.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-04-14 01:34:47 -04:00
|
|
|
//mavenRepoUrl = "file://localhost/" + projectDir.absolutePath + "/build/maven/repository"
|
|
|
|
//mavenSnapshotRepoUrl = "file://localhost/" + projectDir.absolutePath + "/build/maven/snapshotRepository"
|
|
|
|
mavenRepoUrl = "http://oss.sonatype.org/service/local/staging/deploy/maven2/"
|
|
|
|
mavenSnapshotRepoUrl = "http://oss.sonatype.org/content/repositories/snapshots"
|
|
|
|
mavenRepoUser = "kimchy"
|
|
|
|
mavenRepoPass = System.getenv("REPO_PASS")
|
2010-02-08 08:30:06 -05:00
|
|
|
|
|
|
|
allprojects {
|
|
|
|
group = 'org.elasticsearch'
|
|
|
|
version = versionNumber
|
|
|
|
|
|
|
|
plugins.withType(JavaPlugin).whenPluginAdded {
|
|
|
|
sourceCompatibility = 1.6
|
|
|
|
targetCompatibility = 1.6
|
|
|
|
}
|
|
|
|
|
|
|
|
repositories {
|
|
|
|
mavenCentral()
|
|
|
|
mavenRepo urls: 'http://repository.jboss.com/maven2/'
|
2010-04-27 07:47:32 -04:00
|
|
|
mavenRepo urls: 'http://elasticsearch.googlecode.com/svn/maven'
|
2010-02-08 08:30:06 -05:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
configurations {
|
|
|
|
dists
|
|
|
|
distLib {
|
|
|
|
visible = false
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
dependencies {
|
|
|
|
distLib project(':elasticsearch')
|
|
|
|
}
|
|
|
|
|
|
|
|
task explodedDist(dependsOn: [configurations.distLib], description: 'Builds a minimal distribution image') << {
|
|
|
|
[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-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-04-30 12:00:17 -04:00
|
|
|
ant.delete { fileset(dir: explodedDistLibDir, includes: "jackson-*.jar") } // no need jackson, we jarjar it
|
|
|
|
ant.delete { fileset(dir: explodedDistLibDir, includes: "joda-*.jar") } // no need joda, we jarjar it
|
2010-05-03 03:49:50 -04:00
|
|
|
ant.delete { fileset(dir: explodedDistLibDir, includes: "snakeyaml-*.jar") } // no need snakeyaml, 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-02-08 08:30:06 -05:00
|
|
|
zipRootFolder = "$archivesBaseName-${-> version}"
|
2010-04-02 08:47:27 -04:00
|
|
|
from(explodedDistDir) {
|
|
|
|
into zipRootFolder
|
2010-04-02 13:39:27 -04:00
|
|
|
exclude 'bin/elasticsearch'
|
2010-05-03 03:49:50 -04:00
|
|
|
exclude 'bin/plugin'
|
2010-04-30 18:42:30 -04:00
|
|
|
exclude 'bin/service/elasticsearch'
|
|
|
|
exclude 'bin/service/elasticsearch32'
|
|
|
|
exclude 'bin/service/elasticsearch64'
|
|
|
|
exclude 'bin/service/exec/**'
|
2010-04-02 08:47:27 -04:00
|
|
|
}
|
|
|
|
from(explodedDistDir) {
|
|
|
|
into zipRootFolder
|
2010-04-02 13:39:27 -04:00
|
|
|
include 'bin/elasticsearch'
|
2010-05-03 03:49:50 -04:00
|
|
|
include 'bin/plugin'
|
2010-04-30 18:42:30 -04:00
|
|
|
include 'bin/service/elasticsearch'
|
|
|
|
include 'bin/service/elasticsearch32'
|
|
|
|
include 'bin/service/elasticsearch64'
|
|
|
|
include 'bin/service/exec/**'
|
2010-04-02 13:39:27 -04:00
|
|
|
fileMode = 0755
|
2010-02-08 08:30:06 -05:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2010-04-25 16:01:00 -04:00
|
|
|
task release(dependsOn: [zip]) << {
|
2010-03-29 06:53:09 -04:00
|
|
|
ant.delete(dir: explodedDistDir)
|
2010-02-08 08:30:06 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
task wrapper(type: Wrapper) {
|
2010-04-02 08:47:27 -04:00
|
|
|
gradleVersion = '0.9-preview-1'
|
2010-02-08 08:30:06 -05:00
|
|
|
jarPath = 'gradle'
|
|
|
|
}
|