generated from Tellios-Projects/Tellios-Template
-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathbuild.gradle
237 lines (202 loc) · 9.02 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
232
233
234
235
236
237
plugins {
id 'fabric-loom' version '1.5-SNAPSHOT'
id 'maven-publish'
id 'org.jetbrains.kotlin.jvm' version("${kotlin_version}")
}
version = project.mod_version
group = project.maven_group
base {
archivesName = project.archives_base_name
}
repositories {
mavenCentral()
exclusiveContent {
forRepository {
maven {
name = "Modrinth"
url = "https://api.modrinth.com/maven"
}
}
// forRepositories(fg.repository) // Only add this if you're using ForgeGradle, otherwise remove this line
filter {
includeGroup "maven.modrinth"
}
}
maven { url = "https://maven.shedaniel.me/" } // Cloth Config, REI
maven { url = "https://maven.blamejared.com/" } // JEI
maven { url = "https://maven.parchmentmc.org" } // Parchment mappings
maven { url = "https://maven.quiltmc.org/repository/release" } // Quilt Mappings
maven { url = "https://api.modrinth.com/maven" } // LazyDFU
maven { url = "https://maven.terraformersmc.com/releases/" } // Mod Menu
maven { url = "https://mvn.devos.one/snapshots/" } // Create, Porting Lib, Forge Tags, Milk Lib, Registrate
maven { url = "https://raw.githubusercontent.com/Fuzss/modresources/main/maven/" } // Forge Config API Port
maven { url = "https://maven.jamieswhiteshirt.com/libs-release" } // Reach Entity Attributes
maven { url = "https://jitpack.io" } // Mixin Extras, Fabric ASM
maven { url = "https://maven.tterrag.com/" } // Flywheel
maven { url = 'https://maven.ladysnake.org/releases' }
maven { url = "https://dvs1.progwml6.com/files/maven/" } // location of the maven that hosts JEI files before January 2023
maven { url = "https://maven.blamejared.com/" } // location of the maven that hosts JEI files since January 2023
maven { url = "https://modmaven.dev" } // location of a maven mirror for JEI files, as a fallback
maven { url = "https://maven.architectury.dev" }
maven { url = "https://mvn.devos.one/snapshots/" } // Create, Porting Lib, Forge Tags, Milk Lib, Registrate
maven { url = 'https://dl.cloudsmith.io/public/geckolib3/geckolib/maven/' } // Geckolib
// 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.
}
def dataOutput = 'src/main/generated'
loom {
splitEnvironmentSourceSets()
mods {
modid {
sourceSet sourceSets.main
sourceSet sourceSets.client
}
}
runs {
datagen {
//server()
inherit(client)
name "Data Generation"
vmArg "-Dfabric-api.datagen"
vmArg "-Dfabric-api.datagen.output-dir=${file(dataOutput)}"
// vmArg('-Dfabric-api.datagen.strict-validation=true')
runDir "build/datagen"
}
}
accessWidenerPath = file("src/main/resources/mint.accesswidener")
}
sourceSets {
main {
resources {
srcDirs += [
'src/main/generated'
]
}
}
}
def setup(DependencyHandler deps) {
deps.minecraft("com.mojang:minecraft:${project.minecraft_version}")
deps.modImplementation("net.fabricmc:fabric-loader:${project.loader_version}")
deps.mappings("net.fabricmc:yarn:${project.yarn_mappings}:v2")
}
def dependencies(DependencyHandler deps) {
deps.modImplementation("net.fabricmc.fabric-api:fabric-api:${project.fabric_api_version}")
deps.modImplementation("net.fabricmc:fabric-language-kotlin:1.10.18+kotlin.1.9.22")
deps.implementation("org.jetbrains.kotlin:kotlin-stdlib-jdk8:${kotlin_version}")
deps.modImplementation("software.bernie.geckolib:geckolib-fabric-1.20.1:4.2.2")
}
def devEnv(DependencyHandler deps) {
deps.modRuntimeOnly("com.terraformersmc:modmenu:$modmenu_version")
deps.modImplementation(files("libraries/jei/jei-1.20.1-fabric-15.3.0.4.jar")) //From: https://maven.blamejared.com/mezz/jei/
// TODO Fix me or find out if I would be useful \/
//modImplementation("maven.modrinth:cloth-config:$clothconfig_version")
}
def compat(DependencyHandler deps) {
// Datagen counts as a runtime, it's safe to run datagen as long as any mods used in compat are compile only
// REI
deps.modCompileOnly("me.shedaniel:RoughlyEnoughItems-api-fabric:$rei_version")
deps.modCompileOnly("me.shedaniel:RoughlyEnoughItems-default-plugin-fabric:$rei_version")
//BetterEnd
deps.modCompileOnly("maven.modrinth:gc8OEnCC:${betterend_version}")
deps.modCompileOnly("com.github.quiqueck:BCLib:${bclib_version}")
deps.modCompileOnly("com.github.quiqueck:WunderLib:${wunderlib_version}")
// Botania // this doesn't run here with modImpl but it does run in prod. So I'm chill with it.
deps.modCompileOnly("dev.onyxstudios.cardinal-components-api:cardinal-components-base:${cca_version}") // TODO test removing these libraries to see if our botania mixin still works
deps.modCompileOnly("dev.onyxstudios.cardinal-components-api:cardinal-components-entity:${cca_version}")
deps.modCompileOnly("maven.modrinth:trinkets:${trinkets_version}")
deps.modCompileOnly("me.zeroeightsix:fiber:${fiber_version}")
deps.modCompileOnly("com.github.emilyploszaj:step-height-entity-attribute:${step_height_version}")
deps.modCompileOnly("maven.modrinth:patchouli:${patchouli_version}")
deps.modCompileOnly("maven.modrinth:botania:${botania_version}")
// Create - dependencies are added transitively
deps.modCompileOnly("com.simibubi.create:create-fabric-${minecraft_version}:${create_version}")
// Supplementaries
// deps.modRuntimeOnly("maven.modrinth:moonlight:${moonlight_version}")
// deps.modRuntimeOnly("maven.modrinth:supplementaries:${supplementaries_version}")
// deps.modRuntimeOnly("maven.modrinth:dCCkNFwE:${supplementaries_squared_version_id}")
// deps.modRuntimeOnly("maven.modrinth:amendments:${amendments_version}")
// Comforts
// deps.modRuntimeOnly "dev.onyxstudios.cardinal-components-api:cardinal-components-base:${cca_version}"
// deps.modRuntimeOnly "dev.onyxstudios.cardinal-components-api:cardinal-components-entity:${cca_version}"
// deps.modRuntimeOnly("com.illusivesoulworks.spectrelib:spectrelib-fabric:${spectrelib_version}") // { exclude(group = "net.fabricmc.fabric-api") }
// deps.modRuntimeOnly("maven.modrinth:comforts:${comforts_version}")
// BotanyPots
// This way of loading it doesn't work, compat still does in practice though
// deps.modImplementation("net.darkhax.bookshelf:Bookshelf-Fabric-${minecraft_version}:${bookshelf_version}")
// deps.modRuntimeOnly("maven.modrinth:uy4Cnpcm:${bookshelf_version_id}")
// deps.modRuntimeOnly("maven.modrinth:U6BUTZ7K:${botanypots_version_id}")
// Twigs
// deps.modRuntimeOnly("maven.modrinth:twigs:${twigs_version}")
// Dye Depot
// deps.modRuntimeOnly("maven.modrinth:dye-depot:ldJ6vsnR")
// Create Deco
// deps.modLocalRuntime("maven.modrinth:create-deco:${createdeco_version}")
// Biome Makeover // why do things keep only working in prod?? I think its incompatible mappings ain't it. ah well.
// deps.modRuntimeOnly("dev.architectury:architectury-fabric:${architectury_version}")
// deps.modRuntimeOnly("maven.modrinth:architectury-api:${architectury_version}+fabric")
// deps.modRuntimeOnly("maven.modrinth:biome-makeover:${biomemakeover_version}")
// Sleep Tight // yet another mod that only works in production...
// deps.modRuntimeOnly("maven.modrinth:moonlight:${moonlight_version}")
// deps.modRuntimeOnly("maven.modrinth:sleep-tight:${sleeptight_version}")
// Snowy Spirit
// deps.modRuntimeOnly("maven.modrinth:UiFDlI7w:VItD3Q0A")
}
dependencies {
setup(dependencies)
devEnv(dependencies)
include(modImplementation('com.github.Chocohead:Fabric-ASM:v2.3'))
include(implementation(annotationProcessor("io.github.llamalad7:mixinextras-fabric:0.2.2")))
compat(dependencies) // Comment this line out temporarily if genSources isn't working.
dependencies(dependencies)
}
kotlin {
jvmToolchain {
languageVersion.set(JavaLanguageVersion.of(17))
}
jvmToolchain(17)
}
processResources {
// require dependencies to be the version compiled against or newer
Map<String, String> properties = Map.of(
"version", version,
"fabric_loader_version", loader_version,
"fabric_api_version", fabric_api_version,
"create_version", create_version,
"minecraft_version", minecraft_version
)
inputs.properties(properties)
filesMatching("fabric.mod.json") {
expand properties
}
}
java {
// Loom will automatically attach sourcesJar to a RemapSourcesJar task and to the "build" task
// if it is present.
// If you remove this line, sources will not be generated.
withSourcesJar()
sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17
}
jar {
from("LICENSE") {
rename { "${it}_${project.archivesBaseName}"}
}
}
// configure the maven publication
publishing {
publications {
mavenJava(MavenPublication) {
from components.java
}
}
// See https://docs.gradle.org/current/userguide/publishing_maven.html for information on how to set up publishing.
repositories {
// Add repositories to publish to here.
// Notice: This block does NOT have the same function as the block in the top level.
// The repositories here will be used for publishing your artifact, not for
// retrieving dependencies.
}
}