mirror of
https://github.com/mamoe/mirai.git
synced 2025-01-10 18:40:15 +08:00
Update codegen, rearrange entry point
This commit is contained in:
parent
3743d9230e
commit
907b2ad946
@ -9,27 +9,28 @@
|
||||
|
||||
package net.mamoe.mirai.console.codegen
|
||||
|
||||
object SettingCodegen {
|
||||
object PrimitiveValuesCodegen : RegionCodegen(), DefaultInvoke {
|
||||
override val defaultInvokeArgs: List<KtType>
|
||||
get() = KtType.Primitives + KtString
|
||||
|
||||
override fun StringBuilder.apply(ktType: KtType) {
|
||||
@Suppress("ClassName")
|
||||
appendKCode(
|
||||
"""
|
||||
object ValueKtCodegen {
|
||||
object SettingCodegen {
|
||||
object PrimitiveValuesCodegen : RegionCodegen(), DefaultInvoke {
|
||||
override val defaultInvokeArgs: List<KtType>
|
||||
get() = KtType.Primitives + KtString
|
||||
|
||||
override fun StringBuilder.apply(ktType: KtType) {
|
||||
@Suppress("ClassName")
|
||||
appendKCode(
|
||||
"""
|
||||
/**
|
||||
* Represents a non-null [$ktType] value.
|
||||
*/
|
||||
interface ${ktType}Value : PrimitiveValue<$ktType>
|
||||
"""
|
||||
)
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
object ValueKtCodegen {
|
||||
@JvmStatic
|
||||
fun main(args: Array<String>) {
|
||||
codegen("Value.kt") {
|
@ -119,10 +119,4 @@ fun String.findFileSmart(): File = kotlin.run {
|
||||
}
|
||||
}.also {
|
||||
require(it.exists()) { "file doesn't exist" }
|
||||
}
|
||||
|
||||
fun main() {
|
||||
codegen("Value.kt") {
|
||||
SettingCodegen.PrimitiveValuesCodegen()
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user