Skip to content

Commit f63aa5e

Browse files
authored
Migrate Database to KTS + VC (#4816)
* migrate firebase-database to kotlin script * Use StringResourceValueReader to get resource for test * Fix source paths * Apply GSP for tests * Clean up firebase-database * Add kotlinx-coroutines-core to version catalog * Refactor firebase-database-ktx to KTS + VC * Refactor firebase-database-collection to KTS + VC * ktfmt * ktfmt for firebase-database * Remove redundant source sets * Clean up IntegrationTestValues * Revert "Remove redundant source sets" This reverts commit 3c20d9b. * Add missing jackson libs * Add missing packages pt 2 * Add quickcheck to version toml * toml formatting * Apply valid toml libs + ktfmt * Additional reordering because OCD * Remove exclusion of firebase-common in auth-interop * Add bundle for playservices dependencies * Bump database dep versions * Reordering of deps
1 parent d72542b commit f63aa5e

File tree

8 files changed

+226
-254
lines changed

8 files changed

+226
-254
lines changed

firebase-database-collection/firebase-database-collection.gradle

Lines changed: 0 additions & 44 deletions
This file was deleted.
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
// Copyright 2023 Google LLC
2+
//
3+
// Licensed under the Apache License, Version 2.0 (the "License");
4+
// you may not use this file except in compliance with the License.
5+
// You may obtain a copy of the License at
6+
//
7+
// http://www.apache.org/licenses/LICENSE-2.0
8+
//
9+
// Unless required by applicable law or agreed to in writing, software
10+
// distributed under the License is distributed on an "AS IS" BASIS,
11+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
// See the License for the specific language governing permissions and
13+
// limitations under the License.
14+
15+
plugins { id("firebase-library") }
16+
17+
firebaseLibrary {
18+
publishSources = true
19+
publishJavadoc = false
20+
}
21+
22+
android {
23+
val targetSdkVersion: Int by rootProject
24+
val minSdkVersion: Int by rootProject
25+
26+
compileSdk = targetSdkVersion
27+
28+
defaultConfig {
29+
minSdk = minSdkVersion
30+
targetSdk = targetSdkVersion
31+
}
32+
33+
compileOptions {
34+
sourceCompatibility = JavaVersion.VERSION_1_8
35+
targetCompatibility = JavaVersion.VERSION_1_8
36+
}
37+
}
38+
39+
dependencies {
40+
implementation(libs.playservices.base)
41+
42+
testImplementation(libs.junit)
43+
testImplementation(libs.quickcheck)
44+
45+
testAnnotationProcessor("net.java:quickcheck-src-generator:0.6")
46+
testAnnotationProcessor("net.java.quickcheck:quickcheck-src-generator:0.6")
47+
}

firebase-database/firebase-database.gradle

Lines changed: 0 additions & 125 deletions
This file was deleted.
Lines changed: 85 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,85 @@
1+
// Copyright 2023 Google LLC
2+
//
3+
// Licensed under the Apache License, Version 2.0 (the "License");
4+
// you may not use this file except in compliance with the License.
5+
// You may obtain a copy of the License at
6+
//
7+
// http://www.apache.org/licenses/LICENSE-2.0
8+
//
9+
// Unless required by applicable law or agreed to in writing, software
10+
// distributed under the License is distributed on an "AS IS" BASIS,
11+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
// See the License for the specific language governing permissions and
13+
// limitations under the License.
14+
15+
plugins { id("firebase-library") }
16+
17+
firebaseLibrary {
18+
testLab.enabled = true
19+
publishSources = true
20+
}
21+
22+
android {
23+
val targetSdkVersion: Int by rootProject
24+
val minSdkVersion: Int by rootProject
25+
26+
installation.timeOutInMs = 60 * 1000
27+
compileSdk = targetSdkVersion
28+
29+
defaultConfig {
30+
minSdk = minSdkVersion
31+
targetSdk = targetSdkVersion
32+
multiDexEnabled = true
33+
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
34+
}
35+
36+
buildTypes { release { isMinifyEnabled = false } }
37+
38+
sourceSets {
39+
named("androidTest") { java.srcDir("src/testUtil/java") }
40+
named("test") { java.srcDir("src/testUtil") }
41+
42+
compileOptions {
43+
sourceCompatibility = JavaVersion.VERSION_1_8
44+
targetCompatibility = JavaVersion.VERSION_1_8
45+
}
46+
47+
packagingOptions.resources.excludes += "META-INF/DEPENDENCIES"
48+
testOptions.unitTests.isIncludeAndroidResources = true
49+
}
50+
}
51+
52+
dependencies {
53+
implementation("com.google.firebase:firebase-common:20.3.2")
54+
implementation("com.google.firebase:firebase-components:17.1.0")
55+
implementation("com.google.firebase:firebase-auth-interop:20.0.0")
56+
implementation("com.google.firebase:firebase-appcheck-interop:16.1.1")
57+
implementation("com.google.firebase:firebase-database-collection:18.0.1")
58+
59+
implementation(libs.androidx.annotation)
60+
implementation(libs.bundles.playservices)
61+
62+
testImplementation(libs.truth)
63+
testImplementation(libs.junit)
64+
testImplementation(libs.quickcheck)
65+
testImplementation(libs.robolectric)
66+
testImplementation(libs.mockito.core)
67+
testImplementation(libs.androidx.test.core)
68+
testImplementation(libs.androidx.test.rules)
69+
testImplementation("com.firebase:firebase-token-generator:2.0.0")
70+
testImplementation("com.fasterxml.jackson.core:jackson-core:2.13.1")
71+
testImplementation("com.fasterxml.jackson.core:jackson-databind:2.13.1")
72+
73+
androidTestImplementation(libs.truth)
74+
androidTestImplementation(libs.quickcheck)
75+
androidTestImplementation(libs.androidx.test.junit)
76+
androidTestImplementation(libs.androidx.test.runner)
77+
androidTestImplementation("org.hamcrest:hamcrest:2.2")
78+
androidTestImplementation("org.hamcrest:hamcrest-library:2.2")
79+
androidTestImplementation("com.fasterxml.jackson.core:jackson-core:2.13.1")
80+
androidTestImplementation("com.fasterxml.jackson.core:jackson-databind:2.13.1")
81+
}
82+
83+
ext["packageName"] = "com.google.firebase.database"
84+
85+
apply("../gradle/googleServices.gradle")

firebase-database/ktx/ktx.gradle

Lines changed: 0 additions & 65 deletions
This file was deleted.

0 commit comments

Comments
 (0)