@@ -308,8 +308,8 @@ private fun Project.configureCheckTasks(
308
308
isEnabled = apiCheckEnabled(projectName, extension) && apiBuild.map { it.enabled }.getOrElse(true )
309
309
group = " other"
310
310
description = " Syncs API from build dir to ${targetConfig.apiDir} dir for $projectName "
311
- from = apiBuildDir.get(). resolve(dumpFileName)
312
- to = apiCheckDir.get(). resolve(dumpFileName)
311
+ from.fileProvider(apiBuildDir.map { it. resolve(dumpFileName) } )
312
+ to.fileProvider(apiCheckDir.map { it. resolve(dumpFileName) } )
313
313
dependsOn(apiBuild)
314
314
}
315
315
@@ -385,12 +385,15 @@ private class KlibValidationPipelineBuilder(
385
385
386
386
val klibMerge = project.mergeKlibsUmbrellaTask(klibDumpConfig, klibMergeDir)
387
387
val klibMergeInferred = project.mergeInferredKlibsUmbrellaTask(klibDumpConfig, klibMergeInferredDir)
388
- val klibDump = project.dumpKlibsTask(klibDumpConfig, klibApiDir, klibMergeInferredDir )
388
+ val klibDump = project.dumpKlibsTask(klibDumpConfig)
389
389
val klibExtractAbiForSupportedTargets = project.extractAbi(klibDumpConfig, klibApiDir, klibExtractedFileDir)
390
390
val klibCheck = project.checkKlibsTask(klibDumpConfig, project.provider { klibExtractedFileDir }, klibMergeDir)
391
-
391
+ klibDump.configure {
392
+ it.from.set(klibMergeInferred.flatMap { it.mergedApiFile })
393
+ val filename = project.klibDumpFileName
394
+ it.to.fileProvider(klibApiDir.map { it.resolve(filename) })
395
+ }
392
396
commonApiDump.configure { it.dependsOn(klibDump) }
393
- commonApiCheck.configure { it.dependsOn(klibCheck) }
394
397
395
398
klibDump.configure { it.dependsOn(klibMergeInferred) }
396
399
// Extraction task depends on supportedTargets() provider which returns a set of targets supported
@@ -404,7 +407,7 @@ private class KlibValidationPipelineBuilder(
404
407
klibCheck.configure {
405
408
it.dependsOn(klibExtractAbiForSupportedTargets)
406
409
}
407
-
410
+ commonApiCheck.configure { it.dependsOn(klibCheck) }
408
411
project.configureTargets(klibApiDir, klibMerge, klibMergeInferred)
409
412
}
410
413
@@ -423,16 +426,10 @@ private class KlibValidationPipelineBuilder(
423
426
onlyIf(" There are no klibs compiled for the project" ) { hasCompilableTargets.get() }
424
427
}
425
428
426
- private fun Project.dumpKlibsTask (
427
- klibDumpConfig : TargetConfig ,
428
- klibApiDir : Provider <File >,
429
- klibMergeDir : File
430
- ) = project.task<CopyFile >(klibDumpConfig.apiTaskName(" Dump" )) {
429
+ private fun Project.dumpKlibsTask (klibDumpConfig : TargetConfig ) = project.task<CopyFile >(klibDumpConfig.apiTaskName(" Dump" )) {
431
430
isEnabled = klibAbiCheckEnabled(project.name, extension)
432
431
description = " Syncs a KLib ABI dump from a build dir to the ${klibDumpConfig.apiDir} dir for ${project.name} "
433
432
group = " other"
434
- from = klibMergeDir.resolve(klibDumpFileName)
435
- to = klibApiDir.get().resolve(klibDumpFileName)
436
433
val hasCompilableTargets = project.hasCompilableTargetsPredicate()
437
434
onlyIf(" There are no klibs compiled for the project" ) { hasCompilableTargets.get() }
438
435
}
0 commit comments