-
Notifications
You must be signed in to change notification settings - Fork 990
/
build.gradle
45 lines (37 loc) · 1.35 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
import org.elasticsearch.hadoop.gradle.buildtools.ConcatFilesTask
description = 'Elasticsearch for Apache Hadoop'
apply plugin: 'es.hadoop.build.root'
defaultTasks 'build'
allprojects {
group = "org.elasticsearch"
tasks.withType(AbstractCopyTask) {
duplicatesStrategy = DuplicatesStrategy.EXCLUDE
}
}
// Simple utility task to help with downloading artifacts and jars
if (project.hasProperty("find-artifact")) {
String artifact = project.getProperty("find-artifact")
configurations {
findJar
}
dependencies {
findJar artifact
}
task find(type: Copy) {
dependsOn configurations.findJar
from configurations.findJar.first()
into new File(rootProject.buildDir, 'found/')
doLast {
if (configurations.findJar.files.size() > 0) {
String artifactName = configurations.findJar.first().name
File found = new File(rootProject.buildDir, 'found/')
logger.lifecycle("Found [$artifactName] and stored it in [$found]")
if (configurations.findJar.size() > 1) {
configurations.findJar.each { logger.lifecycle("Also found other dependencies: [${ it.name }]") }
}
} else {
logger.lifecycle("Could not find artifact [$artifact]")
}
}
}
}