Skip to content

Commit

Permalink
Add some kdoc
Browse files Browse the repository at this point in the history
  • Loading branch information
fzhinkin committed Feb 5, 2024
1 parent 3ae8921 commit 89c588e
Show file tree
Hide file tree
Showing 4 changed files with 60 additions and 2 deletions.
14 changes: 13 additions & 1 deletion src/main/kotlin/KotlinKlibAbiBuildTask.kt
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
15 changes: 15 additions & 0 deletions src/main/kotlin/KotlinKlibExtractSupportedTargetsAbiTask.kt
Original file line number Diff line number Diff line change
Expand Up @@ -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<Set<String>>

/**
* Refer to [KlibValidationSettings.strictValidation] for details.
*/
@Input
public var strictValidation: Boolean = false

/**
* Refer to [KlibValidationSettings.useTargetGroupAliases] for details.
*/
@Input
public var groupTargetNames: Boolean = true

Expand Down
21 changes: 20 additions & 1 deletion src/main/kotlin/KotlinKlibInferAbiForUnsupportedTargetTask.kt
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -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<String>

/**
* 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

Expand Down
12 changes: 12 additions & 0 deletions src/main/kotlin/KotlinKlibMergeAbiTask.kt
Original file line number Diff line number Diff line change
Expand Up @@ -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<String>
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

Expand Down

0 comments on commit 89c588e

Please sign in to comment.