Skip to content

Commit

Permalink
chore: upgrade to AGP 8.0 (#1476)
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
thatfiredev authored Apr 20, 2023
1 parent 47520d7 commit ab037a0
Show file tree
Hide file tree
Showing 33 changed files with 123 additions and 28 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/android.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: set up JDK 11
- name: set up JDK 17
uses: actions/setup-java@v1
with:
java-version: 11
java-version: 17
- name: Check Snippets
run: python scripts/checksnippets.py
- name: Copy mock google_services.json
Expand Down
9 changes: 7 additions & 2 deletions admob/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,13 @@ android {
excludes += ['LICENSE.txt']
}
}


compileOptions {
sourceCompatibility JavaVersion.VERSION_11
targetCompatibility JavaVersion.VERSION_11
}
kotlinOptions {
jvmTarget = '11'
}
buildFeatures {
viewBinding = true
}
Expand Down
2 changes: 1 addition & 1 deletion admob/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ buildscript {
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:7.4.2'
classpath 'com.android.tools.build:gradle:8.0.0'
classpath 'com.google.gms:google-services:4.3.15'
classpath 'org.jetbrains.kotlin:kotlin-gradle-plugin:1.8.20'
}
Expand Down
8 changes: 8 additions & 0 deletions analytics/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,14 @@ android {
}
}

compileOptions {
sourceCompatibility JavaVersion.VERSION_11
targetCompatibility JavaVersion.VERSION_11
}
kotlinOptions {
jvmTarget = '11'
}

buildFeatures {
viewBinding = true
}
Expand Down
2 changes: 1 addition & 1 deletion analytics/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ buildscript {
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:7.4.2'
classpath 'com.android.tools.build:gradle:8.0.0'
classpath 'com.google.gms:google-services:4.3.15'
classpath 'org.jetbrains.kotlin:kotlin-gradle-plugin:1.8.20'
}
Expand Down
8 changes: 7 additions & 1 deletion appdistribution/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,13 @@ android {
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}

compileOptions {
sourceCompatibility JavaVersion.VERSION_11
targetCompatibility JavaVersion.VERSION_11
}
kotlinOptions {
jvmTarget = '11'
}

buildFeatures {
viewBinding = true
Expand Down
2 changes: 1 addition & 1 deletion appdistribution/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ buildscript {
}
dependencies {
classpath 'com.google.gms:google-services:4.3.15'
classpath 'com.android.tools.build:gradle:7.4.2'
classpath 'com.android.tools.build:gradle:8.0.0'
classpath 'org.jetbrains.kotlin:kotlin-gradle-plugin:1.8.20'
}
}
Expand Down
7 changes: 5 additions & 2 deletions auth/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,11 @@ android {
}

compileOptions {
sourceCompatibility 1.8
targetCompatibility 1.8
sourceCompatibility JavaVersion.VERSION_11
targetCompatibility JavaVersion.VERSION_11
}
kotlinOptions {
jvmTarget = '11'
}

buildFeatures {
Expand Down
2 changes: 1 addition & 1 deletion auth/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ buildscript {
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:7.4.2'
classpath 'com.android.tools.build:gradle:8.0.0'
classpath 'com.google.gms:google-services:4.3.15'
classpath 'org.jetbrains.kotlin:kotlin-gradle-plugin:1.8.20'
}
Expand Down
3 changes: 2 additions & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ buildscript {
mavenLocal()
}
dependencies {
classpath 'com.android.tools.build:gradle:7.4.2'
classpath 'com.android.tools.build:gradle:8.0.0'
classpath 'org.jetbrains.kotlin:kotlin-gradle-plugin:1.8.20'

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

task clean(type: Delete) {
Expand Down
7 changes: 7 additions & 0 deletions config/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,13 @@ android {
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_11
targetCompatibility JavaVersion.VERSION_11
}
kotlinOptions {
jvmTarget = '11'
}

buildFeatures {
viewBinding = true
Expand Down
2 changes: 1 addition & 1 deletion config/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ buildscript {
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:7.4.2'
classpath 'com.android.tools.build:gradle:8.0.0'
classpath 'com.google.gms:google-services:4.3.15'
classpath 'org.jetbrains.kotlin:kotlin-gradle-plugin:1.8.20'
}
Expand Down
7 changes: 7 additions & 0 deletions crash/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,13 @@ android {
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_11
targetCompatibility JavaVersion.VERSION_11
}
kotlinOptions {
jvmTarget = '11'
}

buildFeatures {
viewBinding = true
Expand Down
2 changes: 1 addition & 1 deletion crash/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ buildscript {
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:7.4.2'
classpath 'com.android.tools.build:gradle:8.0.0'
classpath 'com.google.gms:google-services:4.3.15'
classpath 'com.google.firebase:firebase-crashlytics-gradle:2.9.4'
classpath 'org.jetbrains.kotlin:kotlin-gradle-plugin:1.8.20'
Expand Down
7 changes: 7 additions & 0 deletions database/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,13 @@ android {
signingConfig signingConfigs.debug
}
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_11
targetCompatibility JavaVersion.VERSION_11
}
kotlinOptions {
jvmTarget = '11'
}

buildFeatures {
viewBinding = true
Expand Down
2 changes: 1 addition & 1 deletion database/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ buildscript {
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:7.4.2'
classpath 'com.android.tools.build:gradle:8.0.0'
classpath 'com.google.gms:google-services:4.3.15'
classpath 'org.jetbrains.kotlin:kotlin-gradle-plugin:1.8.20'
}
Expand Down
7 changes: 7 additions & 0 deletions dynamiclinks/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,13 @@ android {
resValue "string", "dynamic_links_uri_prefix", "https://YOUR_APP.page.link"
}
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_11
targetCompatibility JavaVersion.VERSION_11
}
kotlinOptions {
jvmTarget = '11'
}

buildFeatures {
viewBinding = true
Expand Down
2 changes: 1 addition & 1 deletion dynamiclinks/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ buildscript {
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:7.4.2'
classpath 'com.android.tools.build:gradle:8.0.0'
classpath 'com.google.gms:google-services:4.3.15'
classpath 'org.jetbrains.kotlin:kotlin-gradle-plugin:1.8.20'
}
Expand Down
7 changes: 7 additions & 0 deletions firestore/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,13 @@ android {
signingConfig signingConfigs.debug
}
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_11
targetCompatibility JavaVersion.VERSION_11
}
kotlinOptions {
jvmTarget = '11'
}

buildFeatures {
viewBinding = true
Expand Down
2 changes: 1 addition & 1 deletion firestore/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ buildscript {
mavenLocal()
}
dependencies {
classpath 'com.android.tools.build:gradle:7.4.2'
classpath 'com.android.tools.build:gradle:8.0.0'
classpath 'com.google.gms:google-services:4.3.15'
classpath 'org.jetbrains.kotlin:kotlin-gradle-plugin:1.8.20'
classpath 'androidx.navigation:navigation-safe-args-gradle-plugin:2.5.3'
Expand Down
7 changes: 7 additions & 0 deletions functions/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,13 @@ android {
signingConfig signingConfigs.debug
}
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_11
targetCompatibility JavaVersion.VERSION_11
}
kotlinOptions {
jvmTarget = '11'
}

buildFeatures {
viewBinding = true
Expand Down
2 changes: 1 addition & 1 deletion functions/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ buildscript {
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:7.4.2'
classpath 'com.android.tools.build:gradle:8.0.0'
classpath 'com.google.gms:google-services:4.3.15'
classpath 'org.jetbrains.kotlin:kotlin-gradle-plugin:1.8.20'
}
Expand Down
5 changes: 4 additions & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
org.gradle.jvmargs=-Xmx6g -XX:MaxPermSize=6g -XX:ReservedCodeCacheSize=2g -Dfile.encoding=UTF-8
org.gradle.jvmargs=-Xmx6g -XX:MaxMetaspaceSize=6g -XX:ReservedCodeCacheSize=2g -Dfile.encoding=UTF-8
# TODO there's a bug when using parallel modules: https://issuetracker.google.com/issues/62805436
org.gradle.parallel=true
org.gradle.configureondemand=true
org.gradle.caching=true

## Play and Firebase moving to AndroidX
android.useAndroidX=true
android.defaults.buildfeatures.buildconfig=true
android.nonTransitiveRClass=false
android.nonFinalResIds=false
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.5.1-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.0.2-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
8 changes: 7 additions & 1 deletion inappmessaging/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,13 @@ android {
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}

compileOptions {
sourceCompatibility JavaVersion.VERSION_11
targetCompatibility JavaVersion.VERSION_11
}
kotlinOptions {
jvmTarget = '11'
}

buildFeatures {
viewBinding = true
Expand Down
2 changes: 1 addition & 1 deletion inappmessaging/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ buildscript {
}
dependencies {
classpath 'com.google.gms:google-services:4.3.15'
classpath 'com.android.tools.build:gradle:7.4.2'
classpath 'com.android.tools.build:gradle:8.0.0'
classpath 'org.jetbrains.kotlin:kotlin-gradle-plugin:1.8.20'
}
}
Expand Down
6 changes: 3 additions & 3 deletions internal/lint/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@ repositories {
}

java {
targetCompatibility = JavaVersion.VERSION_11
sourceCompatibility = JavaVersion.VERSION_11
targetCompatibility = JavaVersion.VERSION_17
sourceCompatibility = JavaVersion.VERSION_17
}

compileKotlin {
kotlinOptions.jvmTarget = "11"
kotlinOptions.jvmTarget = "17"
}

dependencies {
Expand Down
7 changes: 7 additions & 0 deletions messaging/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,13 @@ android {
excludes += ['LICENSE.txt']
}
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_11
targetCompatibility JavaVersion.VERSION_11
}
kotlinOptions {
jvmTarget = '11'
}


buildFeatures {
Expand Down
2 changes: 1 addition & 1 deletion messaging/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ buildscript {
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:7.4.2'
classpath 'com.android.tools.build:gradle:8.0.0'
classpath 'com.google.gms:google-services:4.3.15'
classpath 'org.jetbrains.kotlin:kotlin-gradle-plugin:1.8.20'
}
Expand Down
7 changes: 7 additions & 0 deletions perf/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,13 @@ android {
}
}
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_11
targetCompatibility JavaVersion.VERSION_11
}
kotlinOptions {
jvmTarget = '11'
}
buildFeatures {
viewBinding = true
}
Expand Down
2 changes: 1 addition & 1 deletion perf/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ buildscript {
mavenLocal()
}
dependencies {
classpath 'com.android.tools.build:gradle:7.4.2'
classpath 'com.android.tools.build:gradle:8.0.0'
classpath 'com.google.firebase:perf-plugin:1.4.2'
classpath 'com.google.gms:google-services:4.3.15'
classpath 'org.jetbrains.kotlin:kotlin-gradle-plugin:1.8.20'
Expand Down
7 changes: 7 additions & 0 deletions storage/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,13 @@ android {
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_11
targetCompatibility JavaVersion.VERSION_11
}
kotlinOptions {
jvmTarget = '11'
}

buildFeatures {
viewBinding = true
Expand Down
2 changes: 1 addition & 1 deletion storage/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ buildscript {
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:7.4.2'
classpath 'com.android.tools.build:gradle:8.0.0'
classpath 'com.google.gms:google-services:4.3.15'
classpath 'org.jetbrains.kotlin:kotlin-gradle-plugin:1.8.20'
}
Expand Down

0 comments on commit ab037a0

Please sign in to comment.