-
Notifications
You must be signed in to change notification settings - Fork 5.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Gradle] Implement KT59446TransformationOnTransitiveJavaDependencyTest
^KT-59446 In Progress (cherry picked from commit ec46c82)
- Loading branch information
1 parent
54b11e3
commit bbf64b1
Showing
1 changed file
with
52 additions
and
0 deletions.
There are no files selected for viewing
52 changes: 52 additions & 0 deletions
52
...ains/kotlin/gradle/regressionTests/KT59446TransformationOnTransitiveJavaDependencyTest.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
/* | ||
* Copyright 2010-2023 JetBrains s.r.o. and Kotlin Programming Language contributors. | ||
* Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file. | ||
*/ | ||
|
||
@file:Suppress("FunctionName") | ||
|
||
package org.jetbrains.kotlin.gradle.regressionTests | ||
|
||
import org.jetbrains.kotlin.gradle.dsl.multiplatformExtension | ||
import org.jetbrains.kotlin.gradle.plugin.ide.dependencyResolvers.resolveMetadata | ||
import org.jetbrains.kotlin.gradle.plugin.mpp.MetadataDependencyResolution | ||
import org.jetbrains.kotlin.gradle.util.buildProject | ||
import org.jetbrains.kotlin.gradle.util.buildProjectWithMPP | ||
import kotlin.test.Test | ||
|
||
class KT59446TransformationOnTransitiveJavaDependencyTest { | ||
@Test | ||
fun `test - transform transitive java dependency`() { | ||
val rootProject = buildProject() | ||
val projectA = buildProjectWithMPP(projectBuilder = { withParent(rootProject).withName("a") }) | ||
val projectB = buildProjectWithMPP(projectBuilder = { withParent(rootProject).withName("b") }) | ||
val projectJava = buildProject(projectBuilder = { withParent(rootProject).withName("java") }) | ||
|
||
/** | ||
* a -> b -> java | ||
*/ | ||
projectJava.plugins.apply("java-library") | ||
|
||
projectA.multiplatformExtension.jvm() | ||
projectB.multiplatformExtension.jvm() | ||
|
||
projectB.multiplatformExtension.sourceSets.getByName("commonMain").dependencies { | ||
api(project(":java")) | ||
} | ||
|
||
projectA.multiplatformExtension.sourceSets.getByName("commonMain").dependencies { | ||
api(project(":b")) | ||
} | ||
|
||
/* | ||
Call transformation | ||
Exception was: | ||
org.jetbrains.kotlin.gradle.plugin.KotlinPluginLifecycle$IllegalLifecycleException: Future was not completed yet 'Kotlin Plugin Lifecycle: (project ':java') *not started*' | ||
at org.jetbrains.kotlin.gradle.utils.FutureImpl.getOrThrow(Future.kt:113) | ||
at org.jetbrains.kotlin.gradle.utils.LenientFutureImpl.getOrThrow(Future.kt:138) | ||
at org.jetbrains.kotlin.gradle.plugin.mpp.GranularMetadataTransformation.toModuleDependencyIdentifier(GranularMetadataTransformation.kt:303) | ||
at org.jetbrains.kotlin.gradle.plugin.mpp.GranularMetadataTransformation.processDependency(GranularMetadataTransformation.kt:260) | ||
*/ | ||
projectA.multiplatformExtension.sourceSets.getByName("commonMain").resolveMetadata<MetadataDependencyResolution>() | ||
} | ||
} |