forked from elastic/elasticsearch-hadoop
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle
44 lines (36 loc) · 1.22 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
apply plugin: 'es.hadoop.build.integration'
description = "Elasticsearch Hadoop Map/Reduce"
dependencies {
provided(project.ext.hadoopClient)
provided("org.codehaus.jackson:jackson-mapper-asl:${project.ext.jacksonVersion}")
testCompile "io.netty:netty-all:4.0.29.Final"
testCompile "org.elasticsearch:securemock:1.2"
}
String generatedResources = "$buildDir/generated-resources/main"
sourceSets {
main {
output.dir(generatedResources, builtBy: "generateGitHash")
}
}
task generateGitHash {
inputs.file project.ext.gitHead
outputs.file generatedResources
doLast {
Properties props = new Properties()
props.put("version", version)
props.put("hash", project.ext.revHash)
File output = new File(generatedResources, "esh-build.properties")
new File(generatedResources).mkdirs()
output.createNewFile()
props.store(output.newWriter(), null)
}
}
eclipse.classpath.file {
whenMerged { cp ->
// export all jars (to be used upstream by dependent projects) <-- for some reason Gradle removes all jars
cp.entries.each { entry ->
if (entry.hasProperty("exported"))
entry.exported = true
}
}
}