Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sync with FLK 1.12.3, target MC 1.21 #100

Merged
merged 12 commits into from
Oct 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/publish-snapshot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ jobs:
build:
strategy:
matrix:
java: [17]
java: [21]
runs-on: ubuntu-22.04
steps:
- uses: actions/setup-java@v3
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
- uses: actions/setup-java@v3
with:
distribution: "temurin"
java-version: "17"
java-version: "21"
- uses: actions/checkout@v3
- run: chmod +x ./gradlew

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ jobs:
build:
strategy:
matrix:
java: [17]
java: [21]
runs-on: ubuntu-22.04
steps:
- uses: actions/setup-java@v3
Expand Down
27 changes: 13 additions & 14 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import org.jetbrains.dokka.base.DokkaBase
import org.jetbrains.dokka.base.DokkaBaseConfiguration
import org.jetbrains.dokka.gradle.AbstractDokkaLeafTask
import org.jetbrains.dokka.gradle.AbstractDokkaTask
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
import org.jetbrains.kotlin.gradle.dsl.KotlinVersion
import java.time.Year

@Suppress(
Expand Down Expand Up @@ -35,11 +35,12 @@ buildscript {

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

val javaVersion = 17 // The current version of Java used by Minecraft
// 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
val javaVersion = 21 // The current version of Java used by Minecraft

repositories {
mavenCentral()
Expand All @@ -51,8 +52,8 @@ fun DependencyHandlerScope.includeApi(dependency: Any) {
}

dependencies {
includeApi(project(":core", configuration = "namedElements"))
includeApi(project(":library", configuration = "namedElements"))
includeApi(project(":core"))
includeApi(project(":library"))
}

allprojects {
Expand All @@ -78,6 +79,12 @@ allprojects {
kotlin {
// Enable explicit API mode, as this is a library
explicitApi()
jvmToolchain(javaVersion)
compilerOptions {
languageVersion = KotlinVersion.fromVersion(
rootProject.libs.plugins.kotlin.get().version.requiredVersion.substringBeforeLast(".")
)
}
}

tasks {
Expand All @@ -86,19 +93,11 @@ allprojects {
filesMatching("quilt.mod.json") {
expand(
"version" to rootVersion,
"flk_version" to "$flkVersion+kotlin.${project.libs.versions.kotlin.orNull}"
"flk_version" to rootProject.libs.versions.fabric.kotlin.get()
)
}
}

withType<KotlinCompile> {
kotlinOptions {
jvmTarget = javaVersion.toString()
languageVersion =
rootProject.libs.plugins.kotlin.get().version.requiredVersion.substringBeforeLast(".")
}
}

// Every dokka task
withType<AbstractDokkaTask> {
pluginConfiguration<DokkaBase, DokkaBaseConfiguration> {
Expand Down
18 changes: 2 additions & 16 deletions core/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,22 +1,8 @@
fun DependencyHandlerScope.includeApi(dependency: Any) {
api(dependency)
modApi(dependency)
include(dependency)
}

dependencies {
val kotlinVersion = rootProject.libs.versions.kotlin.get()

includeApi(kotlin("stdlib", kotlinVersion))
includeApi(kotlin("stdlib-jdk7", kotlinVersion))
includeApi(kotlin("stdlib-jdk8", kotlinVersion))
includeApi(kotlin("reflect", kotlinVersion))

includeApi(rootProject.libs.coroutines.core)
includeApi(rootProject.libs.coroutines.jvm)
includeApi(rootProject.libs.coroutines.jdk8)
includeApi(rootProject.libs.serialization.core)
includeApi(rootProject.libs.serialization.json)
includeApi(rootProject.libs.serialization.cbor)
includeApi(rootProject.libs.atomic)
includeApi(rootProject.libs.datetime)
includeApi(rootProject.libs.fabric.kotlin)
}
139 changes: 0 additions & 139 deletions core/src/main/kotlin/org/quiltmc/qkl/core/adapter/KotlinAdapter.kt

This file was deleted.

9 changes: 2 additions & 7 deletions core/src/main/resources/quilt.mod.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,17 +23,12 @@
{
"id": "quilt_loader",
"versions": ">=0.23.0"
}
],
"provides": [
},
{
"id": "fabric-language-kotlin",
"version": "${flk_version}"
}
],
"language_adapters": {
"kotlin": "org.quiltmc.qkl.core.adapter.KotlinAdapter"
}
]
},
"modmenu": {
"badges": [
Expand Down
3 changes: 1 addition & 2 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,4 @@ org.gradle.parallel=true
kotlin.incremental=true
kotlin.code.style=official

version=4.0.0
flkVersion=1.10.19
version=5.0.0
36 changes: 13 additions & 23 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
@@ -1,39 +1,29 @@
[versions]
atomic = "0.23.2"
coroutines = "1.8.0"
datetime = "0.5.0"
dokka = "1.9.10"
kotlin = "1.9.23"
minecraft = "1.20.4"
qsl = "8.0.0-alpha.10+1.20.4"
quilt_loader = "0.24.0"
quilt_mappings = "1.20.4+build.3"
serialization = "1.6.3"
serialization_plugin = "1.9.23" # usually same as kotlin but can lag behind
binary_compat_plugin = "0.14.0"
dokka = "1.9.20"
kotlin = "2.0.21"
minecraft = "1.21"
qsl = "10.0.0-alpha.2+1.21.1"
quilt_loader = "0.26.4"
quilt_mappings = "1.21+build.18"
serialization_plugin = "2.0.21" # usually same as kotlin but can lag behind
binary_compat_plugin = "0.16.3"
fabric_kotlin = "1.12.3+kotlin.2.0.21"

[libraries]
atomic = { module = "org.jetbrains.kotlinx:atomicfu-jvm", version.ref = "atomic" }
coroutines_core = { module = "org.jetbrains.kotlinx:kotlinx-coroutines-core", version.ref = "coroutines" }
coroutines_jdk8 = { module = "org.jetbrains.kotlinx:kotlinx-coroutines-jdk8", version.ref = "coroutines" }
coroutines_jvm = { module = "org.jetbrains.kotlinx:kotlinx-coroutines-core-jvm", version.ref = "coroutines" }
datetime = { module = "org.jetbrains.kotlinx:kotlinx-datetime-jvm", version.ref = "datetime" }
dokka_base = { module = "org.jetbrains.dokka:dokka-base", version.ref = "dokka" }
minecraft = { module = "com.mojang:minecraft", version.ref = "minecraft" }
qsl = { module = "org.quiltmc:qsl", version.ref = "qsl" }
quilt_loader = { module = "org.quiltmc:quilt-loader", version.ref = "quilt_loader" }
quilt_mappings = { module = "org.quiltmc:quilt-mappings", version.ref = "quilt_mappings" }
serialization_cbor = { module = "org.jetbrains.kotlinx:kotlinx-serialization-cbor-jvm", version.ref = "serialization" }
serialization_core = { module = "org.jetbrains.kotlinx:kotlinx-serialization-core-jvm", version.ref = "serialization" }
serialization_json = { module = "org.jetbrains.kotlinx:kotlinx-serialization-json-jvm", version.ref = "serialization" }
fabric_kotlin = { module = "net.fabricmc:fabric-language-kotlin", version.ref = "fabric_kotlin" }

[plugins]
detekt = { id = "io.gitlab.arturbosch.detekt", version = "1.23.5" }
detekt = { id = "io.gitlab.arturbosch.detekt", version = "1.23.7" }
dokka = { id = "org.jetbrains.dokka", version.ref = "dokka" }
git_hooks = { id = "com.github.jakemarsden.git-hooks", version = "0.0.2" }
kotlin = { id = "org.jetbrains.kotlin.jvm", version.ref = "kotlin" }
licenser = { id = "dev.yumi.gradle.licenser", version = "1.1.1" }
quilt_loom = { id = "org.quiltmc.loom", version = "1.4.2" }
licenser = { id = "dev.yumi.gradle.licenser", version = "1.2.0" }
quilt_loom = { id = "org.quiltmc.loom", version = "1.7.4" }
serialization = { id = "org.jetbrains.kotlin.plugin.serialization", version.ref = "serialization_plugin" }
binary_compatibility = { id = "org.jetbrains.kotlinx.binary-compatibility-validator", version.ref = "binary_compat_plugin" }
minotaur = { id = "com.modrinth.minotaur", version = "2.8.7" }
Expand Down
Binary file modified gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
4 changes: 2 additions & 2 deletions gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionSha256Sum=9631d53cf3e74bfa726893aee1f8994fee4e060c401335946dba2156f440f24c
distributionUrl=https\://services.gradle.org/distributions/gradle-8.6-bin.zip
distributionSha256Sum=31c55713e40233a8303827ceb42ca48a47267a0ad4bab9177123121e71524c26
distributionUrl=https\://services.gradle.org/distributions/gradle-8.10.2-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
Expand Down
7 changes: 5 additions & 2 deletions gradlew
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@
# See the License for the specific language governing permissions and
# limitations under the License.
#
# SPDX-License-Identifier: Apache-2.0
#

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

# Use the maximum available, or set MAX_FD != -1 to use that value.
MAX_FD=maximum
Expand Down
2 changes: 2 additions & 0 deletions gradlew.bat
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@
@rem See the License for the specific language governing permissions and
@rem limitations under the License.
@rem
@rem SPDX-License-Identifier: Apache-2.0
@rem

@if "%DEBUG%"=="" @echo off
@rem ##########################################################################
Expand Down
Loading
Loading