forked from linkedin/norbert
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle
48 lines (39 loc) · 1.8 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
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
def getScalaSuffix(scalaVersion) {
return scalaVersion.startsWith('2.10') ? '_2.10' : "_$scalaVersion"
}
subprojects {
// the cross built scala modules share the same source directories so we need to make their output directories unique
buildDir = "${rootProject.buildDir}/$name"
plugins.withType(JavaPlugin) {
project.dependencies {
testCompile externalDependency.junit
}
}
def projectScalaVersion = properties.targetScalaVersions.split(',').find { name.contains(getScalaSuffix(it)) }
ext.scalaVersion = projectScalaVersion ? projectScalaVersion : properties.defaultScalaVersion
ext.scalaSuffix = getScalaSuffix(ext.scalaVersion)
ext.externalDependency = [
'zookeeper':'org.apache.zookeeper:zookeeper:3.3.4',
'protobuf':'com.google.protobuf:protobuf-java:2.4.0a',
'log4j':'log4j:log4j:1.2.17',
'netty':'io.netty:netty:3.7.0.Final',
'slf4jApi':'org.slf4j:slf4j-api:1.7.5',
'slf4jLog4j':'org.slf4j:slf4j-log4j12:1.7.5',
'specs':"org.scala-tools.testing:specs${ext.scalaSuffix}:${ext.scalaSuffix == '_2.10' ? '1.6.9' : '1.6.8'}",
'mockitoAll':'org.mockito:mockito-all:1.8.4',
'cglib':'cglib:cglib:2.1_3',
'objenesis':'org.objenesis:objenesis:1.2',
'scalaCompiler': "org.scala-lang:scala-compiler:${ext.scalaVersion}",
'scalaLibrary': "org.scala-lang:scala-library:${ext.scalaVersion}",
'scalaActors': "org.scala-lang:scala-actors:${ext.scalaVersion}",
'junit':'junit:junit:4.8.1'
];
}