-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathbuild.gradle.kts
137 lines (116 loc) · 4.71 KB
/
build.gradle.kts
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
@file:Suppress( "UnstableApiUsage", "HasPlatformType")
plugins {
id( "org.quiltmc.loom" ) version "1.+"
id( "org.jetbrains.kotlin.jvm" ) version "1.9.0"
idea
}
repositories {
mavenCentral()
maven( url = "https://server.bbkr.space/artifactory/libs-release" )
maven( url = "https://maven.terraformersmc.com/releases" )
maven( url = "https://repsy.io/mvn/enderzombi102/mc" )
maven( url = "https://maven.ladysnake.org/releases" )
maven( url = "https://aperlambda.github.io/maven" )
maven( url = "https://maven.nucleoid.xyz/" )
maven( url = "https://maven.shedaniel.me" )
maven( url = "https://maven.gudenau.net" )
maven( url = "https://maven.gegy.dev" )
maven( url = "https://jitpack.io" )
exclusiveContent {
forRepository { maven( url = "https://api.modrinth.com/maven" ) }
filter { includeGroup( "maven.modrinth" ) }
}
}
val minecraftVersion = "1.19.2"
val mappingsVersion = "22"
val loaderVersion = "0.21.0"
val floaderVersion = "0.11.6"
val apiVersion = "4.0.0-beta.30+0.76.0"
loom {
runtimeOnlyLog4j.set( true )
val config: net.fabricmc.loom.configuration.ide.RunConfigSettings.() -> Unit = {
runDir = "run"
isIdeConfigGenerated = true
// vmArg( "-javaagent:\"$mixinsJar\"" )
vmArg( "-XX:+AllowEnhancedClassRedefinition" )
vmArg( "-Xmx3G" )
vmArg( "-ea:com.enderzombi102.elysium" )
vmArg( "-Dmixin.debug.export=true" )
vmArg( "-Dlog4j.configurationFile=\"file:///$projectDir/log4j2.xml\"" )
vmArg( "-Dloader.disable_forked_guis=true" )
vmArg( "-Dloader.transform_cache.disable_preload=true" )
vmArg( "-Dloader.transform_cache.disable_optimised_compression=true" )
programArg( "--username=player" )
}
runConfigs.named( "client" ).configure( config )
runConfigs.named( "server" ).configure( config )
}
/*
TODO: Add the following:
- https://modrinth.com/mod/owo-lib ( evaluate )
- https://modrinth.com/mod/notify ( evaluate )
- https://modrinth.com/mod/fzzy-core ( evaluate )
- https://modrinth.com/mod/interference ( evaluate )
- https://modrinth.com/mod/resourceful-lib ( evaluate )
*/
dependencies {
//to change the versions see the gradle.properties file
minecraft( "com.mojang:minecraft:$minecraftVersion" )
mappings( "org.quiltmc:quilt-mappings:$minecraftVersion+build.$mappingsVersion:intermediary-v2" )
modImplementation( "org.quiltmc:quilt-loader:$loaderVersion" )
// Fabric API. This is technically optional, but you probably want it anyway.
modImplementation( "org.quiltmc.quilted-fabric-api:quilted-fabric-api:$apiVersion-$minecraftVersion" )
/* mod dependencies */
modImplementation( "com.terraformersmc:modmenu:4.2.0-beta.2" )
modImplementation( "dev.onyxstudios.cardinal-components-api:cardinal-components-api:5.0.2" )
modImplementation( "dev.emi:trinkets:3.4.1" ) // https://github.com/emilyploszaj/trinkets/wiki
modImplementation( include( "dev.lambdaurora:spruceui:4.1.0+1.19.2" )!! ) // N/D
modImplementation( include( "io.github.cottonmc:LibGui:6.4.0+1.19" )!! ) // https://github.com/CottonMC/LibGui/wiki
modCompileOnly( "dev.emi:emi-fabric:1.0.21+1.19.2:api" ) // https://github.com/emilyploszaj/emi/wiki
modLocalRuntime( "dev.emi:emi-fabric:1.0.21+1.19.2" )
modImplementation( include( "com.github.thedeathlycow:thermoo:v1.4" )!! ) // https://github.com/TheDeathlyCow/thermoo/wiki
modImplementation( "maven.modrinth:patchouli:1.19.2-77-fabric" ) // https://vazkiimods.github.io/Patchouli
modImplementation( include( "eu.pb4:placeholder-api:2.0.0-pre.1+1.19.2" )!! ) // https://placeholders.pb4.eu
modImplementation( include( "com.enderzombi102.EnderLib:minecraft:1.0.0+0.3.3-SNAPSHOT" )!! )
/* lib dependencies */
implementation( include( annotationProcessor( "io.github.llamalad7:mixinextras-fabric:0.2.0" )!! )!! ) // https://github.com/LlamaLad7/MixinExtras/wiki
}
tasks.withType<ProcessResources> {
inputs.property( "version", project.version )
inputs.property( "minecraft_version", minecraftVersion )
inputs.property( "loader_version", floaderVersion )
filteringCharset = "UTF-8"
filesMatching( "fabric.mod.json" ) {
expand(
"version" to version,
"minecraft_version" to minecraftVersion,
"loader_version" to floaderVersion
)
}
}
tasks.withType<JavaCompile> {
options.encoding = "UTF-8"
options.release.set( 17 )
}
tasks.withType<org.jetbrains.kotlin.gradle.tasks.KotlinCompile> {
kotlinOptions.jvmTarget = "17"
kotlinOptions.languageVersion = "1.9"
}
java {
withSourcesJar()
toolchain.languageVersion.set( JavaLanguageVersion.of( 17 ) )
}
tasks.withType<Jar> {
filesMatching( "LICENSE" ) {
rename { "${it}_$archiveBaseName"}
}
}
val cleanLogs by tasks.registering {
description = "Cleans the logs folder"
shouldRunAfter( tasks.runClient )
shouldRunAfter( tasks.runServer )
doFirst {
// delete all logs
file( "run/logs" ).listFiles()?.forEach( File::delete )
}
}