Skip to content

Commit

Permalink
build: bump kotlinpoet to 1.16.0
Browse files Browse the repository at this point in the history
Address breaking changes
  • Loading branch information
wzieba committed Feb 20, 2024
1 parent b99f498 commit 4775ece
Show file tree
Hide file tree
Showing 10 changed files with 22 additions and 20 deletions.
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ ext {
kotlinxCoroutinesVersion = '1.7.3'
lottieVersion = '6.1.0'
philjayMpAndroidChartVersion = 'v3.1.0'
squareupKotlinPoetVersion = '1.6.0'
squareupKotlinPoetVersion = '1.16.0'
squareupOkioVersion = '3.6.0'
squareupRetrofitVersion = '2.9.0'
uCropVersion = '2.2.8'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ class FeaturesInDevelopmentDefaultsBuilder(private val featuresInDevelopment: Li
.build()
return FileSpec.builder("org.wordpress.android.util.config", "FeaturesInDevelopment")
.addType(remoteConfigDefaults)
.addComment("Automatically generated file. DO NOT MODIFY")
.addFileComment("Automatically generated file. DO NOT MODIFY", arrayOf<Any>())
.indent(" ")
.build()
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package org.wordpress.android.processor

import com.google.auto.service.AutoService
import com.squareup.kotlinpoet.DelicateKotlinPoetApi
import com.squareup.kotlinpoet.TypeName
import com.squareup.kotlinpoet.asTypeName
import org.wordpress.android.annotation.Experiment
Expand All @@ -26,6 +27,7 @@ import javax.tools.Diagnostic.Kind
"org.wordpress.android.annotation.RemoteFieldDefaultGenerater"
)
class RemoteConfigProcessor : AbstractProcessor() {
@OptIn(DelicateKotlinPoetApi::class)
@Suppress("DEPRECATION")
override fun process(p0: MutableSet<out TypeElement>?, roundEnvironment: RoundEnvironment?): Boolean {
val experiments = roundEnvironment?.getElementsAnnotatedWith(Experiment::class.java)?.map { element ->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ class RemoteFeatureConfigCheckBuilder(private val remoteFeatures: List<TypeName>
.build()
return FileSpec.builder("org.wordpress.android.util.config", "RemoteFeatureConfigCheck")
.addType(remoteFeatureConfigDefaults)
.addComment("Automatically generated file. DO NOT MODIFY")
.addFileComment("Automatically generated file. DO NOT MODIFY", arrayOf<Any>())
.indent(" ")
.build()
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ class RemoteFeatureConfigDefaultsBuilder(private val defaults: Map<String, Strin
.build()
return FileSpec.builder("org.wordpress.android.util.config", FILE_NAME)
.addType(remoteConfigDefaults)
.addComment("Automatically generated file. DO NOT MODIFY")
.addFileComment("Automatically generated file. DO NOT MODIFY", arrayOf<Any>())
.indent(" ")
.build()
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ class RemoteFieldConfigDefaultsBuilder(private val defaults: Map<String, String>
.build()
return FileSpec.builder("org.wordpress.android.util.config", FILE_NAME)
.addType(remoteConfigDefaults)
.addComment("Automatically generated file. DO NOT MODIFY")
.addFileComment("Automatically generated file. DO NOT MODIFY", arrayOf<Any>())
.indent(" ")
.build()
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ class FeaturesInDevelopmentDefaultsBuilderTest {
import kotlin.String
import kotlin.collections.List
object FeaturesInDevelopment {
val featuresInDevelopment: List<String> = listOf(
public object FeaturesInDevelopment {
public val featuresInDevelopment: List<String> = listOf(
"$featureA",
"$featureB"
)
Expand All @@ -51,8 +51,8 @@ class FeaturesInDevelopmentDefaultsBuilderTest {
import kotlin.String
import kotlin.collections.List
object FeaturesInDevelopment {
val featuresInDevelopment: List<String> = listOf(
public object FeaturesInDevelopment {
public val featuresInDevelopment: List<String> = listOf(
)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,14 +28,14 @@ class RemoteFeatureConfigCheckBuilderTest {
import org.wordpress.$classA
import org.wordpress.$classB
class RemoteFeatureConfigCheck(
val appConfig: AppConfig
public class RemoteFeatureConfigCheck(
public val appConfig: AppConfig,
) {
val $classA: $classA = $classA(appConfig)
public val $classA: $classA = $classA(appConfig)
val $classB: $classB = $classB(appConfig)
public val $classB: $classB = $classB(appConfig)
fun checkRemoteFields() {
public fun checkRemoteFields() {
if ($classA.remoteField == null) {
throw IllegalArgumentException(""${'"'}org.wordpress.$classA needs to define
remoteField""${'"'})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ class RemoteFeatureConfigDefaultsBuilderTest {
import kotlin.String
import kotlin.collections.Map
object RemoteFeatureConfigDefaults {
val remoteFeatureConfigDefaults: Map<String, Any> = mapOf(
public object RemoteFeatureConfigDefaults {
public val remoteFeatureConfigDefaults: Map<String, Any> = mapOf(
"$keyA" to "$valueA",
"$keyB" to "$valueB"
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ class RemoteFieldConfigDefaultsBuilderTest {
import kotlin.String
import kotlin.collections.Map
object RemoteFieldConfigDefaults {
val remoteFieldConfigDefaults: Map<String, Any> = mapOf(
public object RemoteFieldConfigDefaults {
public val remoteFieldConfigDefaults: Map<String, Any> = mapOf(
"$keyA" to "$valueA",
"$keyB" to "$valueB"
)
Expand Down Expand Up @@ -55,8 +55,8 @@ class RemoteFieldConfigDefaultsBuilderTest {
import kotlin.String
import kotlin.collections.Map
object RemoteFieldConfigDefaults {
val remoteFieldConfigDefaults: Map<String, Any> = mapOf(
public object RemoteFieldConfigDefaults {
public val remoteFieldConfigDefaults: Map<String, Any> = mapOf(
)
}
Expand Down

0 comments on commit 4775ece

Please sign in to comment.