Skip to content

Commit ab037a0

Browse files
authored
chore: upgrade to AGP 8.0 (#1476)
* chore: upgrade to AGP 8.0 * chore: update gh actions to jdk 17 * add jvm args for ktlint * chore: compile with jvmTarget 1.8 * chore(config): compile with jvmTarget 1.8 * chore: use Java 17 for lint * chore(*): update android build tools version to 8.0
1 parent 47520d7 commit ab037a0

33 files changed

+123
-28
lines changed

.github/workflows/android.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,10 @@ jobs:
99
runs-on: ubuntu-latest
1010
steps:
1111
- uses: actions/checkout@v2
12-
- name: set up JDK 11
12+
- name: set up JDK 17
1313
uses: actions/setup-java@v1
1414
with:
15-
java-version: 11
15+
java-version: 17
1616
- name: Check Snippets
1717
run: python scripts/checksnippets.py
1818
- name: Copy mock google_services.json

admob/app/build.gradle

+7-2
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,13 @@ android {
3232
excludes += ['LICENSE.txt']
3333
}
3434
}
35-
36-
35+
compileOptions {
36+
sourceCompatibility JavaVersion.VERSION_11
37+
targetCompatibility JavaVersion.VERSION_11
38+
}
39+
kotlinOptions {
40+
jvmTarget = '11'
41+
}
3742
buildFeatures {
3843
viewBinding = true
3944
}

admob/build.gradle

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ buildscript {
77
mavenCentral()
88
}
99
dependencies {
10-
classpath 'com.android.tools.build:gradle:7.4.2'
10+
classpath 'com.android.tools.build:gradle:8.0.0'
1111
classpath 'com.google.gms:google-services:4.3.15'
1212
classpath 'org.jetbrains.kotlin:kotlin-gradle-plugin:1.8.20'
1313
}

analytics/app/build.gradle

+8
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,14 @@ android {
2727
}
2828
}
2929

30+
compileOptions {
31+
sourceCompatibility JavaVersion.VERSION_11
32+
targetCompatibility JavaVersion.VERSION_11
33+
}
34+
kotlinOptions {
35+
jvmTarget = '11'
36+
}
37+
3038
buildFeatures {
3139
viewBinding = true
3240
}

analytics/build.gradle

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ buildscript {
77
mavenCentral()
88
}
99
dependencies {
10-
classpath 'com.android.tools.build:gradle:7.4.2'
10+
classpath 'com.android.tools.build:gradle:8.0.0'
1111
classpath 'com.google.gms:google-services:4.3.15'
1212
classpath 'org.jetbrains.kotlin:kotlin-gradle-plugin:1.8.20'
1313
}

appdistribution/app/build.gradle

+7-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,13 @@ android {
2424
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
2525
}
2626
}
27-
27+
compileOptions {
28+
sourceCompatibility JavaVersion.VERSION_11
29+
targetCompatibility JavaVersion.VERSION_11
30+
}
31+
kotlinOptions {
32+
jvmTarget = '11'
33+
}
2834

2935
buildFeatures {
3036
viewBinding = true

appdistribution/build.gradle

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ buildscript {
99
}
1010
dependencies {
1111
classpath 'com.google.gms:google-services:4.3.15'
12-
classpath 'com.android.tools.build:gradle:7.4.2'
12+
classpath 'com.android.tools.build:gradle:8.0.0'
1313
classpath 'org.jetbrains.kotlin:kotlin-gradle-plugin:1.8.20'
1414
}
1515
}

auth/app/build.gradle

+5-2
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,11 @@ android {
2929
}
3030

3131
compileOptions {
32-
sourceCompatibility 1.8
33-
targetCompatibility 1.8
32+
sourceCompatibility JavaVersion.VERSION_11
33+
targetCompatibility JavaVersion.VERSION_11
34+
}
35+
kotlinOptions {
36+
jvmTarget = '11'
3437
}
3538

3639
buildFeatures {

auth/build.gradle

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ buildscript {
77
mavenCentral()
88
}
99
dependencies {
10-
classpath 'com.android.tools.build:gradle:7.4.2'
10+
classpath 'com.android.tools.build:gradle:8.0.0'
1111
classpath 'com.google.gms:google-services:4.3.15'
1212
classpath 'org.jetbrains.kotlin:kotlin-gradle-plugin:1.8.20'
1313
}

build.gradle

+2-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ buildscript {
55
mavenLocal()
66
}
77
dependencies {
8-
classpath 'com.android.tools.build:gradle:7.4.2'
8+
classpath 'com.android.tools.build:gradle:8.0.0'
99
classpath 'org.jetbrains.kotlin:kotlin-gradle-plugin:1.8.20'
1010

1111
classpath 'com.google.gms:google-services:4.3.15'
@@ -84,6 +84,7 @@ task("ktlint", type: JavaExec, group: "verification") {
8484
"--reporter=checkstyle,output=${outputFile}",
8585
"**/*.kt",
8686
]
87+
jvmArgs "--add-opens=java.base/java.lang=ALL-UNNAMED"
8788
}
8889

8990
task clean(type: Delete) {

config/app/build.gradle

+7
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,13 @@ android {
2626
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
2727
}
2828
}
29+
compileOptions {
30+
sourceCompatibility JavaVersion.VERSION_11
31+
targetCompatibility JavaVersion.VERSION_11
32+
}
33+
kotlinOptions {
34+
jvmTarget = '11'
35+
}
2936

3037
buildFeatures {
3138
viewBinding = true

config/build.gradle

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ buildscript {
77
mavenCentral()
88
}
99
dependencies {
10-
classpath 'com.android.tools.build:gradle:7.4.2'
10+
classpath 'com.android.tools.build:gradle:8.0.0'
1111
classpath 'com.google.gms:google-services:4.3.15'
1212
classpath 'org.jetbrains.kotlin:kotlin-gradle-plugin:1.8.20'
1313
}

crash/app/build.gradle

+7
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,13 @@ android {
3131
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
3232
}
3333
}
34+
compileOptions {
35+
sourceCompatibility JavaVersion.VERSION_11
36+
targetCompatibility JavaVersion.VERSION_11
37+
}
38+
kotlinOptions {
39+
jvmTarget = '11'
40+
}
3441

3542
buildFeatures {
3643
viewBinding = true

crash/build.gradle

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ buildscript {
77
mavenCentral()
88
}
99
dependencies {
10-
classpath 'com.android.tools.build:gradle:7.4.2'
10+
classpath 'com.android.tools.build:gradle:8.0.0'
1111
classpath 'com.google.gms:google-services:4.3.15'
1212
classpath 'com.google.firebase:firebase-crashlytics-gradle:2.9.4'
1313
classpath 'org.jetbrains.kotlin:kotlin-gradle-plugin:1.8.20'

database/app/build.gradle

+7
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,13 @@ android {
2727
signingConfig signingConfigs.debug
2828
}
2929
}
30+
compileOptions {
31+
sourceCompatibility JavaVersion.VERSION_11
32+
targetCompatibility JavaVersion.VERSION_11
33+
}
34+
kotlinOptions {
35+
jvmTarget = '11'
36+
}
3037

3138
buildFeatures {
3239
viewBinding = true

database/build.gradle

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ buildscript {
77
mavenCentral()
88
}
99
dependencies {
10-
classpath 'com.android.tools.build:gradle:7.4.2'
10+
classpath 'com.android.tools.build:gradle:8.0.0'
1111
classpath 'com.google.gms:google-services:4.3.15'
1212
classpath 'org.jetbrains.kotlin:kotlin-gradle-plugin:1.8.20'
1313
}

dynamiclinks/app/build.gradle

+7
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,13 @@ android {
3939
resValue "string", "dynamic_links_uri_prefix", "https://YOUR_APP.page.link"
4040
}
4141
}
42+
compileOptions {
43+
sourceCompatibility JavaVersion.VERSION_11
44+
targetCompatibility JavaVersion.VERSION_11
45+
}
46+
kotlinOptions {
47+
jvmTarget = '11'
48+
}
4249

4350
buildFeatures {
4451
viewBinding = true

dynamiclinks/build.gradle

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ buildscript {
77
mavenCentral()
88
}
99
dependencies {
10-
classpath 'com.android.tools.build:gradle:7.4.2'
10+
classpath 'com.android.tools.build:gradle:8.0.0'
1111
classpath 'com.google.gms:google-services:4.3.15'
1212
classpath 'org.jetbrains.kotlin:kotlin-gradle-plugin:1.8.20'
1313
}

firestore/app/build.gradle

+7
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,13 @@ android {
3434
signingConfig signingConfigs.debug
3535
}
3636
}
37+
compileOptions {
38+
sourceCompatibility JavaVersion.VERSION_11
39+
targetCompatibility JavaVersion.VERSION_11
40+
}
41+
kotlinOptions {
42+
jvmTarget = '11'
43+
}
3744

3845
buildFeatures {
3946
viewBinding = true

firestore/build.gradle

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ buildscript {
77
mavenLocal()
88
}
99
dependencies {
10-
classpath 'com.android.tools.build:gradle:7.4.2'
10+
classpath 'com.android.tools.build:gradle:8.0.0'
1111
classpath 'com.google.gms:google-services:4.3.15'
1212
classpath 'org.jetbrains.kotlin:kotlin-gradle-plugin:1.8.20'
1313
classpath 'androidx.navigation:navigation-safe-args-gradle-plugin:2.5.3'

functions/app/build.gradle

+7
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,13 @@ android {
2828
signingConfig signingConfigs.debug
2929
}
3030
}
31+
compileOptions {
32+
sourceCompatibility JavaVersion.VERSION_11
33+
targetCompatibility JavaVersion.VERSION_11
34+
}
35+
kotlinOptions {
36+
jvmTarget = '11'
37+
}
3138

3239
buildFeatures {
3340
viewBinding = true

functions/build.gradle

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ buildscript {
77
mavenCentral()
88
}
99
dependencies {
10-
classpath 'com.android.tools.build:gradle:7.4.2'
10+
classpath 'com.android.tools.build:gradle:8.0.0'
1111
classpath 'com.google.gms:google-services:4.3.15'
1212
classpath 'org.jetbrains.kotlin:kotlin-gradle-plugin:1.8.20'
1313
}

gradle.properties

+4-1
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,11 @@
1-
org.gradle.jvmargs=-Xmx6g -XX:MaxPermSize=6g -XX:ReservedCodeCacheSize=2g -Dfile.encoding=UTF-8
1+
org.gradle.jvmargs=-Xmx6g -XX:MaxMetaspaceSize=6g -XX:ReservedCodeCacheSize=2g -Dfile.encoding=UTF-8
22
# TODO there's a bug when using parallel modules: https://issuetracker.google.com/issues/62805436
33
org.gradle.parallel=true
44
org.gradle.configureondemand=true
55
org.gradle.caching=true
66

77
## Play and Firebase moving to AndroidX
88
android.useAndroidX=true
9+
android.defaults.buildfeatures.buildconfig=true
10+
android.nonTransitiveRClass=false
11+
android.nonFinalResIds=false
+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
distributionBase=GRADLE_USER_HOME
22
distributionPath=wrapper/dists
3-
distributionUrl=https\://services.gradle.org/distributions/gradle-7.5.1-bin.zip
3+
distributionUrl=https\://services.gradle.org/distributions/gradle-8.0.2-bin.zip
44
zipStoreBase=GRADLE_USER_HOME
55
zipStorePath=wrapper/dists

inappmessaging/app/build.gradle

+7-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,13 @@ android {
2424
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
2525
}
2626
}
27-
27+
compileOptions {
28+
sourceCompatibility JavaVersion.VERSION_11
29+
targetCompatibility JavaVersion.VERSION_11
30+
}
31+
kotlinOptions {
32+
jvmTarget = '11'
33+
}
2834

2935
buildFeatures {
3036
viewBinding = true

inappmessaging/build.gradle

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ buildscript {
99
}
1010
dependencies {
1111
classpath 'com.google.gms:google-services:4.3.15'
12-
classpath 'com.android.tools.build:gradle:7.4.2'
12+
classpath 'com.android.tools.build:gradle:8.0.0'
1313
classpath 'org.jetbrains.kotlin:kotlin-gradle-plugin:1.8.20'
1414
}
1515
}

internal/lint/build.gradle

+3-3
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,12 @@ repositories {
88
}
99

1010
java {
11-
targetCompatibility = JavaVersion.VERSION_11
12-
sourceCompatibility = JavaVersion.VERSION_11
11+
targetCompatibility = JavaVersion.VERSION_17
12+
sourceCompatibility = JavaVersion.VERSION_17
1313
}
1414

1515
compileKotlin {
16-
kotlinOptions.jvmTarget = "11"
16+
kotlinOptions.jvmTarget = "17"
1717
}
1818

1919
dependencies {

messaging/app/build.gradle

+7
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,13 @@ android {
3232
excludes += ['LICENSE.txt']
3333
}
3434
}
35+
compileOptions {
36+
sourceCompatibility JavaVersion.VERSION_11
37+
targetCompatibility JavaVersion.VERSION_11
38+
}
39+
kotlinOptions {
40+
jvmTarget = '11'
41+
}
3542

3643

3744
buildFeatures {

messaging/build.gradle

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ buildscript {
77
mavenCentral()
88
}
99
dependencies {
10-
classpath 'com.android.tools.build:gradle:7.4.2'
10+
classpath 'com.android.tools.build:gradle:8.0.0'
1111
classpath 'com.google.gms:google-services:4.3.15'
1212
classpath 'org.jetbrains.kotlin:kotlin-gradle-plugin:1.8.20'
1313
}

perf/app/build.gradle

+7
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,13 @@ android {
3333
}
3434
}
3535
}
36+
compileOptions {
37+
sourceCompatibility JavaVersion.VERSION_11
38+
targetCompatibility JavaVersion.VERSION_11
39+
}
40+
kotlinOptions {
41+
jvmTarget = '11'
42+
}
3643
buildFeatures {
3744
viewBinding = true
3845
}

perf/build.gradle

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ buildscript {
77
mavenLocal()
88
}
99
dependencies {
10-
classpath 'com.android.tools.build:gradle:7.4.2'
10+
classpath 'com.android.tools.build:gradle:8.0.0'
1111
classpath 'com.google.firebase:perf-plugin:1.4.2'
1212
classpath 'com.google.gms:google-services:4.3.15'
1313
classpath 'org.jetbrains.kotlin:kotlin-gradle-plugin:1.8.20'

storage/app/build.gradle

+7
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,13 @@ android {
2525
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
2626
}
2727
}
28+
compileOptions {
29+
sourceCompatibility JavaVersion.VERSION_11
30+
targetCompatibility JavaVersion.VERSION_11
31+
}
32+
kotlinOptions {
33+
jvmTarget = '11'
34+
}
2835

2936
buildFeatures {
3037
viewBinding = true

storage/build.gradle

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ buildscript {
77
mavenCentral()
88
}
99
dependencies {
10-
classpath 'com.android.tools.build:gradle:7.4.2'
10+
classpath 'com.android.tools.build:gradle:8.0.0'
1111
classpath 'com.google.gms:google-services:4.3.15'
1212
classpath 'org.jetbrains.kotlin:kotlin-gradle-plugin:1.8.20'
1313
}

0 commit comments

Comments
 (0)