diff --git a/kotlin/codegen/src/main/java/com/squareup/moshi/kotlin/codegen/api/ProguardRules.kt b/kotlin/codegen/src/main/java/com/squareup/moshi/kotlin/codegen/api/ProguardRules.kt index b819f44..d7bbdba 100644 --- a/kotlin/codegen/src/main/java/com/squareup/moshi/kotlin/codegen/api/ProguardRules.kt +++ b/kotlin/codegen/src/main/java/com/squareup/moshi/kotlin/codegen/api/ProguardRules.kt @@ -49,27 +49,27 @@ internal data class ProguardConfig( val targetName = targetClass.reflectionName() val adapterCanonicalName = ClassName(targetClass.packageName, adapterName).canonicalName // Keep the class name for Moshi's reflective lookup based on it - appendln("-if class $targetName") - appendln("-keepnames class $targetName") + appendLine("-if class $targetName") + appendLine("-keepnames class $targetName") - appendln("-if class $targetName") - appendln("-keep class $adapterCanonicalName {") + appendLine("-if class $targetName") + appendLine("-keep class $adapterCanonicalName {") // Keep the constructor for Moshi's reflective lookup val constructorArgs = adapterConstructorParams.joinToString(",") - appendln(" public ($constructorArgs);") + appendLine(" public ($constructorArgs);") // Keep any qualifier properties for (qualifierProperty in qualifierProperties) { - appendln(" private com.squareup.moshi.JsonAdapter ${qualifierProperty.name};") + appendLine(" private com.squareup.moshi.JsonAdapter ${qualifierProperty.name};") } - appendln("}") + appendLine("}") qualifierProperties.asSequence() .flatMap { it.qualifiers.asSequence() } .map(ClassName::reflectionName) .sorted() .forEach { qualifier -> - appendln("-if class $targetName") - appendln("-keep @interface $qualifier") + appendLine("-if class $targetName") + appendLine("-keep @interface $qualifier") } if (targetConstructorHasDefaults) { @@ -80,10 +80,10 @@ internal data class ProguardConfig( // synthetic (...); // } // - appendln("-if class $targetName") - appendln("-keepnames class kotlin.jvm.internal.DefaultConstructorMarker") - appendln("-if class $targetName") - appendln("-keepclassmembers class $targetName {") + appendLine("-if class $targetName") + appendLine("-keepnames class kotlin.jvm.internal.DefaultConstructorMarker") + appendLine("-if class $targetName") + appendLine("-keepclassmembers class $targetName {") val allParams = targetConstructorParams.toMutableList() val maskCount = if (targetConstructorParams.isEmpty()) { 0 @@ -95,8 +95,8 @@ internal data class ProguardConfig( } allParams += "kotlin.jvm.internal.DefaultConstructorMarker" val params = allParams.joinToString(",") - appendln(" public synthetic ($params);") - appendln("}") + appendLine(" public synthetic ($params);") + appendLine("}") } } }