[Gradle] CInteropMetadataDependencyTransformationTask: Ignore project dependencies
Included builds will still resolve using a regular ArtifactMetadataProvider (but using a ProjectComponentIdentifier). Such dependencies shall not try to go through cinterop metadata transformation. Right now commonized dependencies from included builds will just not be visible/exported to the consumer builds. Using cinterop declarations inside the API surface will not be enabled until more stability guarantees for cinterops can be provided ^KT-56115 Verification Pending
This commit is contained in:
committed by
Space Team
parent
d94a9411e0
commit
103fb39306
+8
-2
@@ -158,7 +158,7 @@ internal open class CInteropMetadataDependencyTransformationTask @Inject constru
|
|||||||
get() = sourceSet
|
get() = sourceSet
|
||||||
.compileDependenciesTransformationOrFail
|
.compileDependenciesTransformationOrFail
|
||||||
.metadataDependencyResolutions
|
.metadataDependencyResolutions
|
||||||
.filterIsInstance<ChooseVisibleSourceSets>()
|
.resolutionsToTransform()
|
||||||
|
|
||||||
@Suppress("unused")
|
@Suppress("unused")
|
||||||
@get:Nested
|
@get:Nested
|
||||||
@@ -188,7 +188,7 @@ internal open class CInteropMetadataDependencyTransformationTask @Inject constru
|
|||||||
into this field
|
into this field
|
||||||
*/
|
*/
|
||||||
val transformation = GranularMetadataTransformation(parameters, ParentSourceSetVisibilityProvider.Empty)
|
val transformation = GranularMetadataTransformation(parameters, ParentSourceSetVisibilityProvider.Empty)
|
||||||
val chooseVisibleSourceSets = transformation.metadataDependencyResolutions.filterIsInstance<ChooseVisibleSourceSets>()
|
val chooseVisibleSourceSets = transformation.metadataDependencyResolutions.resolutionsToTransform()
|
||||||
val transformedLibraries = chooseVisibleSourceSets.flatMap(::materializeMetadata)
|
val transformedLibraries = chooseVisibleSourceSets.flatMap(::materializeMetadata)
|
||||||
KotlinMetadataLibrariesIndexFile(outputLibrariesFileIndex.get().asFile).write(transformedLibraries)
|
KotlinMetadataLibrariesIndexFile(outputLibrariesFileIndex.get().asFile).write(transformedLibraries)
|
||||||
}
|
}
|
||||||
@@ -216,5 +216,11 @@ internal open class CInteropMetadataDependencyTransformationTask @Inject constru
|
|||||||
}
|
}
|
||||||
}.files
|
}.files
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private fun Iterable<MetadataDependencyResolution>.resolutionsToTransform(): List<ChooseVisibleSourceSets> {
|
||||||
|
return filterIsInstance<ChooseVisibleSourceSets>()
|
||||||
|
/* We do not care about Project to Project dependencies: Those shall use the commonizer output directly (no transformation) */
|
||||||
|
.filter { it.dependency.id !is ProjectComponentIdentifier }
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user