Skip to content

Commit 4dc2624

Browse files
committed
Update buildscripts
1 parent e9ad21c commit 4dc2624

File tree

7 files changed

+45
-27
lines changed

7 files changed

+45
-27
lines changed

build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ subprojects {
129129
}
130130

131131
String versionChangelog() {
132-
List<String> lines = rootProject.file("CHANGELOG.md").readLines()
132+
List<String> lines = rootProject.file("changelog.md").readLines()
133133
StringBuilder builder = new StringBuilder()
134134
if ("${mod_version}" == lines.get(2).substring(3)) {
135135
for (int i = 4; i < lines.size(); i++) {

buildSrc/src/main/groovy/multiloader-common.gradle

Lines changed: 29 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -16,32 +16,38 @@ java {
1616
repositories {
1717
mavenCentral()
1818
// https://docs.gradle.org/current/userguide/declaring_repositories.html#declaring_content_exclusively_found_in_one_repository
19+
// Mixin
1920
exclusiveContent {
2021
forRepository {
2122
maven {
2223
name = "Sponge"
2324
url = "https://repo.spongepowered.org/repository/maven-public"
2425
}
2526
}
26-
filter { includeGroupAndSubgroups("org.spongepowered") }
27+
filter {
28+
includeGroupAndSubgroups("org.spongepowered")
29+
}
2730
}
31+
// Parchment
2832
exclusiveContent {
2933
forRepositories(
30-
maven {
31-
name = "ParchmentMC"
32-
url = "https://maven.parchmentmc.org"
33-
},
34-
maven {
35-
name = "NeoForge"
36-
url = "https://maven.neoforged.net/releases"
37-
}
34+
maven {
35+
name = "ParchmentMC"
36+
url = "https://maven.parchmentmc.org"
37+
},
38+
maven {
39+
name = "NeoForge"
40+
url = "https://maven.neoforged.net/releases"
41+
}
3842
)
3943
filter { includeGroup("org.parchmentmc.data") }
4044
}
45+
// Mods
4146
maven {
4247
name = "Modrinth"
4348
url = "https://api.modrinth.com/maven"
4449
}
50+
// Cloth Config
4551
maven {
4652
name = "Shedaniel"
4753
url = "https://maven.shedaniel.me"
@@ -52,6 +58,7 @@ repositories {
5258
// Read more about capabilities here: https://docs.gradle.org/current/userguide/component_capabilities.html#sec:declaring-additional-capabilities-for-a-local-component
5359
["apiElements", "runtimeElements", "sourcesElements", /*"javadocElements"*/].each { variant ->
5460
configurations."$variant".outgoing {
61+
capability("$group:${project.name}:$version")
5562
capability("$group:${base.archivesName.get()}:$version")
5663
capability("$group:$mod_id-${project.name}-${minecraft_version}:$version")
5764
capability("$group:$mod_id:$version")
@@ -63,13 +70,13 @@ repositories {
6370

6471
sourcesJar {
6572
from(rootProject.file("LICENSE.txt")) {
66-
rename { "${it}_${mod_name}" }
73+
rename { "LICENSE_${mod_id}.txt" }
6774
}
6875
}
6976

7077
jar {
7178
from(rootProject.file("LICENSE.txt")) {
72-
rename { "${it}_${mod_name}" }
79+
rename { "LICENSE_${mod_id}.txt" }
7380
}
7481

7582
manifest {
@@ -126,9 +133,19 @@ processResources {
126133
"clothconfig_versions_neoforge": clothconfig_versions_neoforge,
127134
"modmenu_versions_fabric_list": asJsonList(modmenu_versions_fabric),
128135
]
129-
filesMatching(["pack.mcmeta", "*.mod.json", "META-INF/*mods.toml", "*.mixins.json"]) {
136+
137+
var jsonExpandProps = expandProps.collectEntries {
138+
key, value -> [(key): value instanceof String ? value.replace("\n", "\\\\n") : value]
139+
}
140+
141+
filesMatching(["pack.mcmeta", "*.mod.json", "*.mixins.json"]) {
142+
expand jsonExpandProps
143+
}
144+
145+
filesMatching(["META-INF/*.toml"]) {
130146
expand expandProps
131147
}
148+
132149
inputs.properties(expandProps)
133150
}
134151

File renamed without changes.

common/build.gradle

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,17 +4,17 @@ plugins {
44
}
55

66
dependencies {
7+
// Mixin and MixinExtras
78
compileOnly("org.spongepowered:mixin:${mixin_version}")
89
compileOnly(annotationProcessor("io.github.llamalad7:mixinextras-common:${mixinextras_version}"))
9-
10+
1011
// Cloth Config API
1112
api("me.shedaniel.cloth:cloth-config-neoforge:${clothconfig_version}")
1213
}
1314

1415
neoForge {
1516
version = neoforge_version // Shut up
1617
neoFormVersion = neoform_version
17-
// Automatically enable AccessTransformers if the file exists
1818
def at = file("src/main/resources/META-INF/accesstransformer.cfg")
1919
if (at.exists()) accessTransformers.from(at.absolutePath)
2020
parchment {

fabric/build.gradle

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,20 +10,21 @@ dependencies {
1010
parchment("org.parchmentmc.data:parchment-${parchment_minecraft_version}:${parchment_version}@zip")
1111
}
1212

13-
// Fabric loader and API
13+
// Fabric Loader and API
1414
modImplementation("net.fabricmc:fabric-loader:${fabric_loader_version}")
1515
modImplementation("net.fabricmc.fabric-api:fabric-api:${fabric_api_version}")
1616

17-
// JiJ MixinExtras
17+
// JiJ MixinExtras if required to be newer than minimum loader-provided version
18+
// 0.4.1 since 0.16.8
1819
include(implementation(annotationProcessor("io.github.llamalad7:mixinextras-fabric:${mixinextras_version}")))
19-
20+
21+
// ModMenu
22+
modImplementation("maven.modrinth:mOgUt4GM:${modmenu_version}")
23+
2024
// Cloth Config API
2125
modApi("me.shedaniel.cloth:cloth-config-fabric:${clothconfig_version}") {
2226
exclude(group: "net.fabricmc.fabric-api")
2327
}
24-
25-
// ModMenu
26-
modImplementation("maven.modrinth:mOgUt4GM:${modmenu_version}")
2728
}
2829

2930
loom {

gradle.properties

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,8 @@ java_versions_neoforge=[21,)
2828

2929
# Minecraft
3030
minecraft_version=1.21
31-
minecraft_versions_fabric=>1.20.6 <1.22
32-
minecraft_versions_neoforge=(1.20.6, 1.22)
31+
minecraft_versions_fabric=>1.20.6 <1.21.2
32+
minecraft_versions_neoforge=(1.20.6, 1.21.2)
3333

3434
# Parchment https://parchmentmc.org/docs/getting-started#choose-a-version
3535
parchment_minecraft_version=1.21

neoforge/build.gradle

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,16 +4,16 @@ plugins {
44
}
55

66
dependencies {
7-
// JiJ MixinExtras
7+
// JiJ MixinExtras if required to be newer than minimum loader-provided version
8+
// 0.4.1 since 21.1.22
89
implementation(jarJar("io.github.llamalad7:mixinextras-neoforge:${mixinextras_version}"))
9-
10+
1011
// Cloth Config API
1112
api("me.shedaniel.cloth:cloth-config-neoforge:${clothconfig_version}")
1213
}
1314

1415
neoForge {
1516
version = neoforge_version
16-
// Automatically enable neoforge AccessTransformers if the file exists
1717
def at = project(":common").file("src/main/resources/META-INF/accesstransformer.cfg")
1818
if (at.exists()) accessTransformers.from(at.absolutePath)
1919
parchment {
@@ -23,7 +23,7 @@ neoForge {
2323
runs {
2424
configureEach {
2525
systemProperty("neoforge.enabledGameTestNamespaces", "${mod_id}")
26-
// Unify the run config names with fabric
26+
// Unify the run config names with Fabric
2727
ideName = "NeoForge ${it.name.capitalize()} (${project.path})"
2828
}
2929
client {

0 commit comments

Comments
 (0)