Skip to content

Commit bb0ac26

Browse files
authored
Upgrade to agp 7.4.2 (#5127)
* Upgrade to agp 7.4.2 * Read project property correctly. * Address reviewer comments * Remove unused property
1 parent 3dd80b1 commit bb0ac26

File tree

2 files changed

+16
-31
lines changed

2 files changed

+16
-31
lines changed

buildSrc/build.gradle.kts

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -41,11 +41,6 @@ ktfmt {
4141
googleStyle()
4242
}
4343

44-
java {
45-
sourceCompatibility = JavaVersion.VERSION_1_8
46-
targetCompatibility = JavaVersion.VERSION_1_8
47-
}
48-
4944
dependencies {
5045
// Firebase performance plugin, it should be added here because of how gradle dependency
5146
// resolution works, otherwise it breaks Fireperf Test Apps.
@@ -70,8 +65,8 @@ dependencies {
7065

7166
implementation(libs.kotlinx.serialization.json)
7267
implementation("com.google.code.gson:gson:2.8.9")
73-
implementation("com.android.tools.build:gradle:7.3.1")
74-
implementation("com.android.tools.build:builder-test-api:7.2.2")
68+
implementation("com.android.tools.build:gradle:7.4.2")
69+
implementation("com.android.tools.build:builder-test-api:7.4.2")
7570
implementation("gradle.plugin.com.github.sherter.google-java-format:google-java-format-gradle-plugin:0.9")
7671

7772
testImplementation(libs.bundles.kotest)

firebase-firestore/firebase-firestore.gradle

Lines changed: 14 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ protobuf {
5050
}
5151
}
5252
}
53+
5354
android {
5455
adbOptions {
5556
timeOutInMs 60 * 1000
@@ -64,15 +65,23 @@ android {
6465
multiDexEnabled true
6566
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
6667
consumerProguardFiles 'proguard.txt'
68+
69+
def targetBackend = findProperty("targetBackend") ?: "emulator"
70+
buildConfigField("String", "TARGET_BACKEND", "\"$targetBackend\"")
71+
72+
def localProps = new Properties()
73+
74+
try {
75+
file("local.properties").withInputStream { localProps.load(it) }
76+
} catch (FileNotFoundException e) {
77+
}
6778
}
6879

6980
sourceSets {
7081
main {
7182
proto {
7283
srcDir 'src/proto'
7384
}
74-
java {
75-
}
7685
}
7786
test {
7887
java {
@@ -92,30 +101,12 @@ android {
92101
}
93102
testOptions.unitTests.includeAndroidResources = true
94103

95-
// Acceptable values are: 'emulator', 'qa', 'nightly', and 'prod'.
96-
ext.targetBackend = 'emulator'
97104
}
98105

99106
tasks.withType(Test) {
100107
maxParallelForks = Runtime.runtime.availableProcessors().intdiv(2) ?: 1
101108
}
102109

103-
android.libraryVariants.all { variant ->
104-
if (findProperty('targetBackend')) {
105-
variant.buildConfigField("String", "TARGET_BACKEND", "\"${property("targetBackend")}\"")
106-
} else {
107-
// By default set the target backend to 'emulator'
108-
variant.buildConfigField("String", "TARGET_BACKEND", "\"emulator\"")
109-
}
110-
111-
def localProps = new Properties()
112-
113-
try {
114-
file("local.properties").withInputStream { localProps.load(it) }
115-
} catch (FileNotFoundException e) {
116-
}
117-
}
118-
119110
googleJavaFormat {
120111
exclude 'src/testUtil/java/com/google/firebase/firestore/testutil/Assert.java'
121112
exclude 'src/testUtil/java/com/google/firebase/firestore/testutil/ThrowingRunnable.java'
@@ -161,7 +152,6 @@ dependencies {
161152
testImplementation 'com.fasterxml.jackson.core:jackson-databind:2.9.8'
162153
testImplementation 'com.google.guava:guava-testlib:12.0-rc2'
163154

164-
androidTestImplementation project(':firebase-firestore')
165155
androidTestImplementation 'junit:junit:4.13.2'
166156
androidTestImplementation("com.google.truth:truth:$googleTruthVersion"){
167157
exclude group: "org.codehaus.mojo", module: "animal-sniffer-annotations"
@@ -170,9 +160,9 @@ dependencies {
170160
androidTestImplementation 'org.mockito:mockito-android:2.25.0'
171161
androidTestImplementation 'com.fasterxml.jackson.core:jackson-databind:2.9.8'
172162
androidTestImplementation "androidx.annotation:annotation:1.1.0"
173-
androidTestImplementation 'androidx.test:runner:1.2.0'
174-
androidTestImplementation 'androidx.test:rules:1.2.0'
175-
androidTestImplementation 'androidx.test.ext:junit:1.1.1'
163+
androidTestImplementation 'androidx.test:runner:1.5.2'
164+
androidTestImplementation 'androidx.test:rules:1.5.0'
165+
androidTestImplementation 'androidx.test.ext:junit:1.1.4'
176166
}
177167

178168
gradle.projectsEvaluated {

0 commit comments

Comments
 (0)