[Gradle Native] Made eager outputFile in CInteropProcess deprecated
^KT-63206 Fixed
This commit is contained in:
committed by
Space Team
parent
b6ef1e08e1
commit
6219806ab9
+1
-1
@@ -66,7 +66,7 @@ internal val KotlinCreateNativeCInteropTasksSideEffect = KotlinCompilationSideEf
|
||||
// Add the interop library in publication.
|
||||
createKlibArtifact(
|
||||
compilation,
|
||||
artifactFile = interopTask.map { it.outputFile },
|
||||
artifactFile = interopTask.flatMap { it.outputFileProvider },
|
||||
classifier = "cinterop-${interop.name}",
|
||||
producingTask = interopTask,
|
||||
)
|
||||
|
||||
+1
-1
@@ -390,7 +390,7 @@ open class KotlinCocoapodsPlugin : Plugin<Project> {
|
||||
val dependencyTaskName = cinterops.getByName(dependencyPod.moduleName).interopProcessingTaskName
|
||||
val dependencyTask = project.tasks.named<CInteropProcess>(dependencyTaskName)
|
||||
|
||||
interop.dependencyFiles += project.files(dependencyTask.map { it.outputFile }).builtBy(dependencyTask)
|
||||
interop.dependencyFiles += project.files(dependencyTask.flatMap { it.outputFileProvider }).builtBy(dependencyTask)
|
||||
|
||||
dependencyPod.interopBindingDependencies.forEach { transitiveDependency ->
|
||||
addPodDependencyToInterop(project, cocoapodsExtension, pod, cinterops, interop, transitiveDependency)
|
||||
|
||||
+1
-1
@@ -33,7 +33,7 @@ internal fun createCInteropApiElementsKlibArtifact(
|
||||
val project = target.project
|
||||
val configurationName = cInteropApiElementsConfigurationName(target)
|
||||
val configuration = project.configurations.getByName(configurationName)
|
||||
project.artifacts.add(configuration.name, interopTask.map { it.outputFile }) { artifact ->
|
||||
project.artifacts.add(configuration.name, interopTask.flatMap { it.outputFileProvider }) { artifact ->
|
||||
artifact.extension = "klib"
|
||||
artifact.type = "klib"
|
||||
artifact.classifier = "cinterop-${settings.name}"
|
||||
|
||||
+1
-1
@@ -93,6 +93,6 @@ private fun Project.getAllCInteropOutputFiles(compilation: KotlinNativeCompilati
|
||||
val cinteropTasks = compilation.cinterops.map { interop -> interop.interopProcessingTaskName }
|
||||
.mapNotNull { taskName -> tasks.findByName(taskName) as? CInteropProcess }
|
||||
|
||||
return project.filesProvider { cinteropTasks.map { it.outputFile } }
|
||||
return project.filesProvider { cinteropTasks.map { it.outputFileProvider } }
|
||||
.builtBy(*cinteropTasks.toTypedArray())
|
||||
}
|
||||
|
||||
+6
-2
@@ -1093,6 +1093,10 @@ abstract class CInteropProcess @Inject internal constructor(params: Params) :
|
||||
@get:Input
|
||||
val moduleName: String = project.klibModuleName(baseKlibName)
|
||||
|
||||
@Deprecated(
|
||||
"Eager outputFile was replaced with lazy outputFileProvider",
|
||||
replaceWith = ReplaceWith("outputFileProvider")
|
||||
)
|
||||
@get:Internal
|
||||
val outputFile: File
|
||||
get() = outputFileProvider.get()
|
||||
@@ -1201,7 +1205,7 @@ abstract class CInteropProcess @Inject internal constructor(params: Params) :
|
||||
|
||||
val args =
|
||||
mutableListOf<String>().apply {
|
||||
addArg("-o", outputFile.absolutePath)
|
||||
addArg("-o", outputFileProvider.get().absolutePath)
|
||||
|
||||
addArgIfNotNull("-target", konanTarget.visibleName)
|
||||
if (definitionFile.isPresent) {
|
||||
@@ -1235,7 +1239,7 @@ abstract class CInteropProcess @Inject internal constructor(params: Params) :
|
||||
|
||||
}
|
||||
addBuildMetricsForTaskAction(buildMetrics, languageVersion = null) {
|
||||
outputFile.parentFile.mkdirs()
|
||||
outputFileProvider.get().parentFile.mkdirs()
|
||||
KotlinNativeCInteropRunner.createExecutionContext(
|
||||
task = this,
|
||||
isInIdeaSync = isInIdeaSync,
|
||||
|
||||
Reference in New Issue
Block a user