forked from LinkinStars/MicroServiceExample
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsettings.gradle
More file actions
27 lines (25 loc) · 866 Bytes
/
settings.gradle
File metadata and controls
27 lines (25 loc) · 866 Bytes
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
/**
* Groovy script that includes modules automatically.
*/
def dir = new File(settingsDir.toString())
def projects = new HashSet()
def projectSymbol = File.separator + 'src'
dir.eachDirRecurse { subDir ->
def subDirName = subDir.canonicalPath
def isSubProject = true
if (subDirName.endsWith(projectSymbol)) {
for (String projectDir in projects) {
if (subDirName.startsWith(projectDir)) {
isSubProject = false
break
}
}
if (isSubProject) {
projects << subDirName
def lastIndex = subDirName.lastIndexOf(projectSymbol)
def gradleModulePath = subDirName.substring(dir.canonicalPath.length(), lastIndex).replace(File.separator, ':')
println "include " + gradleModulePath
include gradleModulePath
}
}
}