-
Notifications
You must be signed in to change notification settings - Fork 0
/
settings.gradle
33 lines (30 loc) · 1.42 KB
/
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
32
33
/*
* Here we iterate over the directories found in the root directory of the
* main project, and if the subdirectory contains a build.gradle file, it
* is added to the main project as a subproject.
*/
println("Searching projects for build ... ")
rootDir.eachFileRecurse { module ->
if ( module.name == "build.gradle" ) {
String relativePath = module.parentFile.absolutePath - rootDir.absolutePath
if(module.parentFile.absolutePath != rootDir.absolutePath){
module.parentFile.eachFileRecurse {
if (it.isFile() && it.name ==~ /^module\.properties$/) {
def propFile = it
if (propFile) {
Properties moduleProperties = new Properties()
moduleProperties.load(propFile.newDataInputStream())
def moduleName = moduleProperties.getProperty('module.name')
if(!moduleName.empty){
include moduleName
project(":${moduleName}").projectDir = module.parentFile
println("Module included to build [name :${moduleName}, dir: ${project(":${moduleName}").projectDir}]")
}else{
println("No defined module name for ${relativePath} project")
}
}
}
}
}
}
}