Repository navigation
Expand file tree
/
Copy pathsettings.gradle
More file actions
66 lines (59 loc) · 1.7 KB
/
Copy pathsettings.gradle
File metadata and controls
66 lines (59 loc) · 1.7 KB
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
import groovy.json.JsonSlurper
pluginManagement {
repositories {
mavenLocal()
mavenCentral()
gradlePluginPortal()
maven {
name = "Fabric"
url = "https://maven.fabricmc.net/"
}
maven {
name = "Jitpack"
url = "https://jitpack.io"
}
}
resolutionStrategy {
eachPlugin {
if (requested.id.id == "com.replaymod.preprocess") {
useModule("com.github.Fallen-Breath:preprocessor:${requested.version}")
}
}
}
}
def versions = new JsonSlurper().parseText(file("versions.json").text)
def sharedProperties = [
"mod_id",
"mod_license",
"mod_name",
"mod_sources",
"mod_version",
"maven_group",
"archives_base_name",
].collectEntries { name -> [name, providers.gradleProperty(name)] }
versions.each { String mcVersion, Map meta ->
include(":$mcVersion")
ProjectDescriptor proj = project(":$mcVersion")
File location = file("versions/$mcVersion")
location.mkdirs()
proj.setProjectDir(location)
proj.setBuildFileName("../../common.gradle")
}
gradle.beforeProject { Project p ->
if (p.parent != null) {
sharedProperties.each { name, value ->
p.ext.set(name, value.get())
}
}
def meta = versions[p.name]
if (meta != null) {
p.ext.minecraft_version = p.name
p.ext.minecraft_dependency = meta.dep
p.ext.minecraft_out = meta.out
p.ext.java_version = meta.java
p.ext.fabric_version = meta.fabric
p.ext.libgui_version = meta.libgui
p.ext.modmenu_version = meta.modmenu
}
}
include(":fabricWrapper")