forked from LinkedInAttic/Cubert
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
113 lines (94 loc) · 2.62 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
112
113
apply plugin: 'java'
apply plugin: 'eclipse'
apply plugin: 'idea'
ext.isDefaultEnvironment = !project.hasProperty('overrideBuildEnvironment')
File getEnvironmentScript()
{
final File env = file(isDefaultEnvironment ? 'defaultEnvironment.gradle' : project.overrideBuildEnvironment)
assert env.isFile() : "The environment script [$env] does not exists or is not a file."
return env
}
apply from: environmentScript
repositories {
mavenCentral()
}
defaultTasks 'dist'
/**
* Adding a new Collection to configurations
* jars that have to be added to fat jar
*/
configurations {
fatjar {
transitive = false
}
}
dependencies {
/* Dependencies for compile collection */
compile "org.apache.hadoop:hadoop-client:$hadoopVersion"
compile "org.apache.pig:pig:$pigVersion"
compile "org.apache.avro:avro:$avroVersion"
compile "org.apache.avro:avro-mapred:$avroMapredVersion"
compile "org.antlr:antlr4:$antlrVersion"
compile "org.antlr:antlr4-runtime:$antlrVersion"
compile "dk.brics.automaton:automaton:1.11-8"
compile "joda-time:joda-time:$jodaVersion"
compile "com.googlecode.json-simple:json-simple:1.1"
compile "org.roaringbitmap:RoaringBitmap:0.4.8"
/* Dependencies for testCompile collection */
testCompile "org.testng:testng:6.8.5"
/* Dependencies for fat jar collection */
fatjar "org.apache.pig:pig:$pigVersion"
fatjar "joda-time:joda-time:$jodaVersion"
fatjar "com.googlecode.json-simple:json-simple:1.1"
fatjar "org.apache.avro:avro:$avroVersion"
fatjar "org.apache.avro:avro-mapred:$avroMapredVersion"
fatjar "org.antlr:antlr4-runtime:$antlrVersion"
fatjar "dk.brics.automaton:automaton:1.11-8"
fatjar "org.roaringbitmap:RoaringBitmap:0.4.8"
}
/**
* Generate parser code from antlr grammar
*/
task genParser(type: JavaExec) {
ext.src = file('src/main/antlr4/CubertPhysical.g4')
ext.dst = file('src/main/java/com/linkedin/cubert/antlr4/')
inputs.file ext.src
outputs.dir ext.dst
main = 'org.antlr.v4.Tool'
args '-o'
args ext.dst.absolutePath
args ext.src.absolutePath
classpath = configurations.compile
}
/**
* Create the fat jar
*/
jar {
from (configurations.fatjar.collect { zipTree(it) }) {
exclude "META-INF/*.SF"
exclude "META-INF/*.DSA"
exclude "META-INF/*.RSA"
}
}
task dist(type: Copy) {
outputs.dir "release/lib"
/*
from configurations.compile
into 'release/lib'
include '*.jar'
*/
from "$buildDir/libs"
into "release/lib"
include '*.jar'
}
test {
maxHeapSize = '3096m'
useTestNG() {
}
}
javadoc {
exclude "**/piggybank/**"
}
compileJava.dependsOn genParser
dist.dependsOn jar
clean.dependsOn cleanDist