@@ -17,6 +17,21 @@ import org.gradle.api.provider.Property
1717import org.gradle.workers.WorkAction
1818import org.gradle.workers.WorkParameters
1919
20+ /* *
21+ * Infers a possible KLib ABI dump for an unsupported target.
22+ *
23+ * To infer a dump, walk up the default targets hierarchy tree starting from the unsupported
24+ * target until it finds a node corresponding to a group containing least one supported target.
25+ *
26+ * After that, dumps generated for such supported targets are merged and declarations that are
27+ * common to all of them are considered as a common ABI that most likely will be shared by the
28+ * unsupported target.
29+ *
30+ * At the next step, if a project contains an old dump, declarations specific to the unsupported
31+ * target are copied from it and merged into the common ABI extracted previously.
32+ *
33+ * The resulting dump is then used as an inferred dump for the unsupported target.
34+ */
2035@BCVInternalApi
2136@BCVExperimentalApi
2237@OptIn(ExperimentalBCVApi ::class )
@@ -38,6 +53,8 @@ abstract class KLibInferSignaturesWorker : WorkAction<KLibInferSignaturesWorker.
3853 val taskPath: Property <String >
3954 }
4055
56+ private val taskPath: String = parameters.taskPath.get()
57+
4158 override fun execute () {
4259 // Find a set of supported targets that are closer to unsupported target in the hierarchy.
4360 // Note that dumps are stored using configurable name, but grouped by the canonical target name.
@@ -60,7 +77,7 @@ abstract class KLibInferSignaturesWorker : WorkAction<KLibInferSignaturesWorker.
6077 }
6178 if (extantImage == null ) {
6279 logger.warn(
63- " Project's ABI file exists, but empty: ${extantApiDumpFile} . " +
80+ " [ $taskPath ] Project's ABI file exists, but empty: ${extantApiDumpFile} . " +
6481 " The file will be ignored during ABI dump inference for the unsupported target "
6582// + target.get()
6683 )
0 commit comments