Skip to content

Commit 8dc53fa

Browse files
davidmotsonrlazoDavid Motsonashvili
authored
upgrade kotlin, gradle, AGP (#5886)
Co-authored-by: Rodrigo Lazo Paz <[email protected]> Co-authored-by: Rodrigo Lazo <[email protected]> Co-authored-by: David Motsonashvili <[email protected]>
1 parent ddae42d commit 8dc53fa

File tree

97 files changed

+455
-793
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

97 files changed

+455
-793
lines changed

.github/workflows/api-information.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,10 @@ jobs:
1111
with:
1212
fetch-depth: 2
1313
submodules: true
14-
- name: Set up JDK 11
14+
- name: Set up JDK 17
1515
uses: actions/setup-java@v3
1616
with:
17-
java-version: 11
17+
java-version: 17
1818
distribution: temurin
1919
cache: gradle
2020
- name: Set up Python 3.10

.github/workflows/build-release-artifacts.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,10 @@ jobs:
1414
steps:
1515
- uses: actions/[email protected]
1616

17-
- name: Set up JDK 11
17+
- name: Set up JDK 17
1818
uses: actions/setup-java@v3
1919
with:
20-
java-version: 11
20+
java-version: 17
2121
distribution: temurin
2222
cache: gradle
2323

.github/workflows/build-src-check.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,10 @@ jobs:
1414
runs-on: ubuntu-22.04
1515
steps:
1616
- uses: actions/[email protected]
17-
- name: Set up JDK 11
17+
- name: Set up JDK 17
1818
uses: actions/setup-java@v3
1919
with:
20-
java-version: 11
20+
java-version: 17
2121
distribution: temurin
2222
cache: gradle
2323
- name: buildSrc Tests

.github/workflows/ci_tests.yml

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,10 @@ jobs:
2121
fetch-depth: 2
2222
submodules: true
2323

24-
- name: Set up JDK 11
24+
- name: Set up JDK 17
2525
uses: actions/setup-java@v3
2626
with:
27-
java-version: 11
27+
java-version: 17
2828
distribution: temurin
2929
cache: gradle
3030

@@ -49,10 +49,10 @@ jobs:
4949
fetch-depth: 2
5050
submodules: true
5151

52-
- name: Set up JDK 11
52+
- name: Set up JDK 17
5353
uses: actions/setup-java@v3
5454
with:
55-
java-version: 11
55+
java-version: 17
5656
distribution: temurin
5757
cache: gradle
5858

@@ -105,10 +105,10 @@ jobs:
105105
fetch-depth: 2
106106
submodules: true
107107

108-
- name: Set up JDK 11
108+
- name: Set up JDK 17
109109
uses: actions/setup-java@v3
110110
with:
111-
java-version: 11
111+
java-version: 17
112112
distribution: temurin
113113
cache: gradle
114114

@@ -146,10 +146,10 @@ jobs:
146146
fetch-depth: 2
147147
submodules: true
148148

149-
- name: Set up JDK 11
149+
- name: Set up JDK 17
150150
uses: actions/setup-java@v3
151151
with:
152-
java-version: 11
152+
java-version: 17
153153
distribution: temurin
154154
cache: gradle
155155

@@ -216,10 +216,10 @@ jobs:
216216
fetch-depth: 2
217217
submodules: true
218218

219-
- name: Set up JDK 11
219+
- name: Set up JDK 17
220220
uses: actions/setup-java@v3
221221
with:
222-
java-version: 11
222+
java-version: 17
223223
distribution: temurin
224224
cache: gradle
225225

.github/workflows/config-e2e.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ jobs:
2020
- name: Checkout firebase-config
2121
uses: actions/[email protected]
2222

23-
- name: set up JDK 11
23+
- name: set up JDK 17
2424
uses: actions/setup-java@v3
2525
with:
2626
java-version: '11'

.github/workflows/diff-javadoc.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,10 @@ jobs:
1818
fetch-depth: 2
1919
submodules: true
2020

21-
- name: Set up JDK 11
21+
- name: Set up JDK 17
2222
uses: actions/setup-java@v3
2323
with:
24-
java-version: 11
24+
java-version: 17
2525
distribution: temurin
2626
cache: gradle
2727

.github/workflows/fireperf-e2e.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,10 @@ jobs:
2727
repository: FirebasePrivate/firebase-android-buildtools
2828
token: ${{ secrets.GOOGLE_OSS_BOT_TOKEN }}
2929
path: firebase-android-buildtools
30-
- name: Set up JDK 11
30+
- name: Set up JDK 17
3131
uses: actions/setup-java@v3
3232
with:
33-
java-version: 11
33+
java-version: 17
3434
distribution: temurin
3535
cache: gradle
3636
- name: Set up Python 3.10

.github/workflows/health-metrics.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -28,10 +28,10 @@ jobs:
2828
with:
2929
fetch-depth: 2
3030
submodules: true
31-
- name: Set up JDK 11
31+
- name: Set up JDK 17
3232
uses: actions/setup-java@v3
3333
with:
34-
java-version: 11
34+
java-version: 17
3535
distribution: temurin
3636
cache: gradle
3737
- name: Set up Python 3.10
@@ -63,10 +63,10 @@ jobs:
6363
with:
6464
fetch-depth: 2
6565
submodules: true
66-
- name: Set up JDK 11
66+
- name: Set up JDK 17
6767
uses: actions/setup-java@v3
6868
with:
69-
java-version: 11
69+
java-version: 17
7070
distribution: temurin
7171
cache: gradle
7272
- name: Set up Python 3.10
@@ -99,10 +99,10 @@ jobs:
9999
with:
100100
fetch-depth: 2
101101
submodules: true
102-
- name: Set up JDK 11
102+
- name: Set up JDK 17
103103
uses: actions/setup-java@v3
104104
with:
105-
java-version: 11
105+
java-version: 17
106106
distribution: temurin
107107
cache: gradle
108108
- name: Set up Python 3.10

.github/workflows/make-bom.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,10 @@ jobs:
1212
with:
1313
python-version: '3.10'
1414
- uses: actions/[email protected]
15-
- name: Set up JDK 11
15+
- name: Set up JDK 17
1616
uses: actions/setup-java@v3
1717
with:
18-
java-version: 11
18+
java-version: 17
1919
distribution: temurin
2020
cache: gradle
2121

.github/workflows/sessions-e2e.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ jobs:
2020
- name: Checkout firebase-sessions
2121
uses: actions/[email protected]
2222

23-
- name: set up JDK 11
23+
- name: set up JDK 17
2424
uses: actions/setup-java@v3
2525
with:
2626
java-version: '11'

.github/workflows/smoke-tests.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,10 @@ jobs:
1111
with:
1212
fetch-depth: 2
1313
submodules: true
14-
- name: Set up JDK 11
14+
- name: Set up JDK 17
1515
uses: actions/setup-java@v3
1616
with:
17-
java-version: 11
17+
java-version: 17
1818
distribution: temurin
1919
cache: gradle
2020
- uses: google-github-actions/auth@v2

README.md

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -214,21 +214,8 @@ your app module's build.gradle.
214214

215215
#### Java
216216

217-
Java code in this repo is formatted with the google-java-format tool. You can
218-
enable this formatting in Android Studio by downloading and installing the
219-
[google-java-format plugin](https://github.com/google/google-java-format).
220-
The plugin is disabled by default, but the repo contains configuration information
221-
and links to additional plugins.
217+
N/A for now
222218

223-
To run formatting on your entire project you can run
224-
```bash
225-
./gradlew :<firebase-project>:googleJavaFormat
226-
```
227-
228-
To auto-format, just run
229-
```bash
230-
./gradlew :<firebase-project>:gJf
231-
```
232219

233220
#### Kotlin
234221

appcheck/firebase-appcheck-debug-testing/firebase-appcheck-debug-testing.gradle

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,6 @@ android {
4141
sourceCompatibility JavaVersion.VERSION_1_8
4242
targetCompatibility JavaVersion.VERSION_1_8
4343
}
44-
4544
testOptions.unitTests.includeAndroidResources = true
4645
}
4746

appcheck/firebase-appcheck/firebase-appcheck.gradle

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ android {
4040
sourceCompatibility JavaVersion.VERSION_1_8
4141
targetCompatibility JavaVersion.VERSION_1_8
4242
}
43-
43+
kotlinOptions { jvmTarget = "1.8" }
4444
testOptions.unitTests.includeAndroidResources = true
4545
}
4646

@@ -67,8 +67,8 @@ dependencies {
6767
testImplementation "com.google.truth:truth:$googleTruthVersion"
6868
testImplementation 'junit:junit:4.12'
6969
testImplementation 'junit:junit:4.13-beta-2'
70-
testImplementation 'org.mockito:mockito-core:2.25.0'
71-
testImplementation 'org.mockito:mockito-inline:2.25.0'
70+
testImplementation 'org.mockito:mockito-core:5.2.0'
71+
testImplementation 'org.mockito:mockito-inline:5.2.0'
7272
testImplementation "org.robolectric:robolectric:$robolectricVersion"
7373

7474
androidTestImplementation project(':appcheck:firebase-appcheck')

build.gradle

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,6 @@ buildscript {
3535
dependencies {
3636
classpath 'com.google.protobuf:protobuf-gradle-plugin:0.9.4'
3737
classpath 'net.ltgt.gradle:gradle-errorprone-plugin:3.1.0'
38-
classpath 'gradle.plugin.com.github.sherter.google-java-format:google-java-format-gradle-plugin:0.9'
3938
classpath 'com.google.gms:google-services:4.3.15'
4039
classpath "com.ncorti.ktfmt.gradle:plugin:0.11.0"
4140
classpath 'com.google.firebase:firebase-appdistribution-gradle:3.0.2'
@@ -71,10 +70,6 @@ firebaseContinuousIntegration {
7170
]
7271
}
7372

74-
if(JavaVersion.current() != JavaVersion.VERSION_11){
75-
throw new GradleException("This build must be run with java 11. You're using ${JavaVersion.current()}.")
76-
}
77-
7873
configure(subprojects) {
7974
repositories {
8075
google()

buildSrc/build.gradle.kts

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,7 @@
1414

1515
plugins {
1616
id("com.ncorti.ktfmt.gradle") version "0.11.0"
17-
id("com.github.sherter.google-java-format") version "0.9"
18-
kotlin("plugin.serialization") version "1.7.10"
17+
kotlin("plugin.serialization") version "1.8.22"
1918
`kotlin-dsl`
2019
}
2120

@@ -32,11 +31,6 @@ repositories {
3231
// Refer go/fireperf-plugin-test-on-head for more details.
3332
val perfPluginVersion = System.getenv("FIREBASE_PERF_PLUGIN_VERSION") ?: "1.4.1"
3433

35-
googleJavaFormat {
36-
toolVersion = "1.15.0"
37-
exclude(".gradle/**")
38-
}
39-
4034
ktfmt {
4135
googleStyle()
4236
}
@@ -48,7 +42,7 @@ dependencies {
4842
implementation("com.google.firebase:perf-plugin:$perfPluginVersion")
4943
implementation("com.google.auto.value:auto-value-annotations:1.8.1")
5044
annotationProcessor("com.google.auto.value:auto-value:1.6.5")
51-
implementation(kotlin("gradle-plugin", "1.7.10"))
45+
implementation(kotlin("gradle-plugin", "1.8.22"))
5246
implementation("org.json:json:20210307")
5347

5448
implementation("org.eclipse.aether:aether-api:1.0.0.v20140518")
@@ -65,9 +59,8 @@ dependencies {
6559

6660
implementation(libs.kotlinx.serialization.json)
6761
implementation("com.google.code.gson:gson:2.8.9")
68-
implementation("com.android.tools.build:gradle:7.4.2")
69-
implementation("com.android.tools.build:builder-test-api:7.4.2")
70-
implementation("gradle.plugin.com.github.sherter.google-java-format:google-java-format-gradle-plugin:0.9")
62+
implementation("com.android.tools.build:gradle:8.2.1")
63+
implementation("com.android.tools.build:builder-test-api:8.2.1")
7164

7265
testImplementation(libs.bundles.kotest)
7366
testImplementation("junit:junit:4.13.2")

buildSrc/src/main/java/com/google/firebase/gradle/plugins/FirebaseJavaLibraryPlugin.kt

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,6 @@
1616

1717
package com.google.firebase.gradle.plugins
1818

19-
import com.github.sherter.googlejavaformatgradleplugin.GoogleJavaFormatExtension
20-
import com.github.sherter.googlejavaformatgradleplugin.GoogleJavaFormatPlugin
2119
import com.google.common.collect.ImmutableList
2220
import com.google.firebase.gradle.plugins.LibraryType.JAVA
2321
import com.google.firebase.gradle.plugins.semver.ApiDiffer
@@ -28,7 +26,6 @@ import org.gradle.api.plugins.JavaLibraryPlugin
2826
import org.gradle.api.plugins.JavaPluginConvention
2927
import org.gradle.kotlin.dsl.apply
3028
import org.gradle.kotlin.dsl.create
31-
import org.gradle.kotlin.dsl.getByType
3229
import org.gradle.kotlin.dsl.getPlugin
3330
import org.gradle.kotlin.dsl.register
3431
import org.gradle.kotlin.dsl.withType
@@ -38,9 +35,7 @@ class FirebaseJavaLibraryPlugin : BaseFirebaseLibraryPlugin() {
3835

3936
override fun apply(project: Project) {
4037
project.apply<JavaLibraryPlugin>()
41-
project.apply<GoogleJavaFormatPlugin>()
4238
project.apply<DackkaPlugin>()
43-
project.extensions.getByType<GoogleJavaFormatExtension>().toolVersion = "1.10.0"
4439

4540
setupFirebaseLibraryExtension(project)
4641
registerMakeReleaseNotesTask(project)

buildSrc/src/main/java/com/google/firebase/gradle/plugins/FirebaseLibraryPlugin.kt

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,6 @@ package com.google.firebase.gradle.plugins
1818

1919
import com.android.build.gradle.LibraryExtension
2020
import com.android.build.gradle.LibraryPlugin
21-
import com.github.sherter.googlejavaformatgradleplugin.GoogleJavaFormatExtension
22-
import com.github.sherter.googlejavaformatgradleplugin.GoogleJavaFormatPlugin
2321
import com.google.firebase.gradle.plugins.LibraryType.ANDROID
2422
import com.google.firebase.gradle.plugins.ci.device.FirebaseTestServer
2523
import com.google.firebase.gradle.plugins.license.LicenseResolverPlugin
@@ -43,8 +41,6 @@ class FirebaseLibraryPlugin : BaseFirebaseLibraryPlugin() {
4341
override fun apply(project: Project) {
4442
project.apply<LibraryPlugin>()
4543
project.apply<LicenseResolverPlugin>()
46-
project.apply<GoogleJavaFormatPlugin>()
47-
project.extensions.getByType<GoogleJavaFormatExtension>().toolVersion = "1.10.0"
4844

4945
setupAndroidLibraryExtension(project)
5046
registerMakeReleaseNotesTask(project)
@@ -68,6 +64,8 @@ class FirebaseLibraryPlugin : BaseFirebaseLibraryPlugin() {
6864
targetCompatibility = JavaVersion.VERSION_1_8
6965
}
7066

67+
android.buildFeatures.buildConfig = true
68+
7169
// In the case of and android library signing config only affects instrumentation test APK.
7270
// We need it signed with default debug credentials in order for FTL to accept the APK.
7371
android.buildTypes { getByName("release").signingConfig = getByName("debug").signingConfig }
@@ -178,7 +176,7 @@ class FirebaseLibraryPlugin : BaseFirebaseLibraryPlugin() {
178176
private fun configurePublishing(
179177
project: Project,
180178
firebaseLibrary: FirebaseLibraryExtension,
181-
android: LibraryExtension
179+
android: LibraryExtension,
182180
) {
183181
android.publishing.singleVariant("release") { withSourcesJar() }
184182
project.tasks.withType<GenerateModuleMetadata> { isEnabled = false }

buildSrc/src/test/kotlin/com/google/firebase/gradle/plugins/FirebaseTestController.kt

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -194,8 +194,7 @@ class FirebaseTestController(val rootDirectory: TemporaryFolder) {
194194

195195
const val ANDROID_MANIFEST =
196196
"""<?xml version="1.0" encoding="utf-8"?>
197-
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
198-
package="com.example">
197+
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
199198
<uses-sdk android:minSdkVersion="14"/>
200199
</manifest>
201200
"""

0 commit comments

Comments
 (0)