Skip to content

Commit 487ff48

Browse files
committed
Fix some Gradle warnings
Show all warnings to help migrate to Gradle 9.
1 parent 97c7c8a commit 487ff48

File tree

2 files changed

+10
-5
lines changed

2 files changed

+10
-5
lines changed

app/build.gradle

+8-4
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
2+
13
/*
24
* The contents of this file are subject to the Common Public Attribution License Version 1.0.
35
* (the "License"); you may not use this file except in compliance with the License.
@@ -195,8 +197,8 @@ android {
195197
// Gradle ignores any variants that satisfy the conditions above.
196198
setIgnore(true)
197199
}
198-
199200
}
201+
200202
packagingOptions {
201203
resources {
202204
excludes += ['.readme']
@@ -205,8 +207,8 @@ android {
205207

206208
// Taken from: https://stackoverflow.com/a/59583066/3969362
207209
// Needed to customize our APK file name per flavor
208-
applicationVariants.all { variant ->
209-
variant.outputs.all { output ->
210+
applicationVariants.configureEach { variant ->
211+
variant.outputs.configureEach { output ->
210212
//def appId = variant.applicationId// com.exampleFree.app OR com.examplePaid.app
211213
def versionName = variant.versionName
212214
//def versionCode = variant.versionCode // e.g 1.0
@@ -239,6 +241,8 @@ android {
239241
buildFeatures {
240242
// That should give us both view and data binding
241243
dataBinding true
244+
// We notably use build config to define our sponsorships
245+
buildConfig true
242246
}
243247
lint {
244248
abortOnError true
@@ -388,7 +392,7 @@ kapt {
388392
}
389393
}
390394

391-
tasks.withType(org.jetbrains.kotlin.gradle.tasks.KotlinCompile).all {
395+
tasks.withType(KotlinCompile).configureEach {
392396
sourceCompatibility = JavaVersion.VERSION_1_8
393397
targetCompatibility = JavaVersion.VERSION_1_8
394398

gradle.properties

+2-1
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,10 @@ org.gradle.configureondemand=true
2020
org.gradle.jvmargs=-Xmx4096M -Dkotlin.daemon.jvm.options\="-Xmx4096M" -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8
2121
android.useAndroidX=true
2222
kotlin.incremental=false
23-
android.defaults.buildfeatures.buildconfig=true
2423
android.nonTransitiveRClass=false
2524
android.nonFinalResIds=false
25+
# Show all warnings to help migrating to Gradle 9
26+
org.gradle.warning.mode=all
2627

2728
# Those guys seems to be useful to debug kapt issues
2829
# See: https://youtrack.jetbrains.com/issue/KT-40750

0 commit comments

Comments
 (0)