From 755a1034f1cba0a4d4dc5d70b60ac3962cd52694 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bernd=20Pr=C3=BCnster?= Date: Tue, 29 Oct 2024 22:56:23 +0100 Subject: [PATCH] JS OID naming workaround --- indispensable-asn1/build.gradle.kts | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/indispensable-asn1/build.gradle.kts b/indispensable-asn1/build.gradle.kts index 942a87e6..5d1dd13a 100644 --- a/indispensable-asn1/build.gradle.kts +++ b/indispensable-asn1/build.gradle.kts @@ -1,9 +1,7 @@ import at.asitplus.gradle.* -import com.squareup.kotlinpoet.ClassName -import com.squareup.kotlinpoet.FileSpec -import com.squareup.kotlinpoet.PropertySpec -import com.squareup.kotlinpoet.TypeSpec +import com.squareup.kotlinpoet.* import org.jetbrains.kotlin.gradle.ExperimentalWasmDsl +import org.jetbrains.kotlin.js.backend.ast.JsName import java.io.FileInputStream import java.util.regex.Pattern @@ -137,8 +135,14 @@ fun generateKnowOIDs() { '.' ) }`: ${oidTriple.comment}" - ) + ).apply { + if(name.matches(Regex("^[0.-9].*"))) + this.addAnnotation(AnnotationSpec.builder(ClassName("kotlin.js","JsName")).addMember("\"_$name\"").build()) + } + + .build() + ) } @@ -152,8 +156,6 @@ fun generateKnowOIDs() { } - - kotlin { jvm() macosArm64()