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

Update Kotlin to 2.1.20 #204

Draft
wants to merge 9 commits into
base: master
Choose a base branch
from
Draft
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
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,9 @@ npm-debug.log.*
*.ear
*.db

# Allow the Gradle Wrapper JAR
!gradle/wrapper/gradle-wrapper.jar

######################
# Windows
######################
Expand Down
2 changes: 0 additions & 2 deletions antlr-kotlin-benchmarks/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
@file:Suppress("UnstableApiUsage")

import com.strumenta.antlrkotlin.gradle.ext.targetsNative
import kotlinx.benchmark.gradle.JvmBenchmarkTarget
import org.gradle.jvm.tasks.Jar
Expand Down
2 changes: 0 additions & 2 deletions antlr-kotlin-runtime/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
@file:Suppress("UnstableApiUsage")

import com.strumenta.antlrkotlin.gradle.ext.setupPom
import com.strumenta.antlrkotlin.gradle.ext.targetsNative
import com.vanniktech.maven.publish.SonatypeHost
Expand Down
2 changes: 0 additions & 2 deletions antlr-kotlin-target/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
@file:Suppress("UnstableApiUsage")

import com.strumenta.antlrkotlin.gradle.ext.setupPom
import com.vanniktech.maven.publish.SonatypeHost

Expand Down
2 changes: 0 additions & 2 deletions antlr-kotlin-tests/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
@file:Suppress("UnstableApiUsage")

import com.strumenta.antlrkotlin.gradle.ext.targetsNative
import org.gradle.jvm.tasks.Jar
import org.jetbrains.kotlin.gradle.tasks.KotlinCompilationTask
Expand Down
4 changes: 1 addition & 3 deletions build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
@file:Suppress("UnstableApiUsage")

import com.strumenta.antlrkotlin.gradle.ext.mavenRepositoryName
import com.strumenta.antlrkotlin.gradle.ext.mavenRepositoryUrl
import org.gradle.api.tasks.testing.logging.TestExceptionFormat
Expand Down Expand Up @@ -44,7 +42,7 @@ release {
buildTasks = listOf(
":antlr-kotlin-runtime:publishAllPublicationsToMavenCentralRepository",
":antlr-kotlin-target:publishAllPublicationsToMavenCentralRepository",
":antlr-kotlin-gradle-plugin:publishPlugins"
":antlr-kotlin-gradle-plugin:publishPlugins",
)

git {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ class StrumentaGradlePluginModulePlugin : Plugin<Project> {
val kotlin = project.kotlinJvmExtension
kotlin.explicitApiWarning()
kotlin.compilerOptions {
apiVersion.set(KotlinVersion.KOTLIN_1_9)
languageVersion.set(KotlinVersion.KOTLIN_1_9)
apiVersion.set(KotlinVersion.KOTLIN_2_1)
languageVersion.set(KotlinVersion.KOTLIN_2_1)

jvmTarget.set(JvmTarget.JVM_1_8)
freeCompilerArgs.add("-Xjvm-default=all")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ class StrumentaJvmLibraryModulePlugin : Plugin<Project> {
val kotlin = project.kotlinJvmExtension
kotlin.explicitApiWarning()
kotlin.compilerOptions {
apiVersion.set(KotlinVersion.KOTLIN_1_9)
languageVersion.set(KotlinVersion.KOTLIN_1_9)
apiVersion.set(KotlinVersion.KOTLIN_2_1)
languageVersion.set(KotlinVersion.KOTLIN_2_1)

jvmTarget.set(JvmTarget.JVM_1_8)
freeCompilerArgs.add("-Xjvm-default=all")
Expand Down
Original file line number Diff line number Diff line change
@@ -1,19 +1,17 @@
package com.strumenta.antlrkotlin.gradle.plugins

import com.strumenta.antlrkotlin.gradle.ext.javaExtension
import com.strumenta.antlrkotlin.gradle.ext.kmpExtension
import com.strumenta.antlrkotlin.gradle.ext.releaseBuild
import org.gradle.api.Action
import org.gradle.api.JavaVersion
import org.gradle.api.Project
import org.gradle.api.provider.Property
import org.gradle.api.tasks.Nested
import org.gradle.internal.os.OperatingSystem
import org.gradle.kotlin.dsl.withType
import org.jetbrains.kotlin.gradle.ExperimentalWasmDsl
import org.jetbrains.kotlin.gradle.dsl.JvmTarget
import org.jetbrains.kotlin.gradle.plugin.KotlinJsCompilerType
import org.jetbrains.kotlin.gradle.plugin.mpp.KotlinNativeTargetWithHostTests
import org.jetbrains.kotlin.gradle.targets.js.dsl.ExperimentalWasmDsl
import org.jetbrains.kotlin.gradle.tasks.Kotlin2JsCompile

/**
Expand All @@ -27,7 +25,7 @@ abstract class StrumentaMultiplatformModuleExtension(private val project: Projec
}

interface JvmConfiguration {
val enableJava: Property<Boolean>
//
}

interface NativeConfiguration {
Expand Down Expand Up @@ -92,11 +90,6 @@ abstract class StrumentaMultiplatformModuleExtension(private val project: Projec
kmpExtension.wasmJs {
nodejs {
testTask {
useMocha {
// Override default 2s timeout
timeout = "${testsTimeout}s"
}

filter.isFailOnNoMatchingTests = true
}
}
Expand All @@ -113,9 +106,6 @@ abstract class StrumentaMultiplatformModuleExtension(private val project: Projec
}
}
}

// Enable WASM optimizations
applyBinaryen()
}

// Necessary as we are using dependsOn explicitly.
Expand Down Expand Up @@ -156,14 +146,6 @@ abstract class StrumentaMultiplatformModuleExtension(private val project: Projec

val isRelease = project.releaseBuild()
project.kmpExtension.jvm {
if (jvmConfig.enableJava.getOrElse(false)) {
withJava()

val java = project.javaExtension
java.targetCompatibility = JavaVersion.VERSION_1_8
java.sourceCompatibility = JavaVersion.VERSION_1_8
}

compilations.configureEach {
compileTaskProvider.configure {
compilerOptions {
Expand Down Expand Up @@ -191,11 +173,6 @@ abstract class StrumentaMultiplatformModuleExtension(private val project: Projec
project.kmpExtension.wasmWasi {
nodejs {
testTask {
useMocha {
// Override default 2s timeout
timeout = "30s"
}

filter.isFailOnNoMatchingTests = true
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import org.gradle.api.Plugin
import org.gradle.api.Project
import org.gradle.kotlin.dsl.apply
import org.gradle.kotlin.dsl.create
import org.jetbrains.kotlin.gradle.ExperimentalKotlinGradlePluginApi
import org.jetbrains.kotlin.gradle.dsl.KotlinVersion
import org.jetbrains.kotlin.gradle.plugin.KotlinMultiplatformPluginWrapper
import org.jetbrains.kotlin.gradle.targets.js.yarn.yarn
Expand All @@ -16,7 +15,6 @@ import org.jetbrains.kotlin.gradle.targets.js.yarn.yarn
* @see StrumentaMultiplatformModuleExtension
*/
class StrumentaMultiplatformModulePlugin : Plugin<Project> {
@OptIn(ExperimentalKotlinGradlePluginApi::class)
override fun apply(project: Project) {
// Apply the required plugins
project.apply<KotlinMultiplatformPluginWrapper>()
Expand All @@ -37,8 +35,8 @@ class StrumentaMultiplatformModulePlugin : Plugin<Project> {
val kmp = project.kmpExtension
kmp.explicitApiWarning()
kmp.compilerOptions {
apiVersion.set(KotlinVersion.KOTLIN_1_9)
languageVersion.set(KotlinVersion.KOTLIN_1_9)
apiVersion.set(KotlinVersion.KOTLIN_2_1)
languageVersion.set(KotlinVersion.KOTLIN_2_1)
freeCompilerArgs.add("-Xexpect-actual-classes")
}
}
Expand Down
7 changes: 1 addition & 6 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,12 @@
org.gradle.jvmargs = -Xmx4g -XX:MaxMetaspaceSize=1g -Dfile.encoding=UTF-8
org.gradle.parallel = true
org.gradle.caching = true
org.gradle.configuration-cache = true

#########################
# Kotlin settings
#########################
kotlin.code.style = official
kotlin.experimental.tryK2 = false

# Kotlin/JS
kotlin.js.compiler = ir
kotlin.incremental.js = true

#########################
# Project settings
Expand All @@ -24,6 +20,5 @@ target.is.native = true
# Publish to a private repository
repo.snapshot.name =
repo.snapshot.url =

repo.release.name =
repo.release.url =
17 changes: 7 additions & 10 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
[versions]
kotlin = "1.9.24"
kotlin = "2.1.20-Beta1"
kotlin-wrappers = "1.0.0-pre.748"
kotlinx-io = "0.3.4"
kotlinx-benchmark = "0.4.10"
kotlinx-resources = "0.4.2"
kotlinx-io = "0.6.0"
kotlinx-benchmark = "0.4.13"
kotlinx-resources = "0.10.0"
antlr4 = "4.13.1"
dokka = "1.9.20"
researchgate-release = "3.0.2"
maven-publish = "0.28.0"
gradle-plugin-publish = "1.2.1"
researchgate-release = "3.1.0"
maven-publish = "0.30.0"
gradle-plugin-publish = "1.3.0"

[libraries]
kotlin-wrappers-bom = { group = "org.jetbrains.kotlin-wrappers", name = "kotlin-wrappers-bom", version.ref = "kotlin-wrappers" }
Expand All @@ -26,10 +26,7 @@ maven-publish-plugin = { group = "com.vanniktech", name = "gradle-maven-publish-
gradle-plugin-publish-plugin = { group = "com.gradle.publish", name = "plugin-publish-plugin", version.ref = "gradle-plugin-publish" }

[plugins]
kotlin-jvm = { id = "org.jetbrains.kotlin.jvm", version.ref = "kotlin" }
kotlin-multiplatform = { id = "org.jetbrains.kotlin.multiplatform", version.ref = "kotlin" }
kotlin-allopen = { id = "org.jetbrains.kotlin.plugin.allopen", version.ref = "kotlin" }
kotlinx-benchmark = { id = "org.jetbrains.kotlinx.benchmark", version.ref = "kotlinx-benchmark" }
kotlinx-resources = { id = "com.goncalossilva.resources", version.ref = "kotlinx-resources" }
researchgate-release = { id = "net.researchgate.release", version.ref = "researchgate-release" }
dokka = { id = "org.jetbrains.dokka", version.ref = "dokka" }
Binary file modified gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.8-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.12-all.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
Expand Down
4 changes: 3 additions & 1 deletion 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 @@ -84,7 +86,7 @@ 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\n' "$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