forked from eBay/myriad
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
111 lines (90 loc) · 3.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
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
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
apply plugin: 'java'
apply plugin: 'application'
apply plugin: 'idea'
sourceCompatibility = '1.7'
targetCompatibility = '1.7'
[compileJava, compileTestJava]*.options*.encoding = 'UTF-8'
mainClassName = "com.ebay.myriad.Main"
group = "com.ebay.myriad"
version = "0.0.1"
ext {
mesosVer = "0.20.1"
hadoopVer = "2.5.0"
metricsVer = "3.1.0"
}
configurations.create('myriadExecutorConf')
configurations {
provided
capsule
myriadExecutorConf
myriadExecutorConf.transitive = false
// exclude hadoop/yarn deps for 'runtime'
runtime.exclude group: 'org.apache.hadoop', module: '*'
}
repositories {
mavenLocal()
mavenCentral()
}
dependencies {
capsule "co.paralleluniverse:capsule:0.7.1"
myriadExecutorConf 'org.slf4j:slf4j-log4j12:1.7.7'
compile "org.apache.mesos:mesos:${mesosVer}"
compile "org.apache.hadoop:hadoop-common:${hadoopVer}"
compile "org.apache.hadoop:hadoop-yarn-common:${hadoopVer}"
compile "org.apache.hadoop:hadoop-yarn-server-resourcemanager:${hadoopVer}"
compile 'com.google.code.gson:gson:2.3'
compile "com.lmax:disruptor:3.3.0"
compile "io.dropwizard.metrics:metrics-core:${metricsVer}"
compile "io.dropwizard.metrics:metrics-annotation:${metricsVer}"
compile "io.dropwizard.metrics:metrics-healthchecks:${metricsVer}"
compile "org.hibernate:hibernate-validator:5.1.2.Final"
compile "com.fasterxml.jackson.core:jackson-annotations:2.4.2"
compile "com.fasterxml.jackson.core:jackson-databind:2.4.2"
compile "com.fasterxml.jackson.dataformat:jackson-dataformat-yaml:2.4.2"
compile "org.apache.curator:curator-framework:2.6.0"
testCompile 'junit:junit:4.11'
}
run {
systemProperty "myriad.config", "build/resources/main/myriad-config-default.yml"
}
task capsule(type: Jar, dependsOn: jar) {
archiveName = "myriad-capsule-${version}.jar"
from jar
from { configurations.runtime }
from { sourceSets.main.resources }
from(configurations.capsule.collect { zipTree(it) }) { include 'Capsule.class' }
manifest {
attributes(
'Main-Class' : 'Capsule',
'Application-Class' : mainClassName,
'Min-Java-Version' : '1.7.0',
'JVM-Args' : run.jvmArgs.join(' '),
'System-Properties' : (run.systemProperties + ["myriad.config": '$CAPSULE_DIR/myriad-config-default.yml']).collect { k,v -> "$k=$v" }.join(' ')
)
}
}
// copies dependencies to build/libs dir
task copyRunTimeDeps(type: Sync) {
from configurations.runtime
into "$buildDir/libs"
}
jar {
dependsOn copyRunTimeDeps
}
task capsuleExecutor(type: Jar, dependsOn: jar) {
archiveName = "myriad-executor-${version}.jar"
from jar
from { configurations.runtime }
from { configurations.myriadExecutorConf }
from { sourceSets.main.resources }
from(configurations.capsule.collect { zipTree(it) }) { include 'Capsule.class' }
manifest {
attributes(
'Main-Class' : 'Capsule',
'Application-Class' : 'com.ebay.myriad.executor.MyriadExecutor',
'Min-Java-Version' : '1.7.0',
'JVM-Args' : run.jvmArgs.join(' '),
'System-Properties' : (run.systemProperties).collect { k,v -> "$k=$v" }.join(' ')
)
}
}