Skip to content

Commit

Permalink
Update KotlinPoet to 1.7.2 (#1117)
Browse files Browse the repository at this point in the history
  • Loading branch information
plnice authored Jan 9, 2021
1 parent a108e06 commit 6a9de53
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 6 deletions.
2 changes: 1 addition & 1 deletion blessedDeps.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ rootProject.ext.ANDROID_DATA_BINDING = "1.3.1"
rootProject.ext.ANDROID_ARCH_TESTING = "1.1.1"
rootProject.ext.ANDROID_TEST_RUNNER = "1.0.2"
rootProject.ext.SQUARE_JAVAPOET_VERSION = "1.11.1"
rootProject.ext.SQUARE_KOTLINPOET_VERSION = "1.5.0"
rootProject.ext.SQUARE_KOTLINPOET_VERSION = "1.7.2"
rootProject.ext.KOTLIN_COROUTINES_VERSION = "1.3.9"
rootProject.ext.GLIDE_VERSION = "4.9.0"

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,10 +78,6 @@ internal class KotlinModelBuilderExtensionWriter(
val constructorIsNotPublic =
constructor != null && Modifier.PUBLIC !in constructor.modifiers

// Kotlin cannot directly reference a class with a $ in the name. It must be wrapped in ticks (``)
val useTicksAroundModelName = model.generatedName.simpleName().contains("$")
val tick = if (useTicksAroundModelName) "`" else ""

val initializerLambda = LambdaTypeName.get(
receiver = getBuilderInterfaceTypeName(model).toKPoet(),
returnType = KClassNames.KOTLIN_UNIT
Expand Down Expand Up @@ -112,7 +108,7 @@ internal class KotlinModelBuilderExtensionWriter(

addStatement("add(")
beginControlFlow(
"$tick%T$tick(${params.joinToString(", ") { it.name }}).apply",
"%T(${params.joinToString(", ") { it.name }}).apply",
modelClass
)
addStatement("modelInitializer()")
Expand Down

0 comments on commit 6a9de53

Please sign in to comment.