[Gradle] Rename Kotlin~Multiplatfom~PluginLifecycleCoroutineContextElement

^KT-56654 Verification Pending
This commit is contained in:
Sebastian Sellmair
2023-03-28 14:13:42 +02:00
committed by Space Team
parent a7a689841f
commit 2043c9db8e
2 changed files with 7 additions and 7 deletions
@@ -127,8 +127,8 @@ internal fun Project.startKotlinPluginLifecycle() {
* the currently running coroutine. Throws if this coroutine was not started using a [KotlinPluginLifecycle] * the currently running coroutine. Throws if this coroutine was not started using a [KotlinPluginLifecycle]
*/ */
internal suspend fun currentKotlinPluginLifecycle(): KotlinPluginLifecycle { internal suspend fun currentKotlinPluginLifecycle(): KotlinPluginLifecycle {
return currentCoroutineContext()[KotlinMultiplatformPluginLifecycleCoroutineContextElement]?.lifecycle return currentCoroutineContext()[KotlinPluginLifecycleCoroutineContextElement]?.lifecycle
?: error("Missing $KotlinMultiplatformPluginLifecycleCoroutineContextElement in currentCoroutineContext") ?: error("Missing $KotlinPluginLifecycleCoroutineContextElement in currentCoroutineContext")
} }
/** /**
@@ -429,7 +429,7 @@ private class KotlinPluginLifecycleImpl(override val project: Project) : KotlinP
val coroutine = block.createCoroutine(this, object : Continuation<Unit> { val coroutine = block.createCoroutine(this, object : Continuation<Unit> {
override val context: CoroutineContext = EmptyCoroutineContext + override val context: CoroutineContext = EmptyCoroutineContext +
KotlinMultiplatformPluginLifecycleCoroutineContextElement(lifecycle) KotlinPluginLifecycleCoroutineContextElement(lifecycle)
override fun resumeWith(result: Result<Unit>) = result.getOrThrow() override fun resumeWith(result: Result<Unit>) = result.getOrThrow()
}) })
@@ -474,12 +474,12 @@ private class KotlinPluginLifecycleImpl(override val project: Project) : KotlinP
} }
} }
private class KotlinMultiplatformPluginLifecycleCoroutineContextElement( private class KotlinPluginLifecycleCoroutineContextElement(
val lifecycle: KotlinPluginLifecycle val lifecycle: KotlinPluginLifecycle
) : CoroutineContext.Element { ) : CoroutineContext.Element {
companion object Key : CoroutineContext.Key<KotlinMultiplatformPluginLifecycleCoroutineContextElement> companion object Key : CoroutineContext.Key<KotlinPluginLifecycleCoroutineContextElement>
override val key: CoroutineContext.Key<KotlinMultiplatformPluginLifecycleCoroutineContextElement> = Key override val key: CoroutineContext.Key<KotlinPluginLifecycleCoroutineContextElement> = Key
} }
private class RestrictedLifecycleStages( private class RestrictedLifecycleStages(
@@ -13,7 +13,7 @@ internal val defaultKotlinTargetHierarchy = KotlinTargetHierarchyDescriptor {
withModule(ModuleName.main, ModuleName.test) withModule(ModuleName.main, ModuleName.test)
common { common {
/* All compilations shall receive be added to the common group by default */ /* All compilations shall be added to the common group by default */
withCompilations { true } withCompilations { true }
group("native") { group("native") {