forked from plusls/plusls-carpet-addition
-
Notifications
You must be signed in to change notification settings - Fork 17
/
settings.gradle
77 lines (65 loc) · 1.76 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
73
74
75
76
77
import groovy.json.JsonSlurper
pluginManagement {
repositories {
mavenLocal()
maven {
name("NyanMaven Mirror")
url("https://maven.hendrixshen.top/mirror")
}
maven {
name("Jitpack")
url("https://jitpack.io")
}
mavenCentral()
gradlePluginPortal()
}
resolutionStrategy {
eachPlugin {
switch (requested.id.id) {
case "com.replaymod.preprocess": {
useModule("com.github.Fallen-Breath:preprocessor:${requested.version}")
break
}
}
}
}
}
ext {
File localPropsFile = file("${rootDir}/local.properties")
if (localPropsFile.exists()) {
Properties p = new Properties()
p.load(new FileInputStream(localPropsFile))
p.each { key, value ->
ext[key as String] = value
}
}
getOrDefault = { String key, String defaultValue ->
if (!ext.has(key)) {
return defaultValue
}
String value = ext.getProperty(key)
return value.isEmpty() ? defaultValue : value
}
}
def versions = Arrays.asList(
"1.14.4",
"1.15.2",
"1.16.5",
"1.17.1",
"1.18.2",
"1.19.2",
"1.19.3",
"1.19.4",
"1.20.1",
"1.20.2",
"1.20.4",
)
Map<String, List<String>> settings = file("settings.json").withReader {
new JsonSlurper().parse(it) as Map<String, List<String>>
}
for (String version : settings.get("versions")) {
include(":$version")
ProjectDescriptor proj = project(":$version")
proj.setProjectDir(file("versions/$version"))
proj.setBuildFileName("../${settings.versions.get(0)}/build.gradle")
}