OpenSearch/build.gradle

113 lines
2.8 KiB
Groovy
Raw Normal View History

2010-02-08 08:30:06 -05:00
import java.text.SimpleDateFormat
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-03-09 06:33:21 -05:00
versionNumber = '0.6.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')
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/'
}
}
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 }
copy {
from('.')
into explodedDistDir
include 'LICENSE.txt'
include 'NOTICE.txt'
include 'README.textile'
}
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
exclude 'bin/*'
}
from(explodedDistDir) {
into zipRootFolder
include 'bin/*'
exclude 'bin/*.*'
fileMode: '775'
}
from(explodedDistDir) {
into zipRootFolder
include 'bin/*.*'
2010-02-08 08:30:06 -05:00
}
}
2010-04-02 08:47:27 -04:00
//zip.doFirst {task ->
// task.configure {
// zipFileSet(dir: explodedDistDir, prefix: zipRootFolder) {
// exclude 'bin/*'
// }
// zipFileSet(dir: explodedDistDir, prefix: zipRootFolder, fileMode: '775') {
// include 'bin/*'
// exclude 'bin/*.*'
// }
// zipFileSet(dir: explodedDistDir, prefix: zipRootFolder) {
// include 'bin/*.*'
// }
// }
//}
//
task release(dependsOn: [zip, ":plugins-attachments:release"]) << {
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'
}