diff --git a/.github/workflows/CODECOV.yml b/.github/workflows/CODECOV.yml index ed29d9d..08a5cc7 100644 --- a/.github/workflows/CODECOV.yml +++ b/.github/workflows/CODECOV.yml @@ -29,7 +29,7 @@ jobs: - { name: Set up JDK, uses: actions/setup-java@v4, with: { distribution: "${{ env.JAVA_DISTRIBUTION }}", java-version: "${{ env.JAVA_VERSION }}" } } - { name: Prepare Gradle, uses: gradle/actions/setup-gradle@d9c87d481d55275bb5441eef3fe0e46805f9ef70 } # https://github.com/gradle/actions/releases/tag/v3.5.0 - { name: Start gradle, run: ./gradlew } - - { name: Code coverage, run: ./gradlew koverXmlReportJvm } + - { name: Code coverage, run: ./gradlew koverXmlReport } - name: Upload coverage reports to Codecov uses: codecov/codecov-action@v4.0.1 with: diff --git a/.github/workflows/TEST.yml b/.github/workflows/TEST.yml index 4e5caa9..56feda5 100644 --- a/.github/workflows/TEST.yml +++ b/.github/workflows/TEST.yml @@ -30,7 +30,7 @@ jobs: #- { outputKey: testJs, os: ubuntu-latest, testTask: "wasmBrowserTest", buildTasks: "jsNodeTest jsBrowserTest" } - { outputKey: testJs, os: ubuntu-latest, testTask: "wasmBrowserTest", buildTasks: "jsBrowserTest jsDenoTest" } - { outputKey: testAndroid, os: ubuntu-latest, enableAndroid: true } - - { outputKey: testJvmMacos, os: macos-latest, testTask: jvmTest } + - { outputKey: testJvmMacos, os: macos-latest, testTask: jvmTest apiCheck } - { outputKey: testJvmLinux, os: ubuntu-latest, testTask: jvmTest, precompileTask: compileTestKotlinJvm, enableKotlinNative: true, enableSandbox: true, e2e: true } - { outputKey: testJvmWindows, os: windows-latest, testTask: jvmTest, precompileTask: compileTestKotlinJvm } #if: ${{ needs.changes.outputs[matrix.outputKey] == 'true' }} diff --git a/build.gradle.kts b/build.gradle.kts index 516f0a0..91b6a08 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -18,7 +18,7 @@ plugins { kotlin("multiplatform") version "2.0.0" id("com.android.library") version "8.2.2" id("org.jetbrains.kotlinx.kover") version "0.8.3" apply false - id("org.jetbrains.kotlinx.binary-compatibility-validator") version "0.16.2" // apiDump / apiCheck + id("org.jetbrains.kotlinx.binary-compatibility-validator") version "0.16.2" id("org.jetbrains.dokka") version "1.9.20" `maven-publish` signing @@ -34,7 +34,10 @@ var REAL_VERSION = System.getenv("FORCED_VERSION") //val REAL_VERSION = System.getenv("FORCED_VERSION") ?: "999.0.0.999" +//val JVM_TARGET = JvmTarget.JVM_1_8 +//val JDK_VERSION = org.gradle.api.JavaVersion.VERSION_1_8 val JVM_TARGET = JvmTarget.JVM_1_8 +val JDK_VERSION = org.gradle.api.JavaVersion.VERSION_1_8 val GROUP = "com.soywiz" kotlin { @@ -57,7 +60,29 @@ allprojects { project.apply(plugin = "kotlin-multiplatform") project.apply(plugin = "android-library") + java.toolchain.languageVersion = JavaLanguageVersion.of(JDK_VERSION.majorVersion) + kotlin.jvmToolchain(JDK_VERSION.majorVersion.toInt()) + afterEvaluate { + tasks.withType(Test::class) { + //this.javaLauncher.set() + this.javaLauncher.set(javaToolchains.launcherFor { + // 17 is latest at the current moment + languageVersion.set(JavaLanguageVersion.of(JDK_VERSION.majorVersion)) + }) + } + } + + kotlin { + androidTarget { + this.compilerOptions.jvmTarget.set(JvmTarget.JVM_17) + } + } + android { + compileOptions { + sourceCompatibility = JDK_VERSION + targetCompatibility = JDK_VERSION + } //signingConfigs { // debug { // […] @@ -345,19 +370,6 @@ subprojects { apply(plugin = "maven-publish") apply(plugin = "signing") - //val JDK_VERSION = 8 - //java.toolchain.languageVersion = JavaLanguageVersion.of(JDK_VERSION) - //kotlin.jvmToolchain(JDK_VERSION) - //afterEvaluate { - // tasks.withType(Test::class) { - // //this.javaLauncher.set() - // this.javaLauncher.set(javaToolchains.launcherFor { - // // 17 is latest at the current moment - // languageVersion.set(JavaLanguageVersion.of(JDK_VERSION)) - // }) - // } - //} - kotlin { js { //nodejs() @@ -973,10 +985,12 @@ class MicroAmper(val project: Project) { main = maybeCreate("${name}Main").also { it.kotlin.srcDirIfExists("src$atName") it.resources.srcDirIfExists("resources$atName") + it.kotlin.srcDir("build/generated/ksp/$name/${name}Main/kotlin") }, test = maybeCreate("${name}Test").also { it.kotlin.srcDirIfExists("test$atName") it.resources.srcDirIfExists("testResources$atName") + it.kotlin.srcDir("build/generated/ksp/$name/${name}Test/kotlin") } ) } @@ -990,6 +1004,8 @@ class MicroAmper(val project: Project) { ssDependsOn("appleNonWatchos", "apple") ssDependsOn("appleIosTvos", "apple") + maybeCreate("commonMain").kotlin.srcDir("build/generated/ksp/metadata/commonMain/kotlin") + for (platform in kotlinPlatforms) { val isMacos = platform.startsWith("macos") val isIos = platform.startsWith("ios") @@ -1111,11 +1127,14 @@ allprojects { afterEvaluate { tasks.withType(org.gradle.api.tasks.testing.Test::class) { //println("TEST-TASK: $this") - jvmArgs( - "--add-opens", "java.base/java.nio=ALL-UNNAMED", - //"--add-opens", "java.base/jdk.incubator.foreign=ALL-UNNAMED", - "--add-opens", "java.base/sun.nio.ch=ALL-UNNAMED", - ) + if (JDK_VERSION.majorVersion.toInt() >= 9) { + jvmArgs( + "-XX:+IgnoreUnrecognizedVMOptions", + "--add-opens", "java.base/java.nio=ALL-UNNAMED", + //"--add-opens", "java.base/jdk.incubator.foreign=ALL-UNNAMED", + "--add-opens", "java.base/sun.nio.ch=ALL-UNNAMED", + ) + } } } } @@ -1136,4 +1155,4 @@ allprojects { apiValidation { ignoredProjects.addAll(listOf(rootProject.name)) -} \ No newline at end of file +} diff --git a/korlibs-image/api/jvm/korlibs-image.api b/korlibs-image/api/jvm/korlibs-image.api index eaf2505..9bfbb02 100644 --- a/korlibs-image/api/jvm/korlibs-image.api +++ b/korlibs-image/api/jvm/korlibs-image.api @@ -2618,10 +2618,6 @@ public final class korlibs/image/color/RgbaArray : java/util/List, kotlin/jvm/in public fun add-XDoMphA (II)V public fun addAll (ILjava/util/Collection;)Z public fun addAll (Ljava/util/Collection;)Z - public synthetic fun addFirst (Ljava/lang/Object;)V - public fun addFirst-KatOrx8 (Lkorlibs/image/color/RGBA;)V - public synthetic fun addLast (Ljava/lang/Object;)V - public fun addLast-KatOrx8 (Lkorlibs/image/color/RGBA;)V public static final synthetic fun box-impl ([I)Lkorlibs/image/color/RgbaArray; public fun clear ()V public static fun constructor-impl ([I)[I @@ -2663,10 +2659,6 @@ public final class korlibs/image/color/RgbaArray : java/util/List, kotlin/jvm/in public synthetic fun remove (I)Ljava/lang/Object; public fun remove (Ljava/lang/Object;)Z public fun removeAll (Ljava/util/Collection;)Z - public synthetic fun removeFirst ()Ljava/lang/Object; - public fun removeFirst-PozHwmI ()Lkorlibs/image/color/RGBA; - public synthetic fun removeLast ()Ljava/lang/Object; - public fun removeLast-PozHwmI ()Lkorlibs/image/color/RGBA; public fun replaceAll (Ljava/util/function/UnaryOperator;)V public fun retainAll (Ljava/util/Collection;)Z public synthetic fun set (ILjava/lang/Object;)Ljava/lang/Object; @@ -6807,10 +6799,6 @@ public final class korlibs/image/text/RichTextData : java/util/List, korlibs/dat public fun add (Lkorlibs/image/text/RichTextData$Line;)Z public fun addAll (ILjava/util/Collection;)Z public fun addAll (Ljava/util/Collection;)Z - public synthetic fun addFirst (Ljava/lang/Object;)V - public fun addFirst (Lkorlibs/image/text/RichTextData$Line;)V - public synthetic fun addLast (Ljava/lang/Object;)V - public fun addLast (Lkorlibs/image/text/RichTextData$Line;)V public fun clear ()V public final fun component1 ()Ljava/util/List; public final fun component2 ()Lkorlibs/image/text/RichTextData$Style; @@ -6848,10 +6836,6 @@ public final class korlibs/image/text/RichTextData : java/util/List, korlibs/dat public fun remove (I)Lkorlibs/image/text/RichTextData$Line; public fun remove (Ljava/lang/Object;)Z public fun removeAll (Ljava/util/Collection;)Z - public synthetic fun removeFirst ()Ljava/lang/Object; - public fun removeFirst ()Lkorlibs/image/text/RichTextData$Line; - public synthetic fun removeLast ()Ljava/lang/Object; - public fun removeLast ()Lkorlibs/image/text/RichTextData$Line; public fun replaceAll (Ljava/util/function/UnaryOperator;)V public fun retainAll (Ljava/util/Collection;)Z public synthetic fun set (ILjava/lang/Object;)Ljava/lang/Object; @@ -6982,10 +6966,6 @@ public final class korlibs/image/text/RichTextDataPlacements : java/util/List, k public fun add (Lkorlibs/image/text/RichTextDataPlacements$Placement;)Z public fun addAll (ILjava/util/Collection;)Z public fun addAll (Ljava/util/Collection;)Z - public synthetic fun addFirst (Ljava/lang/Object;)V - public fun addFirst (Lkorlibs/image/text/RichTextDataPlacements$Placement;)V - public synthetic fun addLast (Ljava/lang/Object;)V - public fun addLast (Lkorlibs/image/text/RichTextDataPlacements$Placement;)V public fun clear ()V public final fun component1 ()Lkorlibs/datastructure/FastArrayList; public final fun contains (Ljava/lang/Object;)Z @@ -7011,10 +6991,6 @@ public final class korlibs/image/text/RichTextDataPlacements : java/util/List, k public fun remove (I)Lkorlibs/image/text/RichTextDataPlacements$Placement; public fun remove (Ljava/lang/Object;)Z public fun removeAll (Ljava/util/Collection;)Z - public synthetic fun removeFirst ()Ljava/lang/Object; - public fun removeFirst ()Lkorlibs/image/text/RichTextDataPlacements$Placement; - public synthetic fun removeLast ()Ljava/lang/Object; - public fun removeLast ()Lkorlibs/image/text/RichTextDataPlacements$Placement; public fun replaceAll (Ljava/util/function/UnaryOperator;)V public fun retainAll (Ljava/util/Collection;)Z public synthetic fun set (ILjava/lang/Object;)Ljava/lang/Object; diff --git a/settings.gradle.kts b/settings.gradle.kts index 8517311..e8e9bcd 100644 --- a/settings.gradle.kts +++ b/settings.gradle.kts @@ -7,14 +7,16 @@ pluginManagement { //maven("https://www.jetbrains.com/intellij-repository/releases") //maven("https://packages.jetbrains.team/maven/p/ij/intellij-dependencies") } -} -plugins { - //id("org.jetbrains.amper.settings.plugin").version("0.2.1-dev-470") - //id("org.jetbrains.amper.settings.plugin").version("0.2.2") - //id("org.jetbrains.amper.settings.plugin").version("0.2.3-dev-473") + plugins { + id("com.google.devtools.ksp") version "2.0.0-1.0.23" + //id("org.jetbrains.amper.settings.plugin").version("0.2.1-dev-470") + //id("org.jetbrains.amper.settings.plugin").version("0.2.2") + //id("org.jetbrains.amper.settings.plugin").version("0.2.3-dev-473") + } } + for (file in rootDir.listFiles()) { if (file.isDirectory() && File(file, "module.yaml").exists()) { include(":${file.name}")