This repository has been archived by the owner on Sep 28, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
231 lines (206 loc) · 10.2 KB
/
build.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
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
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
plugins {
id "maven-publish" // Publish to Maven Repo
id "architectury-plugin" version "3.4-SNAPSHOT"
id "dev.architectury.loom" version "1.1-SNAPSHOT" apply false
//id "io.github.juuxel.loom-quiltflower" version "1.+" apply false
id 'io.github.juuxel.loom-vineflower' version '1.11.0' apply false // Quiltflower / Vineflower, a better decompiler
id "de.undercouch.download" version "4.1.2" // Download Files
id "io.github.pacifistmc.forgix" version "1.2.6" // Merge Fabric and Forge Jar
}
architectury {
minecraft = rootProject.minecraft_version
}
subprojects {
apply plugin: "dev.architectury.loom"
//apply plugin: "io.github.juuxel.loom-quiltflower"
apply plugin: "io.github.juuxel.loom-vineflower"
loom {
silentMojangMappingsLicense()
}
repositories {
maven { url = "https://maven.neoforged.net/releases/" }
maven { url = "https://maven.shedaniel.me/" } // Cloth Config, REI
maven {// saps.dev Maven (KubeJS and Rhino)
url = "https://maven.saps.dev/minecraft"
}
maven { url = "https://api.modrinth.com/maven" } // LazyDFU
maven { url = "https://cursemaven.com/" } // Forge Config API Port
maven { url = "https://modmaven.dev/" }
maven { url = "https://maven.blamejared.com/" } // JEI
//maven { url = "https://dvs1.progwml6.com/files/maven/" } // JEI
maven { url = "https://maven.parchmentmc.org/" } // Parchment mappings
maven { url = "https://maven.quiltmc.org/repository/release/" } // Quilt Mappings
maven { url = "https://maven.terraformersmc.com/" } // Mod Menu
maven { url = 'https://maven.ladysnake.org/releases/' }
maven {
// Location of the maven that hosts Mine and Team Resourceful's files.
name = "Resourceful Bees Maven"
url = "https://maven.resourcefulbees.com/repository/maven-public/"
}
maven {
name = 'GeckoLib'
url 'https://dl.cloudsmith.io/public/geckolib3/geckolib/maven/'
}
maven {
name = "SmartBrainLib (SBL) Maven Repo"
url = "https://dl.cloudsmith.io/public/tslat/sbl/maven/"
}
maven { url = "https://maven.cafeteria.dev/releases" } // Fake Player API
maven { url = "https://maven.jamieswhiteshirt.com/libs-release" } // Reach Entity Attributes
maven { url = "https://maven.theillusivec4.top/" } // Curios
maven { url = "https://minecraft.guntram.de/maven/"}
maven {
name = "Fuzs Mod Resources"
url = "https://raw.githubusercontent.com/Fuzss/modresources/main/maven/"
}
maven { url = "https://mvn.devos.one/snapshots/" }
maven { url = "https://jitpack.io/" } // Mixin Extras, Fabric ASM
mavenCentral()
maven { url = "https://maven.fastmirror.net/" }
maven { url = "https://repository.hanbings.io/proxy/" }
}
dependencies {
minecraft "com.mojang:minecraft:${rootProject.minecraft_version}"
// layered mappings - Mojmap names, parchment and QM docs and parameters
mappings loom.layered {
officialMojangMappings()
parchment("org.parchmentmc.data:parchment-${minecraft_version}:${parchment_version}@zip")
}
// see each subproject for dependencies.
}
}
allprojects {
apply plugin: "java"
apply plugin: "architectury-plugin"
apply plugin: "maven-publish"
archivesBaseName = rootProject.archives_base_name
group = rootProject.maven_group
version = rootProject.mod_version + (project.name == "fabric" || project.name == "forge" ? "-" + project.name : "") + "-mc" + rootProject.minecraft_version
repositories {
// Add repositories to retrieve artifacts from in here.
// You should only use this when depending on other mods because
// Loom adds the essential maven repositories to download Minecraft and libraries from automatically.
// See https://docs.gradle.org/current/userguide/declaring_repositories.html
// for more information about repositories.
}
tasks.withType(JavaCompile) {
options.encoding = "UTF-8"
}
java {
withSourcesJar()
}
}
forgix {
group = project.maven_group // This is the common group of the mod which by default in Architectury Template it's defined as "maven_group" in your gradle.properties. If this property is not defined then by default it'll fetch the group from the maven_group property in your gradle.properties
mergedJarName = project.archives_base_name + "-" + rootProject.mod_version + "-mc" + rootProject.minecraft_version + "-Merged.jar" // This is the name of the merged jar. If this property is not defined then by default it'll fetch the "archives_base_name" property with the "mod_version" property in your gradle.properties.
outputDir = "build/libs/Merged" // This is the output directory of the merged jar from the root project. If this property is not defined then by default it's set to "Merged".
forge {
jarLocation = "build/libs/" + rootProject.archives_base_name + "-" + rootProject.mod_version + "-forge-mc" + rootProject.minecraft_version + ".jar" // This is the location of the forge jar from the forge project. If this property is not defined then by default it fetches the jar with the shortest name.
//EasierTravelCraft-1.0.0-alpha.4+forge-mc1.19.2
//additionalRelocate "org.my.lib" "forge.org.my.lib" // This is an important one to know. This is how you can remap additional packages such as libraries and stuff.
//mixin "forge.mixins.json" // This is in case if we didn't auto detect the forge mixins.
}
fabric {
jarLocation = "build/libs/" + rootProject.archives_base_name + "-" + rootProject.mod_version + "-fabric-mc" + rootProject.minecraft_version + ".jar" // This is the location of the fabric jar from the fabric project. If this property is not defined then by default it fetches the jar with the shortest name.
//additionalRelocate "org.my.lib" "fabric.org.my.lib" // This is an important one to know. This is how you can remap additional packages such as libraries and stuff.
}
/*
quilt {
jarLocation = "build/libs/example-mod.jar" // This is the location of the quilt jar from the quilt project. If this property is not defined then by default it fetches the jar with the shortest name.
additionalRelocate "org.my.lib" "quilt.org.my.lib" // This is an important one to know. This is how you can remap additional packages such as libraries and stuff.
additionalRelocate "org.my.lib.another" "quilt.org.my.lib.another"
}
// For "custom", the "projectName" is a required value.
custom {
projectName = "sponge" // This is the name of the project. This is a required field.
jarLocation = "build/libs/example-mod.jar" // This is the location of the jar from the project. If this property is not defined then by default it fetches the jar with the shortest name.
additionalRelocate "org.my.lib" "sponge.org.my.lib" // This is an important one to know. This is how you can remap additional packages such as libraries and stuff.
additionalRelocate "org.my.lib.another" "sponge.org.my.lib.another"
}
custom {
projectName = "spigot" // This is the name of the project. This is a required field.
jarLocation = "build/libs/example-mod.jar" // This is the location of the jar from the project. If this property is not defined then by default it fetches the jar with the shortest name.
additionalRelocate "org.my.lib" "spigot.org.my.lib" // This is an important one to know. This is how you can remap additional packages such as libraries and stuff.
additionalRelocate "org.my.lib.another" "spigot.org.my.lib.another"
}
// This should be used to remove a duplicate package
removeDuplicate "org.example.mod.core"
*/
}
// Customs Tasks
tasks.register("CleanBuilds") {
group = "build"
doFirst {
println ":cleaning builds"
def buildLibs = {
p -> p.buildDir.toPath().resolve('libs')
}
def devLibs = {
p -> p.buildDir.toPath().resolve('devlibs')
}
def mergeLibs = {
p -> p.buildDir.toPath().resolve('libs/Merged')
}
delete fileTree(buildLibs(rootProject)) {
include '*'
}
delete fileTree(devLibs(rootProject)) {
include '*'
}
delete fileTree(mergeLibs(rootProject)) {
include '*'
}
subprojects {
delete fileTree(buildLibs(project)) {
include '*'
}
delete fileTree(devLibs(project)) {
include '*'
}
}
println ":clean builds SUCCESSFUL"
}
}
tasks.register("CovertBuilds") {
group = "build"
dependsOn 'CleanBuilds'
dependsOn 'build'
subprojects {
dependsOn project.tasks.named('build').get()
}
finalizedBy 'mergeJars'
doFirst {
println ":coverting builds"
def buildLibs = {
p -> p.buildDir.toPath().resolve('libs')
}
def devLibs = {
p -> p.buildDir.toPath().resolve('devlibs')
}
subprojects {
if (project.name != "common") {
copy {
from(buildLibs(project)) {
include '*.jar'
exclude '*-dev.jar', '*-sources.jar', '*-javadoc.jar', '*-shadow.jar', '*-transformProductionFabric.jar', '*-transformProductionForge.jar', '*-transformProductionQuilt.jar'
}
into buildLibs(rootProject)
duplicatesStrategy DuplicatesStrategy.INCLUDE
}
copy {
from(devLibs(project)) {
include '*.jar'
}
into devLibs(rootProject)
duplicatesStrategy DuplicatesStrategy.INCLUDE
}
} else {
println ":" + project.name + ":covert builds SKIPPED"
}
}
}
doLast {
println ":covert builds SUCCESSFUL"
println "The Artifacts should be in the build/libs folder"
}
}