Skip to content

Commit 31f6a81

Browse files
committed
kotlin kotlin kotlin kotlin kotlin kotlin kotlin kotlin
1 parent 2e2de70 commit 31f6a81

9 files changed

+580
-568
lines changed

build.gradle

-108
This file was deleted.

build.gradle.kts

+109
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,109 @@
1+
import net.fabricmc.loom.api.LoomGradleExtensionAPI
2+
3+
plugins {
4+
java
5+
id("architectury-plugin") version "3.4-SNAPSHOT"
6+
id("dev.architectury.loom") version "1.4.+" apply false
7+
id("me.modmuss50.mod-publish-plugin") version "0.3.4" apply false // https://github.com/modmuss50/mod-publish-plugin
8+
id("dev.ithundxr.silk") version "0.11.15" // https://github.com/IThundxr/silk
9+
}
10+
11+
architectury {
12+
minecraft = "minecraft_version"()
13+
}
14+
15+
subprojects {
16+
apply(plugin = "dev.architectury.loom")
17+
18+
repositories {
19+
mavenCentral()
20+
maven { url = uri("https://maven.shedaniel.me/") } // Cloth Config, REI
21+
maven { url = uri("https://maven.blamejared.com/") } // JEI, Hex Casting
22+
maven { url = uri("https://maven.parchmentmc.org") } // Parchment mappings
23+
maven { url = uri("https://maven.quiltmc.org/repository/release") } // Quilt Mappings
24+
maven { url = uri("https://jm.gserv.me/repository/maven-public/") } // JourneyMap API
25+
maven { url = uri("https://api.modrinth.com/maven") } // LazyDFU, JourneyMap
26+
maven { // Flywheel
27+
url = uri("https://maven.tterrag.com/")
28+
content {
29+
// need to be specific here due to version overlaps
30+
includeGroup("com.jozufozu.flywheel")
31+
}
32+
}
33+
maven { // Extended Bogeys
34+
url = uri("https://maven.ithundxr.dev/private")
35+
content { includeGroup("com.rabbitminers") }
36+
credentials {
37+
if (System.getenv("GITHUB_RUN_NUMBER") != null) {
38+
username = "railways-github"
39+
password = System.getenv("MAVEN_TOKEN")
40+
} else {
41+
username = findProperty("IThundxrMavenUsername").toString()
42+
password = findProperty("IThundxrMavenPassword").toString()
43+
}
44+
}
45+
}
46+
maven { url = uri("https://maven.maxhenkel.de/repository/public") } // Simple Voice Chat
47+
}
48+
49+
val loom = project.extensions.getByName<LoomGradleExtensionAPI>("loom")
50+
51+
// loom {
52+
// silentMojangMappingsLicense()
53+
// runs.configureEach {
54+
// vmArg("-Dmixin.debug.export=true")
55+
// vmArg("-Dmixin.env.remapRefMap=true")
56+
// vmArg("-Dmixin.env.refMapRemappingFile=${projectDir}/build/createSrgToMcp/output.srg")
57+
// }
58+
// }
59+
60+
dependencies {
61+
"minecraft"("com.mojang:minecraft:${"minecraft_version"()}")
62+
// layered mappings - Mojmap names, parchment and QM docs and parameters
63+
"mappings"(loom.layered {
64+
mappings("org.quiltmc:quilt-mappings:${"minecraft_version"()}+build.${"qm_version"()}:intermediary-v2")
65+
parchment("org.parchmentmc.data:parchment-${"minecraft_version"()}:${"parchment_version"()}@zip")
66+
officialMojangMappings { nameSyntheticMembers = false }
67+
})
68+
}
69+
70+
tasks.register<Copy>("moveBuiltJars") {
71+
if (project.path != ":common") {
72+
val remapJar by project.tasks.named<Jar>("remapJar")
73+
dependsOn(remapJar)
74+
from(remapJar)
75+
}
76+
77+
into(rootProject.file("jars"))
78+
}
79+
}
80+
81+
allprojects {
82+
apply(plugin = "java")
83+
apply(plugin = "architectury-plugin")
84+
apply(plugin = "maven-publish")
85+
86+
base.archivesName.set("archives_base_name"())
87+
group = "maven_group"()
88+
89+
// Formats the mod version to include the loader, Minecraft version, and build number (if present)
90+
// example: 1.0.0+fabric-1.19.2-build.100 (or -local)
91+
val isRelease: Boolean = System.getenv("RELEASE_BUILD")?.toBoolean() == true
92+
val buildNumber = System.getenv("GITHUB_RUN_NUMBER")
93+
val build = if (buildNumber != null) "build.${buildNumber}" else "local"
94+
95+
version = "${"mod_version"()}+${project.name}-mc${"minecraft_version"()}" + ( if (isRelease) "" else "-${build}")
96+
97+
tasks.withType<JavaCompile>().configureEach {
98+
options.encoding = "UTF-8"
99+
}
100+
101+
java {
102+
withSourcesJar()
103+
}
104+
}
105+
106+
operator fun String.invoke(): String {
107+
return rootProject.ext[this] as? String
108+
?: throw IllegalStateException("Property $this is not defined")
109+
}

common/build.gradle

-112
This file was deleted.

0 commit comments

Comments
 (0)