[Wasm] stdlib NFC: Suppress cast warnings in org.w3c
Also fix dukat build and update copyright year in generated files.
This commit is contained in:
@@ -15,13 +15,13 @@ dependencies {
|
||||
task("downloadIDL", JavaExec::class) {
|
||||
main = "org.jetbrains.kotlin.tools.dukat.DownloadKt"
|
||||
classpath = sourceSets["main"].runtimeClasspath
|
||||
dependsOn(":dukat:build")
|
||||
dependsOn("build")
|
||||
}
|
||||
|
||||
task("generateStdlibFromIDL", JavaExec::class) {
|
||||
main = "org.jetbrains.kotlin.tools.dukat.LaunchJsKt"
|
||||
classpath = sourceSets["main"].runtimeClasspath
|
||||
dependsOn(":dukat:build")
|
||||
dependsOn("build")
|
||||
systemProperty("line.separator", "\n")
|
||||
}
|
||||
|
||||
@@ -30,6 +30,6 @@ task("generateStdlibFromIDL", JavaExec::class) {
|
||||
task("generateWasmStdlibFromIDL", JavaExec::class) {
|
||||
main = "org.jetbrains.kotlin.tools.dukat.LaunchWasmKt"
|
||||
classpath = sourceSets["main"].runtimeClasspath
|
||||
dependsOn(":dukat:build")
|
||||
dependsOn("build")
|
||||
systemProperty("line.separator", "\n")
|
||||
}
|
||||
|
||||
+18
-1
@@ -5,10 +5,27 @@
|
||||
|
||||
package org.jetbrains.kotlin.tools.dukat
|
||||
|
||||
import java.io.File
|
||||
import kotlin.text.Regex
|
||||
|
||||
fun main() {
|
||||
val outputDirectory = "../../stdlib/wasm/src/org.w3c/"
|
||||
launch(
|
||||
outputDirectory = "../../stdlib/wasm/src/org.w3c/",
|
||||
outputDirectory = outputDirectory,
|
||||
dynamicAsType = true,
|
||||
useStaticGetters = true
|
||||
)
|
||||
File(outputDirectory).walk().forEach {
|
||||
if (it.isFile && it.name.endsWith(".kt")) {
|
||||
it.writeText(postProcessIdlBindings(it.readText()))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
fun postProcessIdlBindings(source: String): String {
|
||||
return source
|
||||
.replace(
|
||||
Regex("( {4}return o as \\w+)"),
|
||||
" @Suppress(\"UNCHECKED_CAST_TO_EXTERNAL_INTERFACE\")\n\$1"
|
||||
)
|
||||
}
|
||||
Reference in New Issue
Block a user