Skip to content

Commit e79adf8

Browse files
Quinn SemelePyrofab
Quinn Semele
andauthored
Sync with FLK 1.12.3, target MC 1.21 (#100)
* Update to 1.21, closes #97 * Update to Kotlin 2.0, closes #96 * Update gradle wrapper. * Apply suggestions from @770grappenmaker. * Match FLK 1.11.0+kotlin.2.0.0 since we're providing Kotlin 2.0.0 * Bump major as api surface has had a minor breaking change. * Update the java versions used by actions. * Bundle FLK 1.12.2, KT 2.0.20, update dependencies. * Update to 1.21.1 QSL which is labelled as compatible with 1.21. * Remove the language adapter in favour of FLK's one. * Add a fallback for Identifier's in blockSettingsOf(lootTableId=) * Update libs. --------- Co-authored-by: Pyrofab <[email protected]>
1 parent 82c9192 commit e79adf8

32 files changed

+161
-294
lines changed

.github/workflows/publish-snapshot.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ jobs:
88
build:
99
strategy:
1010
matrix:
11-
java: [17]
11+
java: [21]
1212
runs-on: ubuntu-22.04
1313
steps:
1414
- uses: actions/setup-java@v3

.github/workflows/publish.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ jobs:
1111
- uses: actions/setup-java@v3
1212
with:
1313
distribution: "temurin"
14-
java-version: "17"
14+
java-version: "21"
1515
- uses: actions/checkout@v3
1616
- run: chmod +x ./gradlew
1717

.github/workflows/push.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ jobs:
55
build:
66
strategy:
77
matrix:
8-
java: [17]
8+
java: [21]
99
runs-on: ubuntu-22.04
1010
steps:
1111
- uses: actions/setup-java@v3

build.gradle.kts

+13-14
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import org.jetbrains.dokka.base.DokkaBase
55
import org.jetbrains.dokka.base.DokkaBaseConfiguration
66
import org.jetbrains.dokka.gradle.AbstractDokkaLeafTask
77
import org.jetbrains.dokka.gradle.AbstractDokkaTask
8-
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
8+
import org.jetbrains.kotlin.gradle.dsl.KotlinVersion
99
import java.time.Year
1010

1111
@Suppress(
@@ -35,11 +35,12 @@ buildscript {
3535

3636
group = "org.quiltmc"
3737
val rootVersion = project.version
38-
val flkVersion: String by project
38+
val flkVersion = rootProject.libs.versions.fabric.kotlin.get().substringBefore('+')
3939
version = "${project.version}+kt.${project.libs.versions.kotlin.orNull}+flk.$flkVersion"
4040
val projectVersion = project.version as String + if (System.getenv("SNAPSHOTS_URL") != null && System.getenv("MAVEN_URL") == null) "-SNAPSHOT" else ""
4141

42-
val javaVersion = 17 // The current version of Java used by Minecraft
42+
// 8 <= 1.17-alpha.21.18.a, 16 >= 1.17-alpha.21.19.a, 17 >= 1.18-beta.2, 21 >= 1.20.5-alpha.24.14.a
43+
val javaVersion = 21 // The current version of Java used by Minecraft
4344

4445
repositories {
4546
mavenCentral()
@@ -51,8 +52,8 @@ fun DependencyHandlerScope.includeApi(dependency: Any) {
5152
}
5253

5354
dependencies {
54-
includeApi(project(":core", configuration = "namedElements"))
55-
includeApi(project(":library", configuration = "namedElements"))
55+
includeApi(project(":core"))
56+
includeApi(project(":library"))
5657
}
5758

5859
allprojects {
@@ -78,6 +79,12 @@ allprojects {
7879
kotlin {
7980
// Enable explicit API mode, as this is a library
8081
explicitApi()
82+
jvmToolchain(javaVersion)
83+
compilerOptions {
84+
languageVersion = KotlinVersion.fromVersion(
85+
rootProject.libs.plugins.kotlin.get().version.requiredVersion.substringBeforeLast(".")
86+
)
87+
}
8188
}
8289

8390
tasks {
@@ -86,19 +93,11 @@ allprojects {
8693
filesMatching("quilt.mod.json") {
8794
expand(
8895
"version" to rootVersion,
89-
"flk_version" to "$flkVersion+kotlin.${project.libs.versions.kotlin.orNull}"
96+
"flk_version" to rootProject.libs.versions.fabric.kotlin.get()
9097
)
9198
}
9299
}
93100

94-
withType<KotlinCompile> {
95-
kotlinOptions {
96-
jvmTarget = javaVersion.toString()
97-
languageVersion =
98-
rootProject.libs.plugins.kotlin.get().version.requiredVersion.substringBeforeLast(".")
99-
}
100-
}
101-
102101
// Every dokka task
103102
withType<AbstractDokkaTask> {
104103
pluginConfiguration<DokkaBase, DokkaBaseConfiguration> {

core/build.gradle.kts

+2-16
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,8 @@
11
fun DependencyHandlerScope.includeApi(dependency: Any) {
2-
api(dependency)
2+
modApi(dependency)
33
include(dependency)
44
}
55

66
dependencies {
7-
val kotlinVersion = rootProject.libs.versions.kotlin.get()
8-
9-
includeApi(kotlin("stdlib", kotlinVersion))
10-
includeApi(kotlin("stdlib-jdk7", kotlinVersion))
11-
includeApi(kotlin("stdlib-jdk8", kotlinVersion))
12-
includeApi(kotlin("reflect", kotlinVersion))
13-
14-
includeApi(rootProject.libs.coroutines.core)
15-
includeApi(rootProject.libs.coroutines.jvm)
16-
includeApi(rootProject.libs.coroutines.jdk8)
17-
includeApi(rootProject.libs.serialization.core)
18-
includeApi(rootProject.libs.serialization.json)
19-
includeApi(rootProject.libs.serialization.cbor)
20-
includeApi(rootProject.libs.atomic)
21-
includeApi(rootProject.libs.datetime)
7+
includeApi(rootProject.libs.fabric.kotlin)
228
}

core/src/main/kotlin/org/quiltmc/qkl/core/adapter/KotlinAdapter.kt

-139
This file was deleted.

core/src/main/resources/quilt.mod.json

+2-7
Original file line numberDiff line numberDiff line change
@@ -23,17 +23,12 @@
2323
{
2424
"id": "quilt_loader",
2525
"versions": ">=0.23.0"
26-
}
27-
],
28-
"provides": [
26+
},
2927
{
3028
"id": "fabric-language-kotlin",
3129
"version": "${flk_version}"
3230
}
33-
],
34-
"language_adapters": {
35-
"kotlin": "org.quiltmc.qkl.core.adapter.KotlinAdapter"
36-
}
31+
]
3732
},
3833
"modmenu": {
3934
"badges": [

gradle.properties

+1-2
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,4 @@ org.gradle.parallel=true
55
kotlin.incremental=true
66
kotlin.code.style=official
77

8-
version=4.0.0
9-
flkVersion=1.10.19
8+
version=5.0.0

gradle/libs.versions.toml

+13-23
Original file line numberDiff line numberDiff line change
@@ -1,39 +1,29 @@
11
[versions]
2-
atomic = "0.23.2"
3-
coroutines = "1.8.0"
4-
datetime = "0.5.0"
5-
dokka = "1.9.10"
6-
kotlin = "1.9.23"
7-
minecraft = "1.20.4"
8-
qsl = "8.0.0-alpha.10+1.20.4"
9-
quilt_loader = "0.24.0"
10-
quilt_mappings = "1.20.4+build.3"
11-
serialization = "1.6.3"
12-
serialization_plugin = "1.9.23" # usually same as kotlin but can lag behind
13-
binary_compat_plugin = "0.14.0"
2+
dokka = "1.9.20"
3+
kotlin = "2.0.21"
4+
minecraft = "1.21"
5+
qsl = "10.0.0-alpha.2+1.21.1"
6+
quilt_loader = "0.26.4"
7+
quilt_mappings = "1.21+build.18"
8+
serialization_plugin = "2.0.21" # usually same as kotlin but can lag behind
9+
binary_compat_plugin = "0.16.3"
10+
fabric_kotlin = "1.12.3+kotlin.2.0.21"
1411

1512
[libraries]
16-
atomic = { module = "org.jetbrains.kotlinx:atomicfu-jvm", version.ref = "atomic" }
17-
coroutines_core = { module = "org.jetbrains.kotlinx:kotlinx-coroutines-core", version.ref = "coroutines" }
18-
coroutines_jdk8 = { module = "org.jetbrains.kotlinx:kotlinx-coroutines-jdk8", version.ref = "coroutines" }
19-
coroutines_jvm = { module = "org.jetbrains.kotlinx:kotlinx-coroutines-core-jvm", version.ref = "coroutines" }
20-
datetime = { module = "org.jetbrains.kotlinx:kotlinx-datetime-jvm", version.ref = "datetime" }
2113
dokka_base = { module = "org.jetbrains.dokka:dokka-base", version.ref = "dokka" }
2214
minecraft = { module = "com.mojang:minecraft", version.ref = "minecraft" }
2315
qsl = { module = "org.quiltmc:qsl", version.ref = "qsl" }
2416
quilt_loader = { module = "org.quiltmc:quilt-loader", version.ref = "quilt_loader" }
2517
quilt_mappings = { module = "org.quiltmc:quilt-mappings", version.ref = "quilt_mappings" }
26-
serialization_cbor = { module = "org.jetbrains.kotlinx:kotlinx-serialization-cbor-jvm", version.ref = "serialization" }
27-
serialization_core = { module = "org.jetbrains.kotlinx:kotlinx-serialization-core-jvm", version.ref = "serialization" }
28-
serialization_json = { module = "org.jetbrains.kotlinx:kotlinx-serialization-json-jvm", version.ref = "serialization" }
18+
fabric_kotlin = { module = "net.fabricmc:fabric-language-kotlin", version.ref = "fabric_kotlin" }
2919

3020
[plugins]
31-
detekt = { id = "io.gitlab.arturbosch.detekt", version = "1.23.5" }
21+
detekt = { id = "io.gitlab.arturbosch.detekt", version = "1.23.7" }
3222
dokka = { id = "org.jetbrains.dokka", version.ref = "dokka" }
3323
git_hooks = { id = "com.github.jakemarsden.git-hooks", version = "0.0.2" }
3424
kotlin = { id = "org.jetbrains.kotlin.jvm", version.ref = "kotlin" }
35-
licenser = { id = "dev.yumi.gradle.licenser", version = "1.1.1" }
36-
quilt_loom = { id = "org.quiltmc.loom", version = "1.4.2" }
25+
licenser = { id = "dev.yumi.gradle.licenser", version = "1.2.0" }
26+
quilt_loom = { id = "org.quiltmc.loom", version = "1.7.4" }
3727
serialization = { id = "org.jetbrains.kotlin.plugin.serialization", version.ref = "serialization_plugin" }
3828
binary_compatibility = { id = "org.jetbrains.kotlinx.binary-compatibility-validator", version.ref = "binary_compat_plugin" }
3929
minotaur = { id = "com.modrinth.minotaur", version = "2.8.7" }

gradle/wrapper/gradle-wrapper.jar

121 Bytes
Binary file not shown.

gradle/wrapper/gradle-wrapper.properties

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
distributionBase=GRADLE_USER_HOME
22
distributionPath=wrapper/dists
3-
distributionSha256Sum=9631d53cf3e74bfa726893aee1f8994fee4e060c401335946dba2156f440f24c
4-
distributionUrl=https\://services.gradle.org/distributions/gradle-8.6-bin.zip
3+
distributionSha256Sum=31c55713e40233a8303827ceb42ca48a47267a0ad4bab9177123121e71524c26
4+
distributionUrl=https\://services.gradle.org/distributions/gradle-8.10.2-bin.zip
55
networkTimeout=10000
66
validateDistributionUrl=true
77
zipStoreBase=GRADLE_USER_HOME

gradlew

+5-2
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@
1515
# See the License for the specific language governing permissions and
1616
# limitations under the License.
1717
#
18+
# SPDX-License-Identifier: Apache-2.0
19+
#
1820

1921
##############################################################################
2022
#
@@ -55,7 +57,7 @@
5557
# Darwin, MinGW, and NonStop.
5658
#
5759
# (3) This script is generated from the Groovy template
58-
# https://github.com/gradle/gradle/blob/HEAD/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
60+
# https://github.com/gradle/gradle/blob/HEAD/platforms/jvm/plugins-application/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
5961
# within the Gradle project.
6062
#
6163
# You can find Gradle at https://github.com/gradle/gradle/.
@@ -84,7 +86,8 @@ done
8486
# shellcheck disable=SC2034
8587
APP_BASE_NAME=${0##*/}
8688
# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036)
87-
APP_HOME=$( cd "${APP_HOME:-./}" > /dev/null && pwd -P ) || exit
89+
APP_HOME=$( cd -P "${APP_HOME:-./}" > /dev/null && printf '%s
90+
' "$PWD" ) || exit
8891

8992
# Use the maximum available, or set MAX_FD != -1 to use that value.
9093
MAX_FD=maximum

gradlew.bat

+2
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@
1313
@rem See the License for the specific language governing permissions and
1414
@rem limitations under the License.
1515
@rem
16+
@rem SPDX-License-Identifier: Apache-2.0
17+
@rem
1618

1719
@if "%DEBUG%"=="" @echo off
1820
@rem ##########################################################################

0 commit comments

Comments
 (0)