mirror of
https://github.com/mamoe/mirai.git
synced 2025-01-10 18:40:15 +08:00
Suppress("PRE_RELEASE_CLASS")
This commit is contained in:
parent
a26b607f35
commit
5551d2f048
@ -7,7 +7,7 @@
|
||||
* https://github.com/mamoe/mirai/blob/master/LICENSE
|
||||
*/
|
||||
|
||||
@file:Suppress("FunctionName", "INVISIBLE_MEMBER", "INVISIBLE_REFERENCE")
|
||||
@file:Suppress("FunctionName", "INVISIBLE_MEMBER", "INVISIBLE_REFERENCE", "PRE_RELEASE_CLASS")
|
||||
|
||||
package net.mamoe.mirai.console.codegen
|
||||
|
||||
|
@ -1,3 +1,5 @@
|
||||
@file:Suppress("PRE_RELEASE_CLASS")
|
||||
|
||||
package net.mamoe.mirai.console.codegen
|
||||
|
||||
/**
|
||||
@ -5,46 +7,44 @@ package net.mamoe.mirai.console.codegen
|
||||
*/
|
||||
|
||||
|
||||
|
||||
|
||||
open class JClazz(val primitiveName:String,val packageName:String){
|
||||
open val funName:String = "value"
|
||||
open class JClazz(val primitiveName: String, val packageName: String) {
|
||||
open val funName: String = "value"
|
||||
}
|
||||
|
||||
class JListClazz(val item:JClazz):JClazz("List<${item.packageName}>","List<${item.packageName}>"){
|
||||
class JListClazz(val item: JClazz) : JClazz("List<${item.packageName}>", "List<${item.packageName}>") {
|
||||
override val funName = item.primitiveName.toLowerCase() + "List"
|
||||
}
|
||||
|
||||
class JArrayClazz(item:JClazz):JClazz(item.primitiveName + "[]",item.primitiveName + "[]")
|
||||
|
||||
class JMapClazz(key:JClazz,value:JClazz):JClazz("Map<${key.packageName},${value.packageName}>","Map<${key.packageName},${value.packageName}>")
|
||||
class JArrayClazz(item: JClazz) : JClazz(item.primitiveName + "[]", item.primitiveName + "[]")
|
||||
|
||||
class JMapClazz(key: JClazz, value: JClazz) :
|
||||
JClazz("Map<${key.packageName},${value.packageName}>", "Map<${key.packageName},${value.packageName}>")
|
||||
|
||||
|
||||
internal val J_NUMBERS = listOf(
|
||||
JClazz("int","Integer"),
|
||||
JClazz("short","Short"),
|
||||
JClazz("byte","Byte"),
|
||||
JClazz("long","Long"),
|
||||
JClazz("float","Float"),
|
||||
JClazz("double","Double")
|
||||
JClazz("int", "Integer"),
|
||||
JClazz("short", "Short"),
|
||||
JClazz("byte", "Byte"),
|
||||
JClazz("long", "Long"),
|
||||
JClazz("float", "Float"),
|
||||
JClazz("double", "Double")
|
||||
)
|
||||
|
||||
internal val J_EXTRA = listOf(
|
||||
JClazz("String","String"),
|
||||
JClazz("boolean","Boolean"),
|
||||
JClazz("char","Char")
|
||||
JClazz("String", "String"),
|
||||
JClazz("boolean", "Boolean"),
|
||||
JClazz("char", "Char")
|
||||
)
|
||||
|
||||
|
||||
fun JClazz.getTemplate():String = """
|
||||
fun JClazz.getTemplate(): String = """
|
||||
@NotNull default Value<${this.packageName}> $funName(${this.primitiveName} defaultValue){
|
||||
return _SettingKt.value(this,defaultValue);
|
||||
}
|
||||
"""
|
||||
|
||||
|
||||
fun main(){
|
||||
fun main() {
|
||||
println(buildString {
|
||||
appendLine(COPYRIGHT)
|
||||
appendLine()
|
||||
@ -74,7 +74,7 @@ fun main(){
|
||||
appendLine(JArrayClazz(it).getTemplate())
|
||||
}
|
||||
|
||||
(J_EXTRA + J_NUMBERS).forEach {key ->
|
||||
(J_EXTRA + J_NUMBERS).forEach { key ->
|
||||
(J_EXTRA + J_NUMBERS).forEach { value ->
|
||||
appendLine(JMapClazz(key, value).getTemplate())
|
||||
}
|
||||
|
@ -6,6 +6,7 @@
|
||||
*
|
||||
* https://github.com/mamoe/mirai/blob/master/LICENSE
|
||||
*/
|
||||
@file:Suppress("PRE_RELEASE_CLASS")
|
||||
|
||||
package net.mamoe.mirai.console.codegen
|
||||
|
||||
|
@ -6,6 +6,7 @@
|
||||
*
|
||||
* https://github.com/mamoe/mirai/blob/master/LICENSE
|
||||
*/
|
||||
@file:Suppress("PRE_RELEASE_CLASS")
|
||||
|
||||
package net.mamoe.mirai.console.codegen
|
||||
|
||||
|
@ -7,6 +7,8 @@
|
||||
* https://github.com/mamoe/mirai/blob/master/LICENSE
|
||||
*/
|
||||
|
||||
@file:Suppress("PRE_RELEASE_CLASS")
|
||||
|
||||
package net.mamoe.mirai.console.codegen
|
||||
|
||||
|
||||
|
@ -6,7 +6,7 @@
|
||||
*
|
||||
* https://github.com/mamoe/mirai/blob/master/LICENSE
|
||||
*/
|
||||
@file:Suppress("ClassName", "unused")
|
||||
@file:Suppress("ClassName", "unused", "PRE_RELEASE_CLASS")
|
||||
|
||||
package net.mamoe.mirai.console.codegen
|
||||
|
||||
|
@ -7,7 +7,7 @@
|
||||
* https://github.com/mamoe/mirai/blob/master/LICENSE
|
||||
*/
|
||||
|
||||
@file:Suppress("NOTHING_TO_INLINE", "MemberVisibilityCanBePrivate", "unused")
|
||||
@file:Suppress("NOTHING_TO_INLINE", "MemberVisibilityCanBePrivate", "unused","PRE_RELEASE_CLASS")
|
||||
|
||||
package net.mamoe.mirai.console.codegen
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user