Skip to content

Commit

Permalink
[ABI Validation] Fix KlibDumpFilters factory name
Browse files Browse the repository at this point in the history
  • Loading branch information
fzhinkin authored and shanshin committed Dec 23, 2024
1 parent 6376fe0 commit 979887f
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,7 @@ public final class kotlinx/validation/api/klib/KlibDumpFilters$Companion {

public final class kotlinx/validation/api/klib/KlibDumpFiltersKt {
public static final fun KLibDumpFilters (Lkotlin/jvm/functions/Function1;)Lkotlinx/validation/api/klib/KlibDumpFilters;
public static final fun KlibDumpFilters (Lkotlin/jvm/functions/Function1;)Lkotlinx/validation/api/klib/KlibDumpFilters;
}

public final class kotlinx/validation/api/klib/KlibDumpKt {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ public abstract class KotlinKlibAbiBuildTask : BuildTaskBase() {
outputFile.delete()
outputFile.parentFile.mkdirs()

val dump = KlibDump.fromKlib(klibFile.singleFile, target.get().configurableName, KLibDumpFilters {
val dump = KlibDump.fromKlib(klibFile.singleFile, target.get().configurableName, KlibDumpFilters {
ignoredClasses.addAll(this@KotlinKlibAbiBuildTask.ignoredClasses.get())
ignoredPackages.addAll(this@KotlinKlibAbiBuildTask.ignoredPackages.get())
nonPublicMarkers.addAll(this@KotlinKlibAbiBuildTask.nonPublicMarkers.get())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ public class KlibDumpFilters internal constructor(
* Default KLib ABI dump filters which declares no filters
* and uses the latest KLib ABI signature version available.
*/
public val DEFAULT: KlibDumpFilters = KLibDumpFilters {}
public val DEFAULT: KlibDumpFilters = KlibDumpFilters {}
}
}

Expand All @@ -89,12 +89,30 @@ public class KlibDumpFilters internal constructor(
* Supplied [KlibDumpFilters.Builder] is valid only during the scope of [builderAction] execution.
*/
@ExperimentalBCVApi
@Deprecated(
"Use KlibDumpFilters instead",
ReplaceWith("KlibDumpFilters(builderAction)"),
DeprecationLevel.WARNING
)
public fun KLibDumpFilters(builderAction: KlibDumpFilters.Builder.() -> Unit): KlibDumpFilters {
val builder = KlibDumpFilters.Builder()
builderAction(builder)
return builder.build()
}

/**
* Builds a new [KlibDumpFilters] instance by invoking a [builderAction] on a temporary
* [KlibDumpFilters.Builder] instance and then converting it into filters.
*
* Supplied [KlibDumpFilters.Builder] is valid only during the scope of [builderAction] execution.
*/
@ExperimentalBCVApi
public fun KlibDumpFilters(builderAction: KlibDumpFilters.Builder.() -> Unit): KlibDumpFilters {
val builder = KlibDumpFilters.Builder()
builderAction(builder)
return builder.build()
}

@ExperimentalBCVApi
@OptIn(ExperimentalLibraryAbiReader::class)
internal fun dumpTo(to: Appendable, klibFile: File, filters: KlibDumpFilters) {
Expand Down

0 comments on commit 979887f

Please sign in to comment.