Skip to content

Commit 92b3f32

Browse files
committed
Kotlin Gradle DSL go brr.
1 parent b7780a1 commit 92b3f32

File tree

4 files changed

+123
-96
lines changed

4 files changed

+123
-96
lines changed

build.gradle

Lines changed: 0 additions & 81 deletions
This file was deleted.

build.gradle.kts

Lines changed: 106 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,106 @@
1+
plugins {
2+
id("java")
3+
id("xyz.wagyourtail.unimined") version "1.4.1"
4+
}
5+
6+
7+
val groupName: String by project
8+
val version: String by project
9+
val modName: String by project
10+
val modId = modName.lowercase()
11+
12+
project.version = version
13+
project.group = "$groupName.$modId"
14+
base.archivesName = modName
15+
val loadingPlugin = "$group.${modName}LoadingPlugin"
16+
17+
tasks.withType<JavaCompile>().configureEach {
18+
options.release = 8
19+
}
20+
21+
val jarLibs: Configuration by configurations.creating {
22+
configurations.implementation.get().extendsFrom(this)
23+
}
24+
repositories {
25+
unimined.wagYourMaven("releases")
26+
unimined.spongeMaven()
27+
unimined.curseMaven()
28+
flatDir { dir(file("libs")); content { includeGroup("extra-mods") } }
29+
mavenCentral()
30+
}
31+
32+
unimined.minecraft {
33+
version("1.12.2")
34+
mappings {
35+
searge()
36+
mcp("stable", "39-1.12")
37+
}
38+
39+
minecraftForge {
40+
loader("14.23.5.2860")
41+
mixinConfig(
42+
"mixins.$modId.json",
43+
"mixins.$modId.chunk_display.json",
44+
"mixins.$modId.clientcommands.json",
45+
"mixins.$modId.nothirium.json",
46+
"mixins.$modId.optifine.json"
47+
)
48+
accessTransformer(file("src/main/resources/at.conf"))
49+
}
50+
51+
runs.config("client") {
52+
systemProperty("fml.coreMods.load", loadingPlugin)
53+
systemProperty("mixin.debug.export", "true")
54+
systemProperty("mixin.debug.verbose", "true")
55+
}
56+
57+
runs.config("server") {
58+
enabled = false
59+
}
60+
}
61+
62+
dependencies {
63+
implementation("org.spongepowered:mixin:0.8.7")
64+
"modImplementation"("curse.maven:renderlib-624967:4168831")
65+
66+
// runtime remapping at home - stolen from embeddedt
67+
for (extraModJar in fileTree(mapOf("dir" to "libs", "include" to "*.jar"))) {
68+
val basename = extraModJar.name.substring(0, extraModJar.name.length - ".jar".length)
69+
val versionSep = basename.lastIndexOf("-")
70+
assert(versionSep != -1)
71+
val artifactId = basename.take(versionSep)
72+
val version = basename.substring(versionSep + 1)
73+
"modImplementation"("extra-mods:$artifactId:$version")
74+
}
75+
}
76+
77+
tasks {
78+
jar {
79+
manifest.attributes(
80+
mapOf(
81+
"TweakClass" to "org.spongepowered.asm.launch.MixinTweaker",
82+
"FMLCorePluginContainsFMLMod" to true,
83+
"FMLCorePlugin" to loadingPlugin,
84+
"ForceLoadAsMod" to true,
85+
)
86+
)
87+
88+
from(jarLibs.map { if (it.isDirectory()) it else zipTree(it) }) {
89+
exclude("META-INF/*.RSA", "META-INF/*.SF", "META-INF/*.DSA")
90+
}
91+
}
92+
93+
processResources {
94+
duplicatesStrategy = DuplicatesStrategy.INCLUDE
95+
inputs.property("version", project.version)
96+
97+
filesMatching("mcmod.info") {
98+
expand("version" to project.version)
99+
}
100+
}
101+
102+
withType<JavaExec>().configureEach {
103+
environment("LD_LIBRARY_PATH", "${System.getenv("LD_LIBRARY_PATH").orEmpty()}:/run/current-system/sw/lib")
104+
environment("__GL_THREADED_OPTIMIZATIONS", "0")
105+
}
106+
}

settings.gradle

Lines changed: 0 additions & 15 deletions
This file was deleted.

settings.gradle.kts

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
pluginManagement {
2+
repositories {
3+
mavenCentral()
4+
maven("https://maven.neoforged.net/releases")
5+
maven("https://maven.minecraftforge.net/")
6+
maven("https://maven.fabricmc.net/")
7+
maven("https://maven.wagyourtail.xyz/releases")
8+
maven("https://maven.wagyourtail.xyz/snapshots")
9+
gradlePluginPortal {
10+
content {
11+
excludeGroup("org.apache.logging.log4j")
12+
}
13+
}
14+
}
15+
}
16+
17+
rootProject.name = "CutelessMod"

0 commit comments

Comments
 (0)