forked from jhartman/norbert
-
Notifications
You must be signed in to change notification settings - Fork 46
/
build.gradle
65 lines (54 loc) · 2.09 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
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.8.4'
}
}
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) {
def suffix = scalaVersion
def pattern = suffix =~ /(2.1[0-1]).+/
if (pattern.find()) {
suffix = pattern.group(1)
}
return "_$suffix"
}
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
}
project.apply from: "$rootDir/gradle/publishing.gradle"
}
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_2.10:1.6.9',
'specs2':'org.specs2:specs2_2.11:3.7',
'cglib':'cglib:cglib:2.1_3',
'objenesis':'org.objenesis:objenesis:1.2',
'scalaXml': 'org.scala-lang.modules:scala-xml_2.11:1.2.0',
'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'
];
}