From f80179f4ddfae7efe3d630621d99a30951dd2287 Mon Sep 17 00:00:00 2001 From: Filipp Zhinkin Date: Thu, 1 Feb 2024 17:50:05 +0100 Subject: [PATCH] Add some kdoc --- src/main/kotlin/KotlinKlibAbiBuildTask.kt | 14 ++++++++++++- ...otlinKlibExtractSupportedTargetsAbiTask.kt | 15 +++++++++++++ ...linKlibInferAbiForUnsupportedTargetTask.kt | 21 ++++++++++++++++++- src/main/kotlin/KotlinKlibMergeAbiTask.kt | 12 +++++++++++ 4 files changed, 60 insertions(+), 2 deletions(-) diff --git a/src/main/kotlin/KotlinKlibAbiBuildTask.kt b/src/main/kotlin/KotlinKlibAbiBuildTask.kt index 36a44ca8..bc24ceda 100644 --- a/src/main/kotlin/KotlinKlibAbiBuildTask.kt +++ b/src/main/kotlin/KotlinKlibAbiBuildTask.kt @@ -13,20 +13,32 @@ import org.gradle.api.tasks.TaskAction import org.jetbrains.kotlin.library.abi.* /** - * Generates a text file with a ABI dump for a single klib. + * Generates a text file with a KLib ABI dump for a single klib. */ public abstract class KotlinKlibAbiBuildTask : BuildTaskBase() { + /** + * Path to a klib to dump. + */ @InputFiles public lateinit var klibFile: FileCollection + /** + * Bind this task with a klib compilation. + */ @InputFiles public lateinit var compilationDependencies: FileCollection + /** + * Refer to [KlibValidationSettings.signatureVersion] for details. + */ @Optional @get:Input public var signatureVersion: Int? = null + /** + * Name of a target [klibFile] was compiled for. + */ @Input public lateinit var target: String diff --git a/src/main/kotlin/KotlinKlibExtractSupportedTargetsAbiTask.kt b/src/main/kotlin/KotlinKlibExtractSupportedTargetsAbiTask.kt index 12401f02..12c03708 100644 --- a/src/main/kotlin/KotlinKlibExtractSupportedTargetsAbiTask.kt +++ b/src/main/kotlin/KotlinKlibExtractSupportedTargetsAbiTask.kt @@ -20,18 +20,33 @@ public abstract class KotlinKlibExtractSupportedTargetsAbiTask : DefaultTask() { @get:Internal internal val projectName = project.name + /** + * Merged KLib dump that should be filtered by this task. + */ @InputFiles public lateinit var inputAbiFile: File + /** + * A path to the resulting dump file. + */ @OutputFile public lateinit var outputAbiFile: File + /** + * Provider returning targets supported by the host compiler. + */ @get:Input public lateinit var targets: Provider> + /** + * Refer to [KlibValidationSettings.strictValidation] for details. + */ @Input public var strictValidation: Boolean = false + /** + * Refer to [KlibValidationSettings.useTargetGroupAliases] for details. + */ @Input public var groupTargetNames: Boolean = true diff --git a/src/main/kotlin/KotlinKlibInferAbiForUnsupportedTargetTask.kt b/src/main/kotlin/KotlinKlibInferAbiForUnsupportedTargetTask.kt index 977bd74f..66e5ccf3 100644 --- a/src/main/kotlin/KotlinKlibInferAbiForUnsupportedTargetTask.kt +++ b/src/main/kotlin/KotlinKlibInferAbiForUnsupportedTargetTask.kt @@ -16,7 +16,7 @@ import java.io.File /** * Task infers a possible KLib ABI dump for an unsupported target. - * To infer a dump, tasks walks up the default targets hierarchy tree starting from the unsupported + * To infer a dump, tasks walk up the default targets hierarchy tree starting from the unsupported * target until it finds a node corresponding to a group of targets having at least one supported target. * After that, dumps generated for such supported targets are merged and declarations that are common to all * of them are considered as a common ABI that most likely will be shared by the unsupported target. @@ -28,21 +28,40 @@ public abstract class KotlinKlibInferAbiForUnsupportedTargetTask : DefaultTask() @get:Internal internal val projectName = project.name + /** + * The name of a target to infer a dump for. + */ @Input public lateinit var unsupportedTarget: String + /** + * A root directory containing dumps successfully generated for each supported target. + * It is assumed that this directory contains subdirectories named after targets. + */ @InputFiles public lateinit var outputApiDir: String + /** + * Set of all supported targets. + */ @Input public lateinit var supportedTargets: Set + /** + * Previously generated merged ABI dump file, the golden image every dump should be verified against. + */ @InputFiles public lateinit var inputImageFile: File + /** + * The name of a dump file. + */ @Input public lateinit var dumpFileName: String + /** + * A path to an inferred dump file. + */ @OutputFile public lateinit var outputFile: File diff --git a/src/main/kotlin/KotlinKlibMergeAbiTask.kt b/src/main/kotlin/KotlinKlibMergeAbiTask.kt index cf616628..81a13dca 100644 --- a/src/main/kotlin/KotlinKlibMergeAbiTask.kt +++ b/src/main/kotlin/KotlinKlibMergeAbiTask.kt @@ -22,16 +22,28 @@ public abstract class KotlinKlibMergeAbiTask : DefaultTask() { @get:Internal internal val projectName = project.name + /** + * Set of targets whose dumps should be merged. + */ @get:Input public val targets: Set get() = targetToFile.keys + /** + * A path to a resulting merged dump. + */ @OutputFile public lateinit var mergedFile: File + /** + * The name of a dump file. + */ @Input public lateinit var dumpFileName: String + /** + * Refer to [KlibValidationSettings.useTargetGroupAliases] for details. + */ @Input public var groupTargetNames: Boolean = true