forked from linkedin/rest.li
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
312 lines (269 loc) · 8.7 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
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
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
project.ext.buildScriptDirPath = "${projectDir.path}/build_script"
project.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
apply from: "${buildScriptDirPath}/configBuildScript.gradle"
project.ext.externalDependency = [
'avro': 'org.apache.avro:avro:1.4.0',
'avro_1_6': 'org.apache.avro:avro:1.6.3',
'cglib': 'cglib:cglib-nodep:2.2',
'codemodel': 'com.sun.codemodel:codemodel:2.2',
'commonsCli': 'commons-cli:commons-cli:1.0',
'commonsCodec': 'commons-codec:commons-codec:1.3',
'commonsHttpClient': 'commons-httpclient:commons-httpclient:3.1',
'commonsIo': 'commons-io:commons-io:1.4',
'commonsLang': 'commons-lang:commons-lang:2.4',
'easymock': 'org.easymock:easymock:3.1',
'googleCollections': 'com.google.collections:google-collections:1.0-rc2',
'jacksonCoreAsl': 'org.codehaus.jackson:jackson-core-asl:1.4.2',
'jacksonCoreAsl_1_8': 'org.codehaus.jackson:jackson-core-asl:1.8.8',
'jacksonMapperAsl': 'org.codehaus.jackson:jackson-mapper-asl:1.4.2',
'javaxInject': 'javax.inject:javax.inject:1',
'jdkTools': files("${System.getProperty('java.home')}/../lib/tools.jar"),
'jetty': 'org.mortbay.jetty:jetty:6.1.26',
'jettyUtil': 'org.mortbay.jetty:jetty-util:6.1.26',
'json': 'org.json:json:20070829',
'log4j': 'log4j:log4j:1.2.15',
'mail': 'javax.mail:mail:1.4.1',
'mina': 'org.apache.mina:mina-core:1.1.7',
'netty': 'org.jboss.netty:netty:3.2.3.Final',
'objenesis': 'org.objenesis:objenesis:1.2',
'parseq': 'com.linkedin.parseq:parseq:1.2.0',
'servletApi': 'javax.servlet:servlet-api:2.5',
'slf4jApi': 'org.slf4j:slf4j-api:1.6.2',
'slf4jLog4j12': 'org.slf4j:slf4j-log4j12:1.6.2',
'testng': 'org.testng:testng:6.4',
'velocity': 'org.apache.velocity:velocity:1.5',
'zookeeper': 'org.apache.zookeeper:zookeeper:3.3.0'
];
if (!project.ext.isDefaultEnvironment)
{
spec.external.each { overrideDepKey, overrideDepValue ->
if (project.ext.externalDependency[overrideDepKey] != null)
{
project.ext.externalDependency[overrideDepKey] = overrideDepValue
}
}
}
allprojects {
apply plugin: 'idea'
tasks.withType(Compile).all { Compile compile ->
compile.options.compilerArgs = ['-Xlint', '-Xlint:-path', '-Werror']
}
}
task wrapper(type: Wrapper) {
gradleVersion = '1.0'
}
subprojects {
apply plugin: 'java'
apply plugin: 'eclipse'
apply from: "${buildScriptDirPath}/cleanGenerated.gradle"
sourceCompatibility = JavaVersion.VERSION_1_6
configurations {
compile {
transitive = false
}
testArtifacts
}
// Default dependencies for all subprojects
dependencies {
compile externalDependency.slf4jApi
runtime externalDependency.slf4jLog4j12
runtime externalDependency.log4j
}
if (isDefaultEnvironment)
{
apply plugin: 'maven'
apply plugin: 'signing'
project.group = 'com.linkedin.pegasus'
repositories {
mavenLocal()
mavenCentral()
}
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 jar
archives sourcesJar
archives javadocJar
}
signing {
required = { gradle.taskGraph.hasTask("uploadArchives") }
sign configurations.archives
}
uploadArchives {
repositories {
mavenDeployer {
beforeDeployment { MavenDeployment deployment -> signPom(deployment) }
repository(url: "https://oss.sonatype.org/service/local/staging/deploy/maven2/") {
authentication(userName: sonatypeUsername, password: sonatypePassword)
}
pom.project {
name project.name
packaging 'jar'
description 'Pegasus is a framework for building robust, scalable service architectures using dynamic discovery and simple asychronous type-checked REST + JSON APIs.'
url 'http://github.com/linkedin/pegasus'
scm {
url '[email protected]:linkedin/pegasus.git'
connection 'scm:git:[email protected]:linkedin/pegasus.git'
developerConnection 'scm:git:[email protected]:linkedin/pegasus.git'
}
licenses {
license {
name 'The Apache Software License, Version 2.0'
url 'http://www.apache.org/licenses/LICENSE-2.0.txt'
distribution 'repo'
}
}
developers {
developer {
id 'sweeboonlim'
name 'Swee Lim'
}
developer {
id 'sihde'
name 'Steve Ihde'
}
developer {
id 'mtagle'
name 'Moira Tagle'
}
developer {
id 'adublinkedin'
name 'Alex Dubman'
}
developer {
id 'CrendKing'
name 'Keren Jin'
}
developer {
id 'DuglsYoung'
name 'Doug Young'
}
developer {
id 'osumampouw'
name 'Oby Sumampouw'
}
developer {
id 'davidhoa'
name 'David Hoa'
}
developer {
id 'cpettitt'
name 'Chris Pettitt'
}
developer {
id 'chikit'
name 'Chi Kit Chan'
}
developer {
id 'apy101'
name 'Angelika Clayton'
}
developer {
id 'jpbetz'
name 'Joe Betz'
}
}
}
}
}
}
}
task testJar(type: Jar){
from sourceSets.test.output
classifier = 'tests'
}
artifacts {
testArtifacts testJar
}
// Configure the IDEA plugin to (1) add the codegen as source dirs and (2) work around
// an apparent bug in the plugin which doesn't set the outputDir/testOutputDir as documented
idea.module {
// Gradle docs claim the two settings below are the default, but
// the actual defaults appear to be "out/production/$MODULE_NAME"
// and "out/test/$MODULE_NAME". Changing it so IDEA and gradle share
// the class output directory.
outputDir = sourceSets.main.output.classesDir
testOutputDir = sourceSets.test.output.classesDir
}
test {
maxHeapSize = '1g'
useTestNG() {
excludeGroups 'not_implemented'
excludeGroups 'integration'
excludeGroups 'd2integration'
excludeGroups 'integration_external_product_dependent'
excludeGroups 'known_issue'
}
}
task integrationTests(type: Test) {
useTestNG() {
includeGroups 'integration'
excludeGroups 'd2integration'
excludeGroups 'integration_external_product_dependent'
}
}
task d2integrationTests(type: Test) {
useTestNG() {
includeGroups 'd2integration'
excludeGroups 'integration'
excludeGroups 'integration_external_product_dependent'
}
}
//all functional tests which are expected to pass assuming proper environment setup
task allTests(type: Test) {
maxHeapSize = '1g'
useTestNG() {
excludeGroups 'known_issue'
excludeGroups 'not_implemented'
}
}
task integrationExternalProductDependentTests(type: Test) {
useTestNG() {
includeGroups 'integration_external_product_dependent'
}
}
task notImplementedFeaturesTests(type: Test) {
useTestNG() {
includeGroups 'not_implemented'
}
}
task knownIssuesTests(type: Test) {
useTestNG() {
includeGroups 'known_issue'
}
}
task allFailingTests(type: Test) {
useTestNG() {
includeGroups 'known_issue'
includeGroups 'not_implemented'
}
}
task cleanBuildDir(type: Exec){
delete(rootDir.toString()+'build')
commandLine = ['rm', '-rf', rootDir.toString() + '/build']
workingDir = file(rootDir.toString())
}
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())
}
}
}