forked from linkedin/databus
-
Notifications
You must be signed in to change notification settings - Fork 0
/
subprojects.gradle
172 lines (144 loc) · 5.83 KB
/
subprojects.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
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
ext.isDefaultEnvironment = !project.hasProperty('overrideBuildEnvironment')
File getEnvironmentScript()
{
final File env = rootProject.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
project.version = "2.0.0"
ext.externalDependency = [
'avro': 'org.apache.avro:avro:1.4.0',
'commonsBeanutils': 'commons-beanutils:commons-beanutils:1.7.0',
'commonsCli': 'commons-cli:commons-cli:1.2',
'commonsCodec': 'commons-codec:commons-codec:1.6',
'commonsCollections': 'commons-collections:commons-collections:3.2.1',
'commonsIo': 'commons-io:commons-io:1.4',
'commonsLang': 'commons-lang:commons-lang:2.5',
'commonsLogging': 'commons-logging:commons-logging:1.1',
'commonsParent': 'org.apache.commons:commons-parent:5',
'commonsStats': 'org.apache.commons:commons-math3:3.2',
'easymock': 'org.easymock:easymock:3.1',
'easymockext': 'org.easymock:easymockclassextension:3.1',
'guava': 'com.google.guava:guava:10.0',
'hadoopCore': 'org.apache.hadoop:hadoop-core:0.20.2',
'jacksonCoreAsl': 'org.codehaus.jackson:jackson-core-asl:1.8.5',
'jacksonMapperAsl': 'org.codehaus.jackson:jackson-mapper-asl:1.8.5',
'jline': 'jline:jline:1.0',
'json': 'org.json:json:20070829',
'junit': 'junit:junit:4.8.1',
'log4j': 'log4j:log4j:1.2.15',
'luceneAnalyzers': 'org.apache.lucene:lucene-analyzers:2.9.1',
'luceneCore': 'org.apache.lucene:lucene-core:2.9.1',
'luceneQueries': 'org.apache.lucene:lucene-queries:2.9.1',
'metricsCore': 'com.codahale.metrics:metrics-core:3.0.1',
'mysqlConnectorJava': 'org.mysql:mysql-connector-java:5.1.14',
'netty': 'org.jboss.netty:netty:3.2.4.Final',
'snakeyaml': 'org.yaml:snakeyaml:1.8',
'testng': 'org.testng:testng:6.4',
'zkclient': 'zkclient:zkclient:0.2.0',
'zkclientHelix': 'com.github.sgroschupf:zkclient:0.1',
'zookeeper': 'org.apache.zookeeper:zookeeper:3.3.3',
'ojdbc6': 'com.oracle:ojdbc6:11.2.0.2.0',
'helixCore': 'org.apache.helix:helix-core:0.6.2.0',
'or': 'com.linkedin.dds-mysql:open-replicator-impl:1.0.63'
];
if (isDefaultEnvironment) {
externalDependency['mysqlConnectorJava'] = 'mysql:mysql-connector-java:5.1.14'
externalDependency['helixCore'] = 'org.apache.helix:helix-core:0.6.2-incubating'
externalDependency['or'] = 'com.google:open-replicator:1.0.5'
externalDependency['log4j'] = 'org.slf4j:slf4j-log4j12:1.6.1'
}
tasks.withType(Compile).all { Compile compile ->
compile.options.compilerArgs = ['-Xlint', '-Xlint:-path']
}
/* workaround for GRADLE-2243 (http://issues.gradle.org/browse/GRADLE-2243) */
tasks.withType(FindBugs) {
ignoreFailures=true
effort="max"
reportLevel="medium"
def f = new File("${project.projectDir}", "FindBugs-excludes.xml")
if ( f.exists()) {
logger.info("{} uses FindBugs excludes: {}", project, f.getAbsolutePath())
excludeFilter= file("${project.projectDir}/FindBugs-excludes.xml")
}
}
plugins.withType(JavaPlugin) {
// Please see TOOLS-17168, regarding how runtime dependencies can
// get interpreted as compile time dependency
// configurations.compile.exclude module: 'ojdbc6'
plugins.apply('eclipse')
plugins.apply('idea')
plugins.apply('maven')
if (isDefaultEnvironment) {
plugins.apply('findbugs')
}
sourceCompatibility = JavaVersion.VERSION_1_6
configurations {
all*.exclude group: 'com.sun.jdmk', module: 'jmxtools'
all*.exclude group: 'com.sun.jmx', module: 'jmxri'
all*.exclude group: 'javax.jms', module: 'jms'
/* Uncomment for Cobertura integration */
// testRuntime.exclude group: 'net.sourceforge.cobertura', module: 'cobertura'
testArtifacts
}
// Default dependencies for all subprojects
dependencies {
runtime externalDependency.log4j
// Force easymock to version 3.1. One of the espresso dependencies changes it to 2.4
// and v2.4 does not support mocking of classes, causing our espresso unit tests
// to break.
runtime(externalDependency.easymock) {
force = true
}
compile(externalDependency.easymock) {
force = true
}
}
if (isDefaultEnvironment) {
task sourcesJar(type: Jar, dependsOn: classes) {
from sourceSets.main.allSource
classifier = 'sources'
}
task javadocJar(type: Jar, dependsOn: javadoc) {
from javadoc.destinationDir
classifier = 'javadoc'
}
artifacts {
archives sourcesJar
archives javadocJar
}
}
task testJar(type: Jar){
from sourceSets.test.output
classifier = 'tests'
}
artifacts {
testArtifacts testJar
}
test {
maxHeapSize = '6200m'
jvmArgs '-XX:MaxDirectMemorySize=8192m', '-XX:PermSize=512M', '-XX:MaxPermSize=1024M', '-ea', '-verbose:gc', '-Xloggc:/tmp/test-gc.log', '-XX:+PrintGCDetails', '-XX:+PrintGCDateStamps', '-XX:+UseConcMarkSweepGC', '-XX:+UseParNewGC', '-XX:CMSInitiatingOccupancyFraction=75', '-XX:+UseCMSInitiatingOccupancyOnly', '-XX:NewSize=256m', '-XX:MaxNewSize=256m'
useTestNG()
doFirst { desc->
logger.lifecycle("Running task: " + desc);
}
beforeTest { desc->
logger.lifecycle("Running test: " + desc);
}
}
}
task cleanBuildDir(type: Exec){
commandLine = ['rm', '-rf', rootDir.toString() + '/build']
workingDir = rootDir
}
task makedir(type:Exec) {
// gradle mkdir does not create dir with "-p" flag on so this is a generic task that takes -Ddirpath=..... parameter
// Usage examples:
// gradle makedir -Ddirpath=abc/xyz
def dir = System.getProperties()['dirpath'] ?: null
if (dir != null){
commandLine = ['mkdir','-p', dir]
workingDir = file(rootDir.toString())
}
}