forked from airbnb/aerosolve
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsettings.gradle
More file actions
executable file
·29 lines (24 loc) · 851 Bytes
/
Copy pathsettings.gradle
File metadata and controls
executable file
·29 lines (24 loc) · 851 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
27
28
29
// This searches for `build.gradle` files in all reasonable subdirectories,
// and, when one is found, adds the path as a project path.
import static groovy.io.FileVisitResult.*
import static groovy.io.FileType.*
def skipDirs = ~/^(build|\..*|src|out|buildSrc)/
def preDir = {
if (skipDirs.matcher(it.name).matches()) {
return SKIP_SUBTREE
}
}
def getProjectName(String dir) {
return dir.minus(rootDir.toString()).substring(1).replaceAll("/", ":").replaceAll("\\\\", ":")
}
def disabledProjects = ["projects:pricing"] as Set
rootDir.traverse(type: DIRECTORIES, preDir: preDir) { dir ->
def dstr = dir.toString()
if ((!skipDirs.matcher(dir.name)) &&
new File(dstr + "/build.gradle").exists()) {
def projectName = getProjectName(dstr)
if (!disabledProjects.contains(projectName)) {
include projectName
}
}
}