Allow to annotate generated code as jvm-only.
This commit is contained in:
@@ -105,6 +105,7 @@ class GenericFunction(val signature: String, val keyword: String = "fun") {
|
|||||||
val doc = FamilyProperty<String>()
|
val doc = FamilyProperty<String>()
|
||||||
val platformName = PrimitiveProperty<String>()
|
val platformName = PrimitiveProperty<String>()
|
||||||
val inline = FamilyProperty<Boolean>()
|
val inline = FamilyProperty<Boolean>()
|
||||||
|
val jvmOnly = FamilyProperty<Boolean>()
|
||||||
val typeParams = ArrayList<String>()
|
val typeParams = ArrayList<String>()
|
||||||
val returns = FamilyProperty<String>()
|
val returns = FamilyProperty<String>()
|
||||||
val operator = FamilyProperty<Boolean>()
|
val operator = FamilyProperty<Boolean>()
|
||||||
@@ -364,6 +365,10 @@ class GenericFunction(val signature: String, val keyword: String = "fun") {
|
|||||||
?.let { platformName -> builder.append("@kotlin.jvm.JvmName(\"${platformName}\")\n")}
|
?.let { platformName -> builder.append("@kotlin.jvm.JvmName(\"${platformName}\")\n")}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (jvmOnly[f] ?: false) {
|
||||||
|
builder.append("@kotlin.jvm.JvmVersion\n")
|
||||||
|
}
|
||||||
|
|
||||||
annotations[f]?.let { builder.append(it).append('\n') }
|
annotations[f]?.let { builder.append(it).append('\n') }
|
||||||
|
|
||||||
builder.append("public ")
|
builder.append("public ")
|
||||||
|
|||||||
@@ -258,5 +258,7 @@ fun specialJVM(): List<GenericFunction> {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
templates.forEach { it.jvmOnly(true) }
|
||||||
|
|
||||||
return templates
|
return templates
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user