Skip to content

Commit 3fec60c

Browse files
authored
Merge pull request #17197 from wordpress-mobile/analysis/processors-all-warnings-as-errors
[Compile Warnings As Errors] Processors Module - Resolve Warnings & Enable All Warnings as Errors
2 parents 9b62703 + fab2ded commit 3fec60c

File tree

5 files changed

+15
-7
lines changed

5 files changed

+15
-7
lines changed

build.gradle

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ plugins {
1212
ext {
1313
wordPressUtilsVersion = '2.7.0'
1414
wordPressLoginVersion = '0.19.0'
15+
aztecVersion = 'v1.6.0'
1516
gutenbergMobileVersion = 'v1.82.1'
1617
storiesVersion = '1.4.0'
1718
aboutAutomatticVersion = '0.0.6'
@@ -44,6 +45,10 @@ ext {
4445

4546
composeVersion = '1.1.1'
4647

48+
// annotations/processors
49+
kotlinPoetVersion = '1.6.0'
50+
autoServiceVersion = '1.0'
51+
4752
// testing
4853
jUnitVersion = '4.13'
4954
jUnitExtVersion = '1.1.3'

libs/editor/build.gradle

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,6 @@ plugins {
44
id "org.jetbrains.kotlin.plugin.parcelize"
55
}
66

7-
ext.aztecVersion = 'v1.6.0'
8-
97
repositories {
108
maven {
119
url "https://a8c-libs.s3.amazonaws.com/android"

libs/processors/build.gradle

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,11 @@ plugins {
33
id "org.jetbrains.kotlin.kapt"
44
}
55

6-
ext.kotlinPoetVersion = '1.6.0'
7-
ext.autoServiceVersion = '1.0'
6+
compileKotlin {
7+
kotlinOptions {
8+
allWarningsAsErrors = true
9+
}
10+
}
811

912
dependencies {
1013
implementation project(':libs:annotations')

libs/processors/src/main/java/org/wordpress/android/processor/RemoteConfigCheckBuilder.kt

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ import com.squareup.kotlinpoet.TypeSpec
1111
import java.util.Locale
1212

1313
class RemoteConfigCheckBuilder(private val remoteFeatures: List<TypeName>) {
14+
@Suppress("DEPRECATION")
1415
fun getContent(): FileSpec {
1516
val remoteFeaturesWithNames = remoteFeatures.map {
1617
it.toString()
@@ -49,10 +50,10 @@ class RemoteConfigCheckBuilder(private val remoteFeatures: List<TypeName>) {
4950
private fun buildCheckFunction(remoteFeatures: List<Pair<String, TypeName>>): CodeBlock {
5051
val stringBuilder = StringBuilder()
5152
remoteFeatures.forEach { feature ->
52-
stringBuilder.appendln("if (${feature.first}.remoteField == null) {")
53+
stringBuilder.appendLine("if (${feature.first}.remoteField == null) {")
5354
val error = " throw IllegalArgumentException(\"\"\"${feature.second} needs to define remoteField\"\"\")"
54-
stringBuilder.appendln(error)
55-
stringBuilder.appendln("}")
55+
stringBuilder.appendLine(error)
56+
stringBuilder.appendLine("}")
5657
}
5758
return CodeBlock.of(stringBuilder.toString().trimIndent())
5859
}

libs/processors/src/main/java/org/wordpress/android/processor/RemoteConfigProcessor.kt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ import javax.tools.Diagnostic.Kind
2424
"org.wordpress.android.annotation.FeatureInDevelopment"
2525
)
2626
class RemoteConfigProcessor : AbstractProcessor() {
27+
@Suppress("DEPRECATION")
2728
override fun process(p0: MutableSet<out TypeElement>?, roundEnvironment: RoundEnvironment?): Boolean {
2829
val experiments = roundEnvironment?.getElementsAnnotatedWith(Experiment::class.java)?.map { element ->
2930
val annotation = element.getAnnotation(Experiment::class.java)

0 commit comments

Comments
 (0)