This repository was archived by the owner on May 17, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathbuild.gradle
More file actions
178 lines (145 loc) · 4.85 KB
/
build.gradle
File metadata and controls
178 lines (145 loc) · 4.85 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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
plugins {
id "architectury-plugin" version "${arch_plugin_version}"
id "dev.architectury.loom" version "${loom_version}" apply false
id "io.github.juuxel.loom-vineflower" version "${vineflower_version}" apply false
}
defineMixins()
architectury {
minecraft = rootProject.minecraft_version
}
subprojects { p ->
apply plugin: "dev.architectury.loom"
apply plugin: "io.github.juuxel.loom-vineflower"
def froge = p == project(":forge")
def fabric = p == project(":fabric")
def common = p == project(":common")
loom {
silentMojangMappingsLicense()
runs.configureEach {
vmArg("-Dmixin.debug.export=true")
vmArg("-Dmixin.env.remapRefMap=true")
vmArg("-Dmixin.env.refMapRemappingFile=${projectDir}/build/createSrgToMcp/output.srg")
}
}
configurations {
addJar
shade
addJarCompile
addJarRuntime
if (!common) {
include.extendsFrom addJar
}
compileOnly.extendsFrom addJarCompile
annotationProcessor.extendsFrom addJarCompile
implementation.extendsFrom addJarRuntime
addJar.extendsFrom addJarCompile
addJar.extendsFrom addJarRuntime
implementation.extendsFrom shade
}
repositories {
mavenCentral()
maven { url = "https://maven.parchmentmc.org" }
maven { url = "https://maven.quiltmc.org/repository/release" }
maven {
url = "https://maven.tterrag.com/"
content { includeGroup("com.jozufozu.flywheel") }
}
}
dependencies {
minecraft "com.mojang:minecraft:${rootProject.minecraft_version}"
mappings(loom.layered {
it.mappings("org.quiltmc:quilt-mappings:${rootProject.minecraft_version}+build.${rootProject.quilt}:intermediary-v2")
it.parchment("org.parchmentmc.data:parchment-${rootProject.minecraft_version}:${rootProject.parchment}@zip")
it.officialMojangMappings { nameSyntheticMembers = false }
})
// Dev Env Optimizations
//// https://www.cursemaven.com/
//// https://docs.modrinth.com/docs/tutorials/maven/
if (fabric) {
if (rootProject.hasProperty("lazydfu")) {
modRuntimeOnly "maven.modrinth:lazydfu:${rootProject.lazydfu}"
}
if (rootProject.hasProperty("smoothboot_fabric")) {
modRuntimeOnly "curse.maven:smoothboot-fabric-415758:${rootProject.smoothboot_fabric}"
}
}
if (froge) {
if (rootProject.hasProperty("bmb")) {
modRuntimeOnly "curse.maven:better-mods-button-541584:${rootProject.bmb}"
}
if (rootProject.hasProperty("smoothboot_forge")) {
modRuntimeOnly "curse.maven:smoothboot-forge-633412:${rootProject.smoothboot_forge}"
}
if (rootProject.hasProperty("catalogue")) {
modRuntimeOnly "curse.maven:catalogue-459701:${rootProject.catalogue}"
}
if (rootProject.hasProperty("ferritecore")) {
modRuntimeOnly "curse.maven:ferritecore-429235:${rootProject.ferritecore}"
}
}
}
processResources {
def properties = [
version: rootProject.mod_version,
minecraft_version: rootProject.minecraft_version,
forge: rootProject.forge.split("\\.")[0],
fabric: rootProject.fabric,
fabric_api: rootProject.fabric_api,
create_forge: rootProject.create_forge.split("-")[0],
create_fabric: rootProject.create_fabric,
]
inputs.properties properties
filesMatching("fabric.mod.json") {
expand properties
}
filesMatching("META-INF/mods.toml") {
expand properties
}
}
}
allprojects {
apply plugin: "java"
apply plugin: "architectury-plugin"
apply plugin: "maven-publish"
archivesBaseName = rootProject.archives_base_name
version = rootProject.mod_version
group = rootProject.maven_group
repositories {
maven { url 'https://jitpack.io' } // idk a lot of stuff
maven { // modrinth
url "https://api.modrinth.com/maven"
content { includeGroup "maven.modrinth" }
}
maven { // curseforge
url "https://www.cursemaven.com"
content { includeGroup "curse.maven" }
}
}
tasks.withType(JavaCompile).configureEach {
options.encoding = "UTF-8"
options.release = 17
}
java {
withSourcesJar()
}
}
static def getBuildNumber() {
String buildNumber = System.getenv("GITHUB_RUN_NUMBER")
return (buildNumber != null ? ".${buildNumber}" : "")
}
// Defines the mixins
def defineMixins() {
def mixins = new ArrayList<String>()
def projects = new ArrayList<String>()
for (Project proj : rootProject.subprojects) {
projects.add(proj.name)
}
for (String proj : projects) {
for (File file : project(proj).file("src/main/resources/").listFiles()) {
if (file.getName().endsWith("mixin.json") || file.getName().endsWith("mixins.json")) {
mixins.add(file.getName())
}
}
}
rootProject.ext.set("mixins", mixins)
}