[Gradle] Remove c-interop dependency to main compilation's output

This commit is contained in:
sebastian.sellmair
2021-07-09 14:22:35 +02:00
committed by Space
parent 8e6f84d5cd
commit 7b5a3f8d1b
2 changed files with 3 additions and 21 deletions
@@ -282,15 +282,6 @@ open class KotlinNativeTargetConfigurator<T : KotlinNativeTarget> : AbstractKotl
defineConfigurationsForCInterop(compilation, it, target, configurations) defineConfigurationsForCInterop(compilation, it, target, configurations)
} }
} }
if (createTestCompilation) {
val mainCompilation = target.compilations.getByName(MAIN_COMPILATION_NAME)
target.compilations.findByName(TEST_COMPILATION_NAME)?.apply {
cinterops.all {
it.dependencyFiles += mainCompilation.output.allOutputs
}
}
}
} }
protected fun configureBinaries(target: KotlinNativeTarget) { protected fun configureBinaries(target: KotlinNativeTarget) {
@@ -33,8 +33,7 @@ internal open class CInteropCommonizerTask : AbstractCInteropCommonizerTask() {
@get:Input val identifier: CInteropIdentifier, @get:Input val identifier: CInteropIdentifier,
@get:Input val konanTarget: KonanTarget, @get:Input val konanTarget: KonanTarget,
@get:Internal val sourceSets: Provider<Set<KotlinSourceSet>>, @get:Internal val sourceSets: Provider<Set<KotlinSourceSet>>,
@get:Classpath val libraryFile: Provider<File>, @get:Classpath val libraryFile: Provider<File>
@get:Classpath val dependencies: FileCollection
) { ) {
@Suppress("unused") // Used for UP-TO-DATE check @Suppress("unused") // Used for UP-TO-DATE check
@get:Input @get:Input
@@ -98,8 +97,7 @@ internal open class CInteropCommonizerTask : AbstractCInteropCommonizerTask() {
konanHome = project.file(project.konanHome), konanHome = project.file(project.konanHome),
outputTargets = parameters.targets, outputTargets = parameters.targets,
inputLibraries = cinteropsForTarget.map { it.libraryFile.get() }.filter { it.exists() }.toSet(), inputLibraries = cinteropsForTarget.map { it.libraryFile.get() }.filter { it.exists() }.toSet(),
dependencyLibraries = cinteropsForTarget.flatMap { it.dependencies.files }.map(::NonTargetedCommonizerDependency).toSet() dependencyLibraries = getNativeDistributionDependencies(parameters),
+ getNativeDistributionDependencies(parameters),
outputDirectory = outputDirectory(parameters), outputDirectory = outputDirectory(parameters),
logLevel = project.commonizerLogLevel logLevel = project.commonizerLogLevel
) )
@@ -177,14 +175,7 @@ private fun CInteropProcess.toGist(): CInteropGist {
konanTarget = konanTarget, konanTarget = konanTarget,
// FIXME support cinterop with PM20 // FIXME support cinterop with PM20
sourceSets = project.provider { (settings.compilation as? KotlinCompilation<*>)?.kotlinSourceSetsIncludingDefault }, sourceSets = project.provider { (settings.compilation as? KotlinCompilation<*>)?.kotlinSourceSetsIncludingDefault },
libraryFile = outputFileProvider, libraryFile = outputFileProvider
/**
* See: KT-46109
* For now, c-interop commonization is invoked for all relevant files together.
* Using dependencies coming e.g. from a different Gradle project requires additional design.
*/
dependencies = project.files()
) )
} }