forked from elastic/elasticsearch
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
92 lines (72 loc) · 2.24 KB
/
build.gradle
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
import java.text.SimpleDateFormat
defaultTasks "clean", "release"
apply plugin: 'base'
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)
versionNumber = '0.6.0-SNAPSHOT'
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: "**/*")
}
task zip(type: Zip, dependsOn: ['explodedDist']) {
zipRootFolder = "$archivesBaseName-${-> version}"
from(explodedDistDir) {
into zipRootFolder
exclude 'bin/elasticsearch'
}
from(explodedDistDir) {
into zipRootFolder
include 'bin/elasticsearch'
fileMode = 0755
}
}
task release(dependsOn: [zip, ":plugins-attachments:release"]) << {
ant.delete(dir: explodedDistDir)
}
task wrapper(type: Wrapper) {
gradleVersion = '0.9-preview-1'
jarPath = 'gradle'
}