-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
settings.gradle
77 lines (63 loc) · 2.49 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
pluginManagement {
repositories {
maven { url "https://maven.fabricmc.net/" }
maven { url "https://maven.architectury.dev/" }
maven { url "https://maven.minecraftforge.net/" }
maven { url "https://maven.neoforged.net/releases/" }
maven { url "https://maven.parchmentmc.org" }
gradlePluginPortal()
}
}
gradle.ext.set("versionStr", "")
gradle.ext.set("compatible_forge_versions", "")
gradle.ext.set("forgix_merged_jar", "")
// Loads the version.properties
def loadProperties() {
def mcVersion = ""
def mcVers = fileTree("versionProperties").files.name // Get all the files in "versionProperties"
for (int i = 0; i < mcVers.size(); i++) {
mcVers[i] = mcVers[i].replaceAll("\\.properties", "") // As we are getting the file names, we should remove the ".properties" at the end to get the versions
}
assert mcVers.size > 0
mcVers.sort() // Sort so it always goes from oldest to newest
File mcVerPropsFile = file("mcver.properties")
if (!mcVerPropsFile.exists()) {
mcVerPropsFile.text = "# Modify this property to edit the local Minecraft version to use when compiling\nmcVer=unknown\n"
}
println "Avalible MC versions: ${mcVers}"
if (hasProperty("mcVer")) {
println "Using mcVer command line argument"
mcVersion = mcVer
} else {
println "Using mcver.properties file"
def mcVerProps = new Properties()
mcVerProps.load(new FileInputStream(mcVerPropsFile))
mcVersion = mcVerProps.get("mcVer")
}
int mcIndex = mcVers.indexOf(mcVersion)
if (mcIndex == -1) {
println "No mcVer set or the set mcVer is invalid!"
println "Tip: Use -PmcVer=\"1.0\" in cmd arg to set mcVer."
throw new Exception("No mcVer set or the set mcVer is invalid!")
}
println "Loading properties file at " + mcVersion + ".properties"
def props = new Properties()
props.load(new FileInputStream("$rootDir/versionProperties/" + "$mcVersion" + ".properties"))
props.each { prop ->
gradle.ext.set(prop.key, prop.value)
// println "Added prop [key:" + prop.key + ", value:" + prop.value + "]"
}
gradle.ext.mcVers = mcVers
gradle.ext.mcIndex = mcIndex
}
loadProperties()
// include projects
include("mappings")
include("common")
var builds_for = ((String) gradle.builds_for).split(",")
for (loader in builds_for) {
def l = loader.strip()
println "Adding loader " + l
include(l)
}
rootProject.name = "infrastructury-api"