-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathbuild.gradle.kts
More file actions
132 lines (114 loc) · 3.11 KB
/
build.gradle.kts
File metadata and controls
132 lines (114 loc) · 3.11 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
import com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar
import dev.architectury.pack200.java.Pack200Adapter
import net.fabricmc.loom.task.RemapJarTask
plugins {
idea
java
id("gg.essential.loom") version ("0.10.0.+")
id("dev.architectury.architectury-pack200") version ("0.1.3")
id("com.github.johnrengelman.shadow") version ("7.1.2")
id("net.kyori.blossom") version ("1.3.1")
}
val projectName: String by project
val projectId: String by project
val projectVersion: String by project
val projectGroup: String by project
val mcVersion: String =
property("minecraft.version")?.toString()
?: throw IllegalStateException("minecraft.version is not set.")
version = projectVersion
group = projectGroup
blossom {
replaceToken("@VERSION@", projectVersion)
replaceToken("@NAME@", projectName)
replaceToken("@ID@", projectId)
}
loom {
silentMojangMappingsLicense()
launchConfigs {
getByName("client") {
arg("--tweakClass", "gg.essential.loader.stage0.EssentialSetupTweaker")
arg("-Dfml.coreMods.load", "dev.salmon.betterhurtcam.FMLPlugin")
}
}
forge.pack200Provider.set(Pack200Adapter())
runConfigs.getByName("client").isIdeConfigGenerated = true
}
repositories {
mavenCentral()
maven("https://repo.essential.gg/repository/maven-public/")
}
val shade: Configuration by configurations.creating
configurations.implementation.get().extendsFrom(shade)
dependencies {
minecraft(libs.minecraft)
mappings(libs.mappings)
forge(libs.forge)
shade(libs.essentialwrapper)
implementation(libs.essential)
}
tasks {
processResources {
duplicatesStrategy = DuplicatesStrategy.EXCLUDE
inputs.property("version", projectVersion)
inputs.property("mcversion", mcVersion)
inputs.property("id", projectId)
filesMatching("mcmod.info") {
expand(
"id" to projectId,
"version" to projectVersion,
"mcversion" to mcVersion
)
}
dependsOn(compileJava)
}
named<Jar>("jar") {
archiveBaseName.set(projectName)
duplicatesStrategy = DuplicatesStrategy.EXCLUDE
manifest.attributes.run {
this["Manifest-Version"] = "1.0"
this["FMLCorePlugin"] = "dev.salmon.betterhurtcam.FMLPlugin"
this["ModType"] = "FML"
this["FMLCorePluginContainsFMLMod"] = "true"
this["ForceLoadAsMod"] = "true"
this["TweakOrder"] = "0"
this["TweakClass"] = "gg.essential.loader.stage0.EssentialSetupTweaker"
}
dependsOn(shadowJar)
enabled = false
}
named<RemapJarTask>("remapJar") {
archiveBaseName.set(projectName)
input.set(shadowJar.get().archiveFile)
}
named<ShadowJar>("shadowJar") {
archiveBaseName.set(projectName)
archiveClassifier.set("all-dev")
duplicatesStrategy = DuplicatesStrategy.EXCLUDE
configurations = listOf(shade)
exclude(
"**/LICENSE.md",
"**/LICENSE.txt",
"**/LICENSE",
"**/NOTICE",
"**/NOTICE.txt",
"pack.mcmeta",
"dummyThing",
"**/module-info.class",
"META-INF/proguard/**",
"META-INF/maven/**",
"META-INF/versions/**",
"META-INF/com.android.tools/**",
"fabric.mod.json"
)
mergeServiceFiles()
}
withType<JavaCompile> {
options.encoding = "UTF-8"
}
}
java {
toolchain {
languageVersion.set(JavaLanguageVersion.of(8))
}
}