forked from quiqueck/BetterEnd
-
Notifications
You must be signed in to change notification settings - Fork 1
/
settings.betterx.gradle
63 lines (47 loc) · 2.18 KB
/
settings.betterx.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
// #### Custom Settings ####
//Change the next line to disable local library loading
def allowLocalLibUse = true
//When true, the local libraries is also used in commandline builds
def allowLocalLibInConsoleMode = false
//The path were to look for the local libraries
def BCLibPath = '../BCLib'
def WoverPath = '../WorldWeaver'
def WunderLibPath = '../WunderLib'
// #### Logic ####
def isIDE = properties.containsKey('android.injected.invoked.from.ide')
|| (System.getenv("XPC_SERVICE_NAME") ?: "").contains("intellij")
|| (System.getenv("XPC_SERVICE_NAME") ?: "").contains(".idea")
|| System.getenv("IDEA_INITIAL_DIRECTORY") != null
println "IntelliJ: ${isIDE}"
def BCLibFolder = new File(BCLibPath)
def WunderLibFolder = new File(WunderLibPath)
def WoverFolder = new File(WoverPath)
if (allowLocalLibUse && (isIDE || allowLocalLibInConsoleMode) && BCLibFolder.exists()) {
println "!! Using local BCLib from '${BCLibFolder}'"
include ':BCLib'
project(":BCLib").projectDir = BCLibFolder
project(':BCLib').buildFileName = './bclib-composit.gradle'
}
if (allowLocalLibUse && (isIDE || allowLocalLibInConsoleMode) && WunderLibFolder.exists()) {
println "!! Using local WunderLib from '${WunderLibFolder}'"
include ':wunderlib'
project(":wunderlib").projectDir = WunderLibFolder
project(':wunderlib').buildFileName = './wunderlib-composit.gradle'
}
if (allowLocalLibUse && (isIDE || allowLocalLibInConsoleMode) && WoverFolder.exists()) {
println "!! Using local WorldWeaver from '${WoverFolder}'"
include ':WorldWeaver'
project(":WorldWeaver").projectDir = WoverFolder
project(':WorldWeaver').buildFileName = './build.composit.gradle'
def WoverModuleFile = WoverFolder.toPath().resolve("module-include.gradle").toFile()
apply from: WoverModuleFile
gradle.ext.set("knownWoverModules", ext.knownWoverModules)
ext.knownWoverModules.each { module ->
def fullName = ":WorldWeaver:${module}";
def path = WoverFolder.toPath().resolve(module).toFile();
include fullName
project(fullName).name = module
print(project(fullName).parent)
println "Including module ${module} from ${path}"
}
}