Upgrade to Gradle 8.10, Kotlin 2.0.20, reduce warnings
This commit is contained in:
@@ -5,6 +5,8 @@ import org.gradle.accessors.dm.LibrariesForLibs
|
||||
import org.gradle.api.tasks.testing.logging.TestExceptionFormat
|
||||
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
|
||||
import org.gradle.nativeplatform.platform.internal.DefaultNativePlatform
|
||||
import org.jetbrains.kotlin.gradle.dsl.JvmTarget
|
||||
import org.jetbrains.kotlin.gradle.dsl.KotlinVersion
|
||||
|
||||
val libs = the<LibrariesForLibs>()
|
||||
|
||||
@@ -22,8 +24,6 @@ if (shouldPublish) {
|
||||
apply(plugin = "maven-publish")
|
||||
}
|
||||
|
||||
//apply(plugin = "nebula.release")
|
||||
|
||||
repositories {
|
||||
mavenCentral()
|
||||
mavenLocal()
|
||||
@@ -57,8 +57,6 @@ dependencies {
|
||||
"demoRuntimeOnly"(libs.slf4j.simple)
|
||||
}
|
||||
|
||||
|
||||
|
||||
tasks {
|
||||
@Suppress("UNUSED_VARIABLE")
|
||||
val test by getting(Test::class) {
|
||||
@@ -76,12 +74,14 @@ tasks {
|
||||
addBooleanOption("Xdoclint:none", true)
|
||||
}
|
||||
}
|
||||
withType<KotlinCompile>() {
|
||||
kotlinOptions.jvmTarget = libs.versions.jvmTarget.get()
|
||||
kotlinOptions.apiVersion = libs.versions.kotlinApi.get()
|
||||
kotlinOptions.languageVersion = libs.versions.kotlinLanguage.get()
|
||||
kotlinOptions.freeCompilerArgs += "-Xexpect-actual-classes"
|
||||
kotlinOptions.freeCompilerArgs += "-Xjdk-release=${libs.versions.jvmTarget.get()}"
|
||||
withType<KotlinCompile> {
|
||||
compilerOptions {
|
||||
jvmTarget.set(JvmTarget.valueOf("JVM_${libs.versions.jvmTarget.get()}"))
|
||||
freeCompilerArgs.add("-Xexpect-actual-classes")
|
||||
freeCompilerArgs.add("-Xjdk-release=${libs.versions.jvmTarget.get()}")
|
||||
apiVersion.set(KotlinVersion.valueOf("KOTLIN_${libs.versions.kotlinApi.get().replace(".", "_")}"))
|
||||
languageVersion.set(KotlinVersion.valueOf("KOTLIN_${libs.versions.kotlinApi.get().replace(".", "_")}"))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -4,11 +4,12 @@ import CollectScreenshotsTask
|
||||
import org.gradle.accessors.dm.LibrariesForLibs
|
||||
import org.gradle.api.tasks.testing.logging.TestExceptionFormat
|
||||
import org.gradle.nativeplatform.platform.internal.DefaultNativePlatform
|
||||
import org.jetbrains.kotlin.gradle.ExperimentalKotlinGradlePluginApi
|
||||
import org.jetbrains.kotlin.gradle.dsl.JvmTarget
|
||||
import org.jetbrains.kotlin.gradle.dsl.KotlinCompile
|
||||
import org.jetbrains.kotlin.gradle.dsl.KotlinVersion
|
||||
import org.jetbrains.kotlin.gradle.tasks.KotlinCompilationTask
|
||||
import org.jetbrains.kotlin.gradle.tasks.KotlinJvmCompile
|
||||
|
||||
|
||||
val libs = the<LibrariesForLibs>()
|
||||
|
||||
val shouldPublish = project.name !in setOf("openrndr-demos")
|
||||
@@ -31,14 +32,19 @@ repositories {
|
||||
|
||||
group = "org.openrndr.extra"
|
||||
|
||||
tasks.withType<KotlinCompile<*>> {
|
||||
kotlinOptions.apiVersion = libs.versions.kotlinApi.get()
|
||||
kotlinOptions.languageVersion = libs.versions.kotlinLanguage.get()
|
||||
kotlinOptions.freeCompilerArgs += "-Xexpect-actual-classes"
|
||||
kotlinOptions.freeCompilerArgs += "-Xjdk-release=${libs.versions.jvmTarget.get()}"
|
||||
tasks.withType<KotlinCompilationTask<*>> {
|
||||
compilerOptions {
|
||||
apiVersion.set(KotlinVersion.valueOf("KOTLIN_${libs.versions.kotlinApi.get().replace(".", "_")}"))
|
||||
languageVersion.set(KotlinVersion.valueOf("KOTLIN_${libs.versions.kotlinApi.get().replace(".", "_")}"))
|
||||
freeCompilerArgs.add("-Xexpect-actual-classes")
|
||||
}
|
||||
}
|
||||
|
||||
tasks.withType<KotlinJvmCompile>().configureEach {
|
||||
compilerOptions.jvmTarget.set(JvmTarget.fromTarget(libs.versions.jvmTarget.get()))
|
||||
compilerOptions {
|
||||
jvmTarget.set(JvmTarget.fromTarget(libs.versions.jvmTarget.get()))
|
||||
freeCompilerArgs.add("-Xjdk-release=${libs.versions.jvmTarget.get()}")
|
||||
}
|
||||
}
|
||||
|
||||
kotlin {
|
||||
@@ -46,7 +52,6 @@ kotlin {
|
||||
compilations {
|
||||
val main by getting
|
||||
|
||||
@Suppress("UNUSED_VARIABLE")
|
||||
val demo by creating {
|
||||
associateWith(main)
|
||||
tasks.register<CollectScreenshotsTask>("collectScreenshots") {
|
||||
@@ -74,7 +79,6 @@ kotlin {
|
||||
}
|
||||
|
||||
sourceSets {
|
||||
@Suppress("UNUSED_VARIABLE")
|
||||
val commonMain by getting {
|
||||
dependencies {
|
||||
implementation(libs.kotlin.stdlib)
|
||||
@@ -82,14 +86,12 @@ kotlin {
|
||||
}
|
||||
}
|
||||
|
||||
@Suppress("UNUSED_VARIABLE")
|
||||
val commonTest by getting {
|
||||
dependencies {
|
||||
implementation(libs.kotlin.test)
|
||||
}
|
||||
}
|
||||
|
||||
@Suppress("UNUSED_VARIABLE")
|
||||
val jvmTest by getting {
|
||||
dependencies {
|
||||
runtimeOnly(libs.bundles.jupiter)
|
||||
@@ -97,7 +99,6 @@ kotlin {
|
||||
}
|
||||
}
|
||||
|
||||
@Suppress("UNUSED_VARIABLE")
|
||||
val jvmDemo by getting {
|
||||
dependencies {
|
||||
implementation(libs.openrndr.application)
|
||||
@@ -181,6 +182,7 @@ if (shouldPublish) {
|
||||
}
|
||||
|
||||
kotlin {
|
||||
@OptIn(ExperimentalKotlinGradlePluginApi::class)
|
||||
jvm().mainRun {
|
||||
classpath(kotlin.jvm().compilations.getByName("demo").output.allOutputs)
|
||||
classpath(kotlin.jvm().compilations.getByName("demo").configurations.runtimeDependencyConfiguration!!)
|
||||
|
||||
Reference in New Issue
Block a user