Skip to content

Commit 48f7ab5

Browse files
committed
feat(typings): describe Kotlin internals and nullability in generated definitions
Moves the dts-generator to the current main, which changes what the generated definitions describe: - Kotlin internal classes and members no longer appear. The JVM has no internal modifier, so without reading @kotlin.Metadata they were indistinguishable from public API. Their names are also mangled with the module they were compiled in, which differs between debug and release, so nothing could call them across both anyway. - Reference types known to be nullable are described as unions with null. Kotlin metadata states nullability exactly; on the Java side @nullable and @nonnull decide, and what carries neither is left as it was rather than being claimed non-null. Definitions built from android.jar gain 4,565 null unions at compileSdk 35 and change in no other way. - A class defined by several input jars can be generated from all of them at once, for definitions spanning multiple platform jars, where a member a newer platform dropped still has to be described. Off unless asked for. The generator's own command line moved to a double dash spelling, so the task driving it follows. The single dash spelling still works and is what a packaged framework from an older release passes; the two ship together, so they cannot disagree.
1 parent 4fbb006 commit 48f7ab5

2 files changed

Lines changed: 3 additions & 3 deletions

File tree

‎test-app/app/build.gradle‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1053,7 +1053,7 @@ task generateTypescriptDefinitions(type: BuildToolTask) {
10531053
// Resolved against the project when building from source; an empty rootPath leaves it
10541054
// relative to workingDir, which is where the packaged framework keeps the jar.
10551055
paramz.add(Paths.get(rootPath, "dts-generator.jar").toString())
1056-
paramz.add("-input")
1056+
paramz.add("--input")
10571057

10581058
for (String jarPath : allJarLibraries) {
10591059
// don't generate typings for runtime jars and classes
@@ -1062,7 +1062,7 @@ task generateTypescriptDefinitions(type: BuildToolTask) {
10621062
}
10631063
}
10641064

1065-
paramz.add("-output")
1065+
paramz.add("--output")
10661066
paramz.add("$TYPINGS_PATH")
10671067

10681068
new File("$TYPINGS_PATH").mkdirs()

0 commit comments

Comments
 (0)