Skip to content
Open
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
2 changes: 1 addition & 1 deletion .idea/kotlinc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ buildscript {

allprojects {
group = "com.rickclephas.kmp"
version = "1.0.0-ALPHA-48"
version = "1.0.0-ALPHA-48-kotlin-2.3.0-Beta2"
}

apiValidation {
Expand Down
2 changes: 1 addition & 1 deletion gradle/libs.versions.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[versions]
kotlin = "2.2.21"
kotlin = "2.3.0-Beta2"
kotlin-idea = "2.2.0-ij251-78"
kotlinx-coroutines = "1.10.1"
kotlinx-binary-compatibility-validator = "0.16.3"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ public final class com/rickclephas/kmp/nativecoroutines/compiler/KmpNativeCorout

public final class com/rickclephas/kmp/nativecoroutines/compiler/KmpNativeCoroutinesCompilerPluginRegistrar : org/jetbrains/kotlin/compiler/plugin/CompilerPluginRegistrar {
public fun <init> ()V
public fun getPluginId ()Ljava/lang/String;
public fun getSupportsK2 ()Z
public fun registerExtensions (Lorg/jetbrains/kotlin/compiler/plugin/CompilerPluginRegistrar$ExtensionStorage;Lorg/jetbrains/kotlin/config/CompilerConfiguration;)V
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ public final class com/rickclephas/kmp/nativecoroutines/compiler/KmpNativeCorout

public final class com/rickclephas/kmp/nativecoroutines/compiler/KmpNativeCoroutinesCompilerPluginRegistrar : org/jetbrains/kotlin/compiler/plugin/CompilerPluginRegistrar {
public fun <init> ()V
public fun getPluginId ()Ljava/lang/String;
public fun getSupportsK2 ()Z
public fun registerExtensions (Lorg/jetbrains/kotlin/compiler/plugin/CompilerPluginRegistrar$ExtensionStorage;Lorg/jetbrains/kotlin/config/CompilerConfiguration;)V
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import org.jetbrains.kotlin.fir.extensions.FirExtensionRegistrarAdapter
@OptIn(ExperimentalCompilerApi::class)
public class KmpNativeCoroutinesCompilerPluginRegistrar: CompilerPluginRegistrar() {

override val pluginId: String = "com.rickclephas.kmp.nativecoroutines"
override val supportsK2: Boolean = true

override fun ExtensionStorage.registerExtensions(configuration: CompilerConfiguration) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package com.rickclephas.kmp.nativecoroutines.compiler

import com.rickclephas.kmp.nativecoroutines.compiler.runners.*
import org.jetbrains.kotlin.generators.generateTestGroupSuiteWithJUnit5
import org.jetbrains.kotlin.generators.dsl.junit5.generateTestGroupSuiteWithJUnit5

fun main() {
generateTestGroupSuiteWithJUnit5 {
Expand Down
428 changes: 214 additions & 214 deletions kmp-nativecoroutines-compiler/src/testData/codegen/annotations.fir.ir.txt

Large diffs are not rendered by default.

214 changes: 107 additions & 107 deletions kmp-nativecoroutines-compiler/src/testData/codegen/annotations.fir.kt.txt
Original file line number Diff line number Diff line change
@@ -1,110 +1,4 @@
// FILE: annotations.kt
@file:Suppress(names = ["OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE"])

@NativeCoroutines
@Deprecated(message = "This is deprecated 4")
val deprecatedProperty1: Flow<String>
field = flowOf<String>(value = "OK4")
get

@NativeCoroutines
@Deprecated(message = "This is deprecated 5", level = DeprecationLevel.WARNING)
val deprecatedProperty2: Flow<String>
field = flowOf<String>(value = "OK5")
get

@NativeCoroutines
@Deprecated(message = "This is deprecated 6", replaceWith = ReplaceWith(expression = "deprecatedProperty2", imports = []), level = DeprecationLevel.ERROR)
val deprecatedProperty3: Flow<String>
field = flowOf<String>(value = "OK6")
get

@NativeCoroutines
val deprecatedProperty4: MutableStateFlow<String>
field = MutableStateFlow<String>(value = "OK7")
@Deprecated(message = "This is deprecated 7")
get

@NativeCoroutines
@OptIn(markerClass = [ExperimentalObjCName::class])
@ObjCName(name = "objCNameProperty1ObjC")
val objCNameProperty1: StateFlow<String>
field = MutableStateFlow<String>(value = "OK11")
get

@NativeCoroutinesState
@OptIn(markerClass = [ExperimentalObjCName::class])
@ObjCName(name = "objCNameProperty2ObjC")
val objCNameProperty2: StateFlow<String>
field = MutableStateFlow<String>(value = "OK12")
get

fun box(): String {
return runBoxTest(action = local suspend fun BoxTest.<anonymous>() {
$this$runBoxTest.await<String>(nativeSuspend = deprecatedFunction1Native())
$this$runBoxTest.await<String>(nativeSuspend = deprecatedFunction2Native())
$this$runBoxTest.collect<String>(nativeFlow = <get-deprecatedProperty1Native>())
$this$runBoxTest.collect<String>(nativeFlow = <get-deprecatedProperty2Native>())
$this$runBoxTest.collect<String>(nativeFlow = <get-deprecatedProperty4Native>(), maxValues = 1)
$this$runBoxTest.value<String>(value = <get-deprecatedProperty4Value>())
$this$runBoxTest.await<String>(nativeSuspend = objCNameFunction1Native())
$this$runBoxTest.await<String>(nativeSuspend = objCNameFunction2Native())
$this$runBoxTest.await<String>(nativeSuspend = objCNameFunction3Native())
$this$runBoxTest.collect<String>(nativeFlow = <get-objCNameProperty1Native>(), maxValues = 1)
$this$runBoxTest.value<String>(value = <get-objCNameProperty1Value>())
$this$runBoxTest.collect<String>(nativeFlow = <get-objCNameProperty2Flow>(), maxValues = 1)
$this$runBoxTest.value<String>(value = <get-objCNameProperty2Value>())
$this$runBoxTest.await<String>(nativeSuspend = objCNameFunctionParameterNative(value = "OK13"))
}
)
}

@NativeCoroutines
@Deprecated(message = "This is deprecated 1")
suspend fun deprecatedFunction1(): String {
return "OK1"
}

@NativeCoroutines
@Deprecated(message = "This is deprecated 2", level = DeprecationLevel.WARNING)
suspend fun deprecatedFunction2(): String {
return "OK2"
}

@NativeCoroutines
@Deprecated(message = "This is deprecated 3", replaceWith = ReplaceWith(expression = "deprecatedFunction2()", imports = []), level = DeprecationLevel.ERROR)
suspend fun deprecatedFunction3(): String {
return "OK3"
}

@NativeCoroutines
@OptIn(markerClass = [ExperimentalObjCName::class])
@ObjCName(name = "objCNameFunction1ObjC")
suspend fun objCNameFunction1(): String {
return "OK8"
}

@NativeCoroutines
@OptIn(markerClass = [ExperimentalObjCName::class])
@ObjCName(swiftName = "objCNameFunction2Swift")
suspend fun objCNameFunction2(): String {
return "OK9"
}

@NativeCoroutines
@OptIn(markerClass = [ExperimentalObjCName::class])
@ObjCName(name = "objCNameFunction3ObjC", swiftName = "objCNameFunction3Swift")
suspend fun objCNameFunction3(): String {
return "OK10"
}

@NativeCoroutines
@OptIn(markerClass = [ExperimentalObjCName::class])
suspend fun objCNameFunctionParameter(@ObjCName(name = "valueObjC") value: String): String {
return value
}

// FILE: __GENERATED DECLARATIONS__.kt
// FILE: __GENERATED__CALLABLES__.kt

var deprecatedProperty4Value: String
@Deprecated(message = "This is deprecated 7")
Expand Down Expand Up @@ -248,3 +142,109 @@ val objCNameProperty2Value: String
val tmp_21: StateFlow<String> = <get-objCNameProperty2>()
return tmp_21.<get-value>()
}

// FILE: annotations.kt
@file:Suppress(names = ["OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE"])

@NativeCoroutines
@Deprecated(message = "This is deprecated 4")
val deprecatedProperty1: Flow<String>
field = flowOf<String>(value = "OK4")
get

@NativeCoroutines
@Deprecated(message = "This is deprecated 5", level = DeprecationLevel.WARNING)
val deprecatedProperty2: Flow<String>
field = flowOf<String>(value = "OK5")
get

@NativeCoroutines
@Deprecated(message = "This is deprecated 6", replaceWith = ReplaceWith(expression = "deprecatedProperty2", imports = []), level = DeprecationLevel.ERROR)
val deprecatedProperty3: Flow<String>
field = flowOf<String>(value = "OK6")
get

@NativeCoroutines
val deprecatedProperty4: MutableStateFlow<String>
field = MutableStateFlow<String>(value = "OK7")
@Deprecated(message = "This is deprecated 7")
get

@NativeCoroutines
@OptIn(markerClass = [ExperimentalObjCName::class])
@ObjCName(name = "objCNameProperty1ObjC")
val objCNameProperty1: StateFlow<String>
field = MutableStateFlow<String>(value = "OK11")
get

@NativeCoroutinesState
@OptIn(markerClass = [ExperimentalObjCName::class])
@ObjCName(name = "objCNameProperty2ObjC")
val objCNameProperty2: StateFlow<String>
field = MutableStateFlow<String>(value = "OK12")
get

fun box(): String {
return runBoxTest(action = local suspend fun BoxTest.<anonymous>() {
$this$runBoxTest.await<String>(nativeSuspend = deprecatedFunction1Native())
$this$runBoxTest.await<String>(nativeSuspend = deprecatedFunction2Native())
$this$runBoxTest.collect<String>(nativeFlow = <get-deprecatedProperty1Native>())
$this$runBoxTest.collect<String>(nativeFlow = <get-deprecatedProperty2Native>())
$this$runBoxTest.collect<String>(nativeFlow = <get-deprecatedProperty4Native>(), maxValues = 1)
$this$runBoxTest.value<String>(value = <get-deprecatedProperty4Value>())
$this$runBoxTest.await<String>(nativeSuspend = objCNameFunction1Native())
$this$runBoxTest.await<String>(nativeSuspend = objCNameFunction2Native())
$this$runBoxTest.await<String>(nativeSuspend = objCNameFunction3Native())
$this$runBoxTest.collect<String>(nativeFlow = <get-objCNameProperty1Native>(), maxValues = 1)
$this$runBoxTest.value<String>(value = <get-objCNameProperty1Value>())
$this$runBoxTest.collect<String>(nativeFlow = <get-objCNameProperty2Flow>(), maxValues = 1)
$this$runBoxTest.value<String>(value = <get-objCNameProperty2Value>())
$this$runBoxTest.await<String>(nativeSuspend = objCNameFunctionParameterNative(value = "OK13"))
}
)
}

@NativeCoroutines
@Deprecated(message = "This is deprecated 1")
suspend fun deprecatedFunction1(): String {
return "OK1"
}

@NativeCoroutines
@Deprecated(message = "This is deprecated 2", level = DeprecationLevel.WARNING)
suspend fun deprecatedFunction2(): String {
return "OK2"
}

@NativeCoroutines
@Deprecated(message = "This is deprecated 3", replaceWith = ReplaceWith(expression = "deprecatedFunction2()", imports = []), level = DeprecationLevel.ERROR)
suspend fun deprecatedFunction3(): String {
return "OK3"
}

@NativeCoroutines
@OptIn(markerClass = [ExperimentalObjCName::class])
@ObjCName(name = "objCNameFunction1ObjC")
suspend fun objCNameFunction1(): String {
return "OK8"
}

@NativeCoroutines
@OptIn(markerClass = [ExperimentalObjCName::class])
@ObjCName(swiftName = "objCNameFunction2Swift")
suspend fun objCNameFunction2(): String {
return "OK9"
}

@NativeCoroutines
@OptIn(markerClass = [ExperimentalObjCName::class])
@ObjCName(name = "objCNameFunction3ObjC", swiftName = "objCNameFunction3Swift")
suspend fun objCNameFunction3(): String {
return "OK10"
}

@NativeCoroutines
@OptIn(markerClass = [ExperimentalObjCName::class])
suspend fun objCNameFunctionParameter(@ObjCName(name = "valueObjC") value: String): String {
return value
}
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ FILE: annotations.kt
}
)
}
FILE: __GENERATED DECLARATIONS__.kt
FILE: /__GENERATED__CALLABLES__.kt
@R|kotlin/Deprecated|(message = String(This is deprecated 1)) @R|kotlin/native/ObjCName|(name = String(deprecatedFunction1)) public final fun deprecatedFunction1Native(): R|com/rickclephas/kmp/nativecoroutines/NativeSuspend<kotlin/String>| {
::R|/deprecatedFunction1|
R|kotlin/TODO|(String(KMP-NativeCoroutines generated declaration must be implemented in IR))
Expand Down
Loading
Loading