refactor: remove TypeRef

This commit is contained in:
2025-12-13 22:50:20 +08:00
parent 187b759afd
commit 44f4ee9a99
7 changed files with 56 additions and 172 deletions

View File

@@ -41,8 +41,5 @@ object DeclaredSymbol {
const val MOSHI_COMPANION_CLASS_NAME = "MoshiCompanion"
const val MOSHI_COMPANION_CLASS = "$MOSHI_COMPANION_API_PACKAGE_NAME.$MOSHI_COMPANION_CLASS_NAME"
const val TYPE_REF_CLASS_NAME = "TypeRef"
const val TYPE_REF_CLASS = "$MOSHI_COMPANION_API_PACKAGE_NAME.$TYPE_REF_CLASS_NAME"
const val ADAPTER_REGISTRY_CLASS_NAME = "AdapterRegistry"
}

View File

@@ -273,16 +273,6 @@ class AdapterRegistryGenerator(override val environment: SymbolProcessorEnvironm
appendLine("-keep,allowobfuscation @${DeclaredSymbol.JSON_ANNOTATION_CLASS} class *")
appendLine()
// Keep the `TypeRef` class and its subclasses.
appendLine("-keep,allowobfuscation class ${DeclaredSymbol.TYPE_REF_CLASS} {")
appendLine(" <fields>;")
appendLine(" <methods>;")
appendLine("}")
appendLine()
appendLine("-keep,allowobfuscation class * extends ${DeclaredSymbol.TYPE_REF_CLASS}")
appendLine()
// Keep generic signatures.
appendLine("-keepattributes Signature")
appendLine()