-
Notifications
You must be signed in to change notification settings - Fork 925
/
settings.gradle
72 lines (62 loc) · 2.17 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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
plugins {
id("de.fayard.refreshVersions") version "0.51.0"
}
rootDir.eachFile(groovy.io.FileType.DIRECTORIES) { File parent ->
String[] ignoreFolders = ["buildSrc", "fastlane", "submodules", "node_modules", "gradle", "build", ".maestro"]
if (!parent.name.startsWith(".") && !ignoreFolders.contains(parent.name)) {
Boolean shouldAddProject = false
parent.eachFile {
if (it.name.contains("build.gradle")) {
shouldAddProject = true
return
}
}
if (shouldAddProject) {
include ":${parent.name}"
} else {
parent.eachFile(groovy.io.FileType.DIRECTORIES) { child -> // We only one level deep
Boolean shouldAddSubProject = false
child.eachFile {
if (it.name.contains("build.gradle")) {
shouldAddSubProject = true
return
}
}
if (shouldAddSubProject) {
include ":${child.name}"; project(":${child.name}").projectDir = new File("${parent.name}/${child.name}")
}
}
}
}
}
rootProject.children.each { subproject ->
if (subproject.name == "vpn") {
subproject.buildFileName = "${subproject.name}-build.gradle"
}
}
buildCache {
def getFile = { dir, filename ->
File file = new File("$dir$File.separator$filename")
file?.exists() ? file : null
}
def getLocalProperties = { dir ->
def file = getFile(dir, "local.properties")
if (!file) {
return null
}
Properties properties = new Properties()
properties.load(file.newInputStream())
return properties
}
local {
def properties = getLocalProperties(rootDir)
if (properties != null) {
enabled = "true" == properties.getProperty("local.build.cache", "true")
} else {
enabled = true
}
// configure local build cache directory so that it is local to the project dir
directory = new File(rootDir, 'build-cache')
removeUnusedEntriesAfterDays = 7
}
}