forked from jhartman/norbert
-
Notifications
You must be signed in to change notification settings - Fork 46
/
settings.gradle
31 lines (28 loc) · 1007 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
29
30
31
def modules = ['cluster', 'network', 'java-cluster', 'java-network', 'norbert', 'examples']
def modulesToCrossBuild = ['cluster', 'network', 'java-cluster', 'java-network', 'norbert']
def getScalaSuffix(scalaVersion) {
def suffix = scalaVersion
def pattern = suffix =~ /(2.1[0-1]).+/
if (pattern.find()) {
suffix = pattern.group(1)
}
return "_$suffix"
}
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))
}
}