Skip to content

Commit 29e6adf

Browse files
committed
kotlinforforge 4.12 update for Kotlin 2.2.10
* updated the gradle wrapper to 8.14 * updated Kotlin (and friends) to what fabric-language-kotlin version 1.13.5+kotlin.2.2.10 provides * fixed `forge/kfflib/src/test/kotlin/thedarkcolour/kfflibtest/InGameTester.kt` (implementing the *sane* API changes from <MinecraftForge/MinecraftForge@90dafb0>) * ported `forge/kfflib/src/test` to NeoForge * copied nonmclibs configuration to kfflib (to run the tests) * overwrote the `org.jetbrains:annotations` version to fix a JPMS module issue where version 13 and 23+ clashed on the classpath * bumped the version to 4.12.0
1 parent 5c87329 commit 29e6adf

File tree

25 files changed

+750
-88
lines changed

25 files changed

+750
-88
lines changed

build.gradle.kts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ plugins {
44
}
55

66
// maven.repo.local is set within the Julia script in the website branch
7-
tasks.create("publishAllMavens") {
7+
tasks.register("publishAllMavens") {
88
dependsOn(":forge:publishAllMavens")
99
dependsOn(":neoforge:publishAllMavens")
1010
}

buildSrc/src/main/kotlin/kff.combined-conventions.gradle.kts

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -18,17 +18,4 @@ project.tasks.withType<Jar> {
1818
zipTree(project(":neoforge:$subproject").tasks.getByName("jar", Jar::class).archiveFile),
1919
)
2020
})
21-
22-
manifest {
23-
attributes(
24-
"Specification-Title" to "Kotlin for Forge",
25-
"Specification-Vendor" to "Forge",
26-
"Specification-Version" to "1",
27-
"Implementation-Title" to project.name,
28-
"Implementation-Version" to project.version,
29-
"Implementation-Vendor" to "thedarkcolour",
30-
"Implementation-Timestamp" to LocalDateTime.now(),
31-
"Automatic-Module-Name" to "thedarkcolour.kotlinforforge.$subproject",
32-
)
33-
}
34-
}
21+
}

buildSrc/src/main/kotlin/kff.common-conventions.gradle.kts

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
11
import org.jetbrains.kotlin.gradle.dsl.JvmTarget
2-
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
3-
import thedarkcolour.kotlinforforge.plugin.alias
2+
import org.jetbrains.kotlin.gradle.tasks.KotlinJvmCompile
43
import thedarkcolour.kotlinforforge.plugin.getPropertyString
54

6-
project.plugins.apply(JavaPlugin::class)
7-
project.plugins.apply(IdeaPlugin::class)
8-
project.plugins.apply(MavenPublishPlugin::class)
9-
project.plugins.apply(alias("kotlinJvm", project))
5+
plugins {
6+
java
7+
idea
8+
`maven-publish`
9+
kotlin("jvm")
10+
}
1011

1112
val jvmTarget = JvmTarget.JVM_17
1213

@@ -32,7 +33,7 @@ project.tasks {
3233
expand(replacements)
3334
}
3435
}
35-
withType<KotlinCompile> {
36+
withType<KotlinJvmCompile> {
3637
compilerOptions.jvmTarget.set(jvmTarget)
3738
compilerOptions.freeCompilerArgs.set(listOf("-Xexplicit-api=warning", "-Xjvm-default=all"))
3839
}

combined/build.gradle.kts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -113,8 +113,8 @@ modrinth {
113113
loaders.add("neoforge")
114114
uploadFile.provider(project(":combined").tasks.jarJar)
115115
}
116-
tasks.create("publishModPlatforms") {
117-
finalizedBy(tasks.create("printPublishingMessage") {
116+
tasks.register("publishModPlatforms") {
117+
finalizedBy(tasks.register("printPublishingMessage") {
118118
doFirst {
119119
println("Publishing Kotlin for Forge ${getPropertyString("kff_version")} to Modrinth and CurseForge")
120120
}

forge/build.gradle.kts

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import org.jetbrains.kotlin.gradle.dsl.JvmTarget
2-
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
32
import thedarkcolour.kotlinforforge.plugin.getKffMaxVersion
43
import thedarkcolour.kotlinforforge.plugin.getPropertyString
54

@@ -106,15 +105,17 @@ tasks {
106105
}
107106
}
108107

109-
withType<KotlinCompile> {
110-
compilerOptions.jvmTarget.set(JvmTarget.JVM_17)
111-
}
112-
113108
assemble {
114109
dependsOn(jarJar)
115110
}
116111
}
117112

113+
kotlin {
114+
compilerOptions {
115+
jvmTarget = JvmTarget.JVM_17
116+
}
117+
}
118+
118119
publishing {
119120
publications {
120121
register<MavenPublication>("maven") {
@@ -126,9 +127,9 @@ publishing {
126127
}
127128

128129
// maven.repo.local is set within the Julia script in the website branch
129-
tasks.create("publishAllMavens") {
130+
tasks.register("publishAllMavens") {
130131
dependsOn(":forge:publishToMavenLocal")
131132
dependsOn(":forge:kfflib:publishToMavenLocal")
132133
dependsOn(":forge:kfflang:publishToMavenLocal")
133134
dependsOn(":forge:kffmod:publishToMavenLocal")
134-
}
135+
}

forge/kfflang/build.gradle.kts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import net.minecraftforge.gradle.common.util.RunConfig
12
import java.time.LocalDateTime
23

34
plugins {
@@ -12,7 +13,7 @@ minecraft {
1213
copyIdeResources.set(true)
1314

1415
runs {
15-
create("client") {
16+
create("client", Action<RunConfig> {
1617
workingDirectory(project.file("run"))
1718

1819
ideaModule = "KotlinForForge.forge.kfflang.test"
@@ -29,7 +30,7 @@ minecraft {
2930
source(sourceSets.test.get())
3031
}
3132
}
32-
}
33+
})
3334

3435
create("server") {
3536
workingDirectory(project.file("run/server"))

forge/kfflib/build.gradle.kts

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
21
import java.time.LocalDateTime
32

43
plugins {
@@ -118,10 +117,12 @@ tasks {
118117
)
119118
}
120119
}
120+
}
121121

122-
// Only require the lang provider to use explicit visibility modifiers, not the test mod
123-
withType<KotlinCompile> {
124-
kotlinOptions.freeCompilerArgs = listOf("-Xexplicit-api=warning", "-Xjvm-default=all")
122+
kotlin {
123+
compilerOptions {
124+
// Only require the lang provider to use explicit visibility modifiers, not the test mod
125+
freeCompilerArgs = listOf("-Xexplicit-api=warning", "-Xjvm-default=all")
125126
}
126127
}
127128

forge/kfflib/src/test/kotlin/thedarkcolour/kfflibtest/InGameTester.kt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,13 @@ import net.minecraft.gametest.framework.GameTest
44
import net.minecraft.gametest.framework.GameTestAssertException
55
import net.minecraft.gametest.framework.GameTestHelper
66
import net.minecraft.resources.ResourceLocation
7+
import net.minecraftforge.gametest.GameTestDontPrefix
78
import net.minecraftforge.gametest.GameTestHolder
8-
import net.minecraftforge.gametest.PrefixGameTestTemplate
99
import net.minecraftforge.registries.ForgeRegistries
1010

1111
@GameTestHolder(KFFLibTest.ID)
1212
public object InGameTester {
13-
@PrefixGameTestTemplate(false)
13+
@GameTestDontPrefix
1414
@GameTest(template = "dummy")
1515
@JvmStatic
1616
public fun testBlock(helper: GameTestHelper) {
@@ -20,4 +20,4 @@ public object InGameTester {
2020
}
2121
}
2222
}
23-
}
23+
}

gradle.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,4 +15,4 @@ forge_version=49.0.8
1515
min_neo_version = 20.2.3-beta
1616
neo_version = 20.4.22-beta
1717

18-
kff_version=4.11.0
18+
kff_version=4.12.0

gradle/libs.versions.toml

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
[versions]
2-
kotlin = "2.0.0"
3-
coroutines = "1.8.1"
4-
serialization = "1.6.3"
2+
jba = "23.0.0"
3+
kotlin = "2.2.10"
4+
coroutines = "1.10.2"
5+
serialization = "1.9.0"
56
neogradle = "7.0.138"
67
neoforge = "20.4.22-beta"
78
forgegradle = "6.0.25"
@@ -28,4 +29,4 @@ kotlinJvm = { id = "org.jetbrains.kotlin.jvm", version.ref = "kotlin" }
2829
neogradle = { id = "net.neoforged.gradle.userdev", version.ref = "neogradle" }
2930
forgegradle = { id = "net.minecraftforge.gradle", version.ref = "forgegradle" }
3031
minotaur = { id = "com.modrinth.minotaur", version.ref = "minotaur" }
31-
cursegradle = { id = "com.matthewprenger.cursegradle", version.ref = "cursegradle" }
32+
cursegradle = { id = "com.matthewprenger.cursegradle", version.ref = "cursegradle" }

0 commit comments

Comments
 (0)