From ecca5122a0e3471e1c1b6a9f9a9a254b8d2ac992 Mon Sep 17 00:00:00 2001 From: Zac Sweers Date: Tue, 1 Sep 2020 01:13:55 -0400 Subject: [PATCH] Switch to new appendLine APIs appendLn is deprecated in kotlin 1.4 --- .../moshi/kotlin/codegen/api/ProguardRules.kt | 30 +++++++++---------- 1 file changed, 15 insertions(+), 15 deletions(-) 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("}") } } }