Skip to content

Commit

Permalink
update scripts to kotlin 2.0
Browse files Browse the repository at this point in the history
  • Loading branch information
rhysdh540 committed May 21, 2024
1 parent ab0299d commit 0896649
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
6 changes: 6 additions & 0 deletions buildSrc/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import org.jetbrains.kotlin.gradle.dsl.KotlinVersion

plugins {
`kotlin-dsl`
}
Expand All @@ -16,6 +18,10 @@ fun DependencyHandler.plugin(id: String, version: String) {
this.implementation(group = id, name = "$id.gradle.plugin", version = version)
}

tasks.compileKotlin {
compilerOptions.languageVersion.set(KotlinVersion.KOTLIN_2_0)
}

dependencies {
plugin("architectury-plugin", "3.4.155")
plugin("dev.architectury.loom", "1.5.391")
Expand Down
7 changes: 4 additions & 3 deletions buildSrc/src/main/kotlin/PlatformPlugin.kt
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import org.gradle.api.Project
import org.gradle.api.artifacts.Configuration
import org.gradle.api.artifacts.ModuleDependency
import org.gradle.api.component.AdhocComponentWithVariants
import org.gradle.api.file.RegularFileProperty
import org.gradle.configurationcache.extensions.capitalized
import org.gradle.jvm.tasks.Jar
import org.gradle.kotlin.dsl.*
Expand All @@ -20,7 +19,9 @@ class PlatformPlugin : Plugin<Project> {

afterEvaluate {
loom.runs {
// remove(getByName("server"))
configureEach {
vmArgs("-XX:+AllowEnhancedClassRedefinition", "-XX:+IgnoreUnrecognizedVMOptions")
}

named("client") {
client()
Expand Down Expand Up @@ -77,7 +78,7 @@ class PlatformPlugin : Plugin<Project> {

tasks.withType<RemapJarTask>()["remapJar"].apply {
dependsOn(shadowJar)
inputFile = shadowJar.archiveFile as RegularFileProperty
inputFile.set(shadowJar.archiveFile)
archiveClassifier = project.name
}

Expand Down

0 comments on commit 0896649

Please sign in to comment.