From 1ae666a586891e009a6c575f1a2d9a4d3de9572f Mon Sep 17 00:00:00 2001 From: Gregory Lureau Date: Wed, 16 Feb 2022 12:33:17 +0100 Subject: [PATCH] Fix missing deployment for lib-coroutines. --- .gitignore | 1 + README.md | 3 ++- build.gradle.kts | 2 +- compiler/build.gradle.kts | 2 +- .../kustomexport/compiler/ExportClassTest.kt | 10 +++++----- .../kustomexport/compiler/ExportEnumTest.kt | 18 +++++++++--------- .../compiler/ExportInterfaceTest.kt | 12 ++++++------ .../compiler/ExportSealedClassTest.kt | 16 ++++++++-------- .../compiler/GenericsInterfaceTest.kt | 2 +- .../kustomexport/compiler/TypeMappingTest.kt | 12 ++++++------ gradle.properties | 4 ++-- .../src/commonMain/kotlin/Placeholder.kt | 18 ++++++++++++++++++ 12 files changed, 60 insertions(+), 40 deletions(-) create mode 100644 lib-coroutines/src/commonMain/kotlin/Placeholder.kt diff --git a/.gitignore b/.gitignore index 650d3c3..e0c3d5a 100644 --- a/.gitignore +++ b/.gitignore @@ -2,3 +2,4 @@ **/build samples/node_modules/ local.properties +kotlin-js-store diff --git a/README.md b/README.md index 2a9c84b..a5f870f 100644 --- a/README.md +++ b/README.md @@ -97,7 +97,8 @@ kotlin { sourceSets { val commonMain by getting { dependencies { - implementation("deezer.kustomexport:lib:0.1.0") + implementation("deezer.kustomexport:lib:") + implementation("deezer.kustomexport:lib-coroutines:") } } } diff --git a/build.gradle.kts b/build.gradle.kts index f9f9c5b..315aef2 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -67,7 +67,7 @@ tasks.create("cleanMavenLocalArtifacts") { tasks.create("copyMavenLocalArtifacts") { group = "publishing" - dependsOn(":compiler:publishToMavenLocal", ":lib:publishToMavenLocal") + dependsOn(":compiler:publishToMavenLocal", ":lib:publishToMavenLocal", ":lib-coroutines:publishToMavenLocal") val userHome = System.getProperty("user.home") val groupDir = project.group.toString().replace('.', '/') diff --git a/compiler/build.gradle.kts b/compiler/build.gradle.kts index 05456a4..2cfd45a 100644 --- a/compiler/build.gradle.kts +++ b/compiler/build.gradle.kts @@ -22,7 +22,7 @@ dependencies { implementation("com.google.devtools.ksp:symbol-processing:$kspVersion") implementation("com.google.devtools.ksp:symbol-processing-api:$kspVersion") - testImplementation("com.github.tschuchortdev:kotlin-compile-testing-ksp:1.4.6") + testImplementation("com.github.tschuchortdev:kotlin-compile-testing-ksp:1.4.7") testImplementation("junit:junit:4.13.2") testImplementation(kotlin("test")) } diff --git a/compiler/src/test/kotlin/deezer/kustomexport/compiler/ExportClassTest.kt b/compiler/src/test/kotlin/deezer/kustomexport/compiler/ExportClassTest.kt index 0a86646..8733c23 100644 --- a/compiler/src/test/kotlin/deezer/kustomexport/compiler/ExportClassTest.kt +++ b/compiler/src/test/kotlin/deezer/kustomexport/compiler/ExportClassTest.kt @@ -28,7 +28,7 @@ class ExportClassTest { assertCompilationOutput( """ package foo.bar - import deezer.kustom.KustomExport + import deezer.kustomexport.KustomExport @KustomExport class BasicClass @@ -69,7 +69,7 @@ class ExportClassTest { assertCompilationOutput( """ package foo.bar - import deezer.kustom.KustomExport + import deezer.kustomexport.KustomExport @KustomExport class BasicClass(val id: String) @@ -79,8 +79,8 @@ class ExportClassTest { content = """ package foo.bar.js - import deezer.kustom.dynamicCastTo - import deezer.kustom.dynamicNull + import deezer.kustomexport.dynamicCastTo + import deezer.kustomexport.dynamicNull import kotlin.String import kotlin.Suppress import kotlin.js.JsExport @@ -137,7 +137,7 @@ class ExportClassTest { """ package foo.bar - import deezer.kustom.KustomExport + import deezer.kustomexport.KustomExport import kotlin.Any @KustomExport diff --git a/compiler/src/test/kotlin/deezer/kustomexport/compiler/ExportEnumTest.kt b/compiler/src/test/kotlin/deezer/kustomexport/compiler/ExportEnumTest.kt index 2ab5cd0..6f873f3 100644 --- a/compiler/src/test/kotlin/deezer/kustomexport/compiler/ExportEnumTest.kt +++ b/compiler/src/test/kotlin/deezer/kustomexport/compiler/ExportEnumTest.kt @@ -29,7 +29,7 @@ class ExportEnumTest { """ package foo.bar - import deezer.kustom.KustomExport + import deezer.kustomexport.KustomExport @KustomExport enum class Season { @@ -51,9 +51,9 @@ class ExportEnumTest { @JsExport public class Season internal constructor( - internal val `value`: CommonSeason + internal val common: CommonSeason ) { - public val name: String = value.name + public val name: String = common.name } @JsExport @@ -77,21 +77,21 @@ class ExportEnumTest { return null } - public fun Season.importSeason(): CommonSeason = value + public fun Season.importSeason(): CommonSeason = common - public fun CommonSeason.exportSeason(): Season = Season(this) + public fun CommonSeason.exportSeason(): Season = Season_valueOf(this.name)!! @JsExport - public val Season_SPRING: Season = CommonSeason.SPRING.exportSeason() + public val Season_SPRING: Season = Season(CommonSeason.SPRING) @JsExport - public val Season_SUMMER: Season = CommonSeason.SUMMER.exportSeason() + public val Season_SUMMER: Season = Season(CommonSeason.SUMMER) @JsExport - public val Season_AUTUMN: Season = CommonSeason.AUTUMN.exportSeason() + public val Season_AUTUMN: Season = Season(CommonSeason.AUTUMN) @JsExport - public val Season_WINTER: Season = CommonSeason.WINTER.exportSeason() + public val Season_WINTER: Season = Season(CommonSeason.WINTER) """.trimIndent() ) ) diff --git a/compiler/src/test/kotlin/deezer/kustomexport/compiler/ExportInterfaceTest.kt b/compiler/src/test/kotlin/deezer/kustomexport/compiler/ExportInterfaceTest.kt index cf4f757..e67b10a 100644 --- a/compiler/src/test/kotlin/deezer/kustomexport/compiler/ExportInterfaceTest.kt +++ b/compiler/src/test/kotlin/deezer/kustomexport/compiler/ExportInterfaceTest.kt @@ -29,7 +29,7 @@ class ExportInterfaceTest { """ package flux - import deezer.kustom.KustomExport + import deezer.kustomexport.KustomExport @KustomExport interface Exportable @@ -69,7 +69,7 @@ class ExportInterfaceTest { """ package flux - import deezer.kustom.KustomExport + import deezer.kustomexport.KustomExport @KustomExport interface BasicInterface { @@ -120,7 +120,7 @@ class ExportInterfaceTest { """ package flux - import deezer.kustom.KustomExport + import deezer.kustomexport.KustomExport @KustomExport interface BasicInterface { @@ -177,7 +177,7 @@ class ExportInterfaceTest { """ package flux - import deezer.kustom.KustomExport + import deezer.kustomexport.KustomExport @KustomExport interface BasicInterface { @@ -249,7 +249,7 @@ class ExportInterfaceTest { content = """ package flux - import deezer.kustom.KustomExport + import deezer.kustomexport.KustomExport import bar.Bar @KustomExport @@ -327,7 +327,7 @@ class ExportInterfaceTest { content = """ package flux - import deezer.kustom.KustomExport + import deezer.kustomexport.KustomExport import bar.Bar @KustomExport diff --git a/compiler/src/test/kotlin/deezer/kustomexport/compiler/ExportSealedClassTest.kt b/compiler/src/test/kotlin/deezer/kustomexport/compiler/ExportSealedClassTest.kt index ae1b838..b41cdb1 100644 --- a/compiler/src/test/kotlin/deezer/kustomexport/compiler/ExportSealedClassTest.kt +++ b/compiler/src/test/kotlin/deezer/kustomexport/compiler/ExportSealedClassTest.kt @@ -31,7 +31,7 @@ class ExportSealedClassTest { """ package foo.bar - import deezer.kustom.KustomExport + import deezer.kustomexport.KustomExport @KustomExport sealed class SealedParent(val ctorParam: Long) { @@ -119,8 +119,8 @@ class ExportSealedClassTest { content = """ package foo.bar.js - import deezer.kustom.dynamicCastTo - import deezer.kustom.dynamicNull + import deezer.kustomexport.dynamicCastTo + import deezer.kustomexport.dynamicNull import kotlin.Double import kotlin.String import kotlin.Suppress @@ -184,7 +184,7 @@ class ExportSealedClassTest { """ package foo.bar - import deezer.kustom.KustomExport + import deezer.kustomexport.KustomExport import java.lang.IllegalStateException // Or else it's interpreted as a typealias and fail in the toClassName() koktlinpoet ext @KustomExport @@ -246,8 +246,8 @@ class ExportSealedClassTest { content = """ package foo.bar.js - import deezer.kustom.dynamicCastTo - import deezer.kustom.dynamicNull + import deezer.kustomexport.dynamicCastTo + import deezer.kustomexport.dynamicNull import kotlin.Double import kotlin.String import kotlin.Suppress @@ -327,8 +327,8 @@ class ExportSealedClassTest { content = """ package foo.bar.js - import deezer.kustom.dynamicCastTo - import deezer.kustom.dynamicNull + import deezer.kustomexport.dynamicCastTo + import deezer.kustomexport.dynamicNull import kotlin.Double import kotlin.String import kotlin.Suppress diff --git a/compiler/src/test/kotlin/deezer/kustomexport/compiler/GenericsInterfaceTest.kt b/compiler/src/test/kotlin/deezer/kustomexport/compiler/GenericsInterfaceTest.kt index a738aff..fbfcd9d 100644 --- a/compiler/src/test/kotlin/deezer/kustomexport/compiler/GenericsInterfaceTest.kt +++ b/compiler/src/test/kotlin/deezer/kustomexport/compiler/GenericsInterfaceTest.kt @@ -30,7 +30,7 @@ class GenericsInterfaceTest { assertCompilationOutput( """ package foo.bar - import deezer.kustom.KustomExport + import deezer.kustomexport.KustomExport open class GenericsBase diff --git a/compiler/src/test/kotlin/deezer/kustomexport/compiler/TypeMappingTest.kt b/compiler/src/test/kotlin/deezer/kustomexport/compiler/TypeMappingTest.kt index 5e8a97a..18c8387 100644 --- a/compiler/src/test/kotlin/deezer/kustomexport/compiler/TypeMappingTest.kt +++ b/compiler/src/test/kotlin/deezer/kustomexport/compiler/TypeMappingTest.kt @@ -28,7 +28,7 @@ class TypeMappingTest { assertCompilationOutput( """ package foo.bar - import deezer.kustom.KustomExport + import deezer.kustomexport.KustomExport @KustomExport class AllTypesHandledByKotlinJs { @@ -192,7 +192,7 @@ class TypeMappingTest { assertCompilationOutput( """ package foo.bar - import deezer.kustom.KustomExport + import deezer.kustomexport.KustomExport @KustomExport class MyLongClass { @@ -252,7 +252,7 @@ class TypeMappingTest { assertCompilationOutput( """ package foo.bar - import deezer.kustom.KustomExport + import deezer.kustomexport.KustomExport @KustomExport class Nullables { @@ -336,7 +336,7 @@ class TypeMappingTest { package foo.bar import pokemon.Pikachu - import deezer.kustom.KustomExport + import deezer.kustomexport.KustomExport @KustomExport class Arrays { @@ -428,7 +428,7 @@ class TypeMappingTest { """ package pokedex - import deezer.kustom.KustomExport + import deezer.kustomexport.KustomExport import pokemon.Pikachu @KustomExport @@ -503,7 +503,7 @@ class TypeMappingTest { "Lambdas.kt", """ package foo - import deezer.kustom.KustomExport + import deezer.kustomexport.KustomExport import pokemon.Pikachu @KustomExport diff --git a/gradle.properties b/gradle.properties index abacd61..5c691d4 100644 --- a/gradle.properties +++ b/gradle.properties @@ -2,5 +2,5 @@ kotlin.mpp.stability.nowarn=true kotlin.mpp.enableGranularSourceSetsMetadata=true kotlin.native.enableDependencyPropagation=false -kotlinVersion=1.6.0 -kspVersion=1.6.0-1.0.2 \ No newline at end of file +kotlinVersion=1.6.10 +kspVersion=1.6.10-1.0.2 \ No newline at end of file diff --git a/lib-coroutines/src/commonMain/kotlin/Placeholder.kt b/lib-coroutines/src/commonMain/kotlin/Placeholder.kt new file mode 100644 index 0000000..4c44ce6 --- /dev/null +++ b/lib-coroutines/src/commonMain/kotlin/Placeholder.kt @@ -0,0 +1,18 @@ +/* + * Copyright 2022 Deezer. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +// Required to generate natives build and be able to use lib-coroutines on a KMP project... +private val placeholder_lib_coroutines = null \ No newline at end of file