forked from linkedin/norbert
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsettings.gradle
28 lines (25 loc) · 938 Bytes
/
settings.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
def modules = ['cluster', 'network', 'java-cluster', 'java-network', 'norbert', 'examples']
def modulesToCrossBuild = ['cluster', 'network', 'java-cluster', 'java-network', 'norbert']
def getScalaSuffix(scalaVersion) {
return scalaVersion.startsWith('2.10') ? '_2.10' : '_' + scalaVersion
}
modules.each {
if (modulesToCrossBuild.contains(it)) {
if (properties.crossBuild.toBoolean()) {
properties.targetScalaVersions.split(',').each { v -> include it + getScalaSuffix(v) }
}
else {
include it + getScalaSuffix(properties.defaultScalaVersion)
}
}
else {
include it
}
}
// each cross-built scala modules needs to be suffixed with the scala version
rootProject.children.each {
def scalaPattern = it.name =~ /(.+)_2(\.[0-9]{1,2}){1,2}/
if (scalaPattern.matches() && modulesToCrossBuild.contains(scalaPattern.group(1))) {
it.projectDir = new File(settingsDir, scalaPattern.group(1))
}
}