@@ -70,7 +70,7 @@ public open class BuildConfigJavaGenerator(
7070 }
7171
7272 if (spec.documentation != null ) {
73- typeSpec.addJavadoc($$ " $L " , spec.documentation)
73+ typeSpec.addJavadoc(" \ $ L" , spec.documentation)
7474 }
7575
7676 spec.fields.forEach { field ->
@@ -99,7 +99,7 @@ public open class BuildConfigJavaGenerator(
9999 initializer(format, * args)
100100 }
101101
102- is BuildConfigValue .Expression -> initializer($$ " $L " , value.value)
102+ is BuildConfigValue .Expression -> initializer(" \ $ L" , value.value)
103103 is BuildConfigValue .Expect -> error(" `expect/actual` values are not supported in Java: $value " )
104104 }
105105 }.build()
@@ -137,15 +137,15 @@ public open class BuildConfigJavaGenerator(
137137 }
138138
139139 fun TypeName?.format () = when (if (this ?.isBoxedPrimitive == true ) unbox() else this ) {
140- TypeName .BYTE -> $$ " (byte) $L "
141- TypeName .CHAR -> $$ " ' $L '"
142- TypeName .SHORT -> $$ " (short) $L "
143- TypeName .LONG -> $$ " $LL "
144- TypeName .FLOAT -> $$ " $Lf "
145- STRING -> $$ " $S "
146- FILE -> $$ " new java.io.File($S )"
147- URI -> $$ " java.net.URI.create($S )"
148- else -> $$ " $L "
140+ TypeName .BYTE -> " (byte) \ $ L"
141+ TypeName .CHAR -> " ' \ $ L'"
142+ TypeName .SHORT -> " (short) \ $ L"
143+ TypeName .LONG -> " \ $ LL"
144+ TypeName .FLOAT -> " \ $ Lf"
145+ STRING -> " \ $ S"
146+ FILE -> " new java.io.File(\ $ S)"
147+ URI -> " java.net.URI.create(\ $ S)"
148+ else -> " \ $ L"
149149 }
150150
151151 fun List<Any?>.format (prefix : String , postfix : String , elementType : TypeName ? ) = joinToString(
0 commit comments