Skip to content

Commit a95da3f

Browse files
dconeybecherylEnkidurachelsaunders
authored
firebase-dataconnect merge into main branch (#6290)
Includes contributions by @cherylEnkidu --------- Co-authored-by: cherylEnkidu <[email protected]> Co-authored-by: rachelsaunders <[email protected]>
1 parent 2f851c7 commit a95da3f

File tree

223 files changed

+35244
-6
lines changed

Some content is hidden

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

223 files changed

+35244
-6
lines changed

firebase-dataconnect/.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
dataconnect.local.properties

firebase-dataconnect/CHANGELOG.md

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# Unreleased
2+
* [feature] Initial release of the Data Connect SDK (public preview). Learn how to
3+
[get started](https://firebase.google.com/docs/data-connect/android-sdk)
4+
with the SDK in your app.
5+
* [feature] Added App Check support.
6+
([#6176](https://github.com/firebase/firebase-android-sdk/pull/6176))
7+
* [feature] Added `AnyValue` to support the `Any` custom GraphQL scalar type.
8+
([#6285](https://github.com/firebase/firebase-android-sdk/pull/6285))
9+
* [feature] Added ability to specify `SerializersModule` when serializing.
10+
([#6297](https://github.com/firebase/firebase-android-sdk/pull/6297))
11+
* [feature] Added `CallerSdkType`, which enables tracking of the generated SDK usage.
12+
([#6298](https://github.com/firebase/firebase-android-sdk/pull/6298) and
13+
[#6179](https://github.com/firebase/firebase-android-sdk/pull/6179))
14+
* [changed] Changed gRPC proto package to v1beta (was v1alpha).
15+
([#6299](https://github.com/firebase/firebase-android-sdk/pull/6299))
16+
* [changed] Added `equals` and `hashCode` methods to `GeneratedConnector`.
17+
([#6177](https://github.com/firebase/firebase-android-sdk/pull/6177))

firebase-dataconnect/README.md

+110
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,110 @@
1+
# firebase-dataconnect
2+
3+
This is the Firebase Android Data Connect SDK.
4+
5+
## Building
6+
7+
All Gradle commands should be run from the source root (which is one level up
8+
from this folder). See the README.md in the source root for instructions on
9+
publishing/testing Firebase Data Connect.
10+
11+
To build Firebase Data Connect, from the source root run:
12+
```bash
13+
./gradlew :firebase-dataconnect:assembleRelease
14+
```
15+
16+
## Unit Testing
17+
18+
To run unit tests for Firebase Data Connect, from the source root run:
19+
```bash
20+
./gradlew :firebase-dataconnect:check
21+
```
22+
23+
## Integration Testing
24+
25+
Running integration tests requires a Firebase project because they connect to
26+
the Firebase Data Connect backend.
27+
28+
See [here](../README.md#project-setup) for how to setup a project.
29+
30+
Once you setup the project, download `google-services.json` and place it in
31+
the source root.
32+
33+
Make sure you have created a Firebase Data Connect instance for your project,
34+
before you proceed.
35+
36+
By default, integration tests run against the Firebase Data Connect emulator.
37+
38+
### Setting up the Firebase Data Connect Emulator
39+
40+
The integration tests require that the Firebase Data Connect emulator is running
41+
on port 9399, which is default when running it via the Data Connect Toolkit.
42+
43+
* [Install the Firebase CLI](https://firebase.google.com/docs/cli/).
44+
```
45+
npm install -g firebase-tools
46+
```
47+
* [Install the Firebase Data Connect
48+
emulator](https://firebase.google.com/docs/FIX_URL/security/test-rules-emulator#install_the_emulator).
49+
```
50+
firebase setup:emulators:dataconnect
51+
```
52+
* Run the emulator
53+
```
54+
firebase emulators:start --only dataconnect
55+
```
56+
* Select the `Firebase Data Connect Integration Tests (Firebase Data Connect
57+
Emulator)` run configuration to run all integration tests.
58+
59+
To run the integration tests against prod, select
60+
`DataConnectProdIntegrationTest` run configuration.
61+
62+
### Run on Local Android Emulator
63+
64+
Then run:
65+
```bash
66+
./gradlew :firebase-dataconnect:connectedCheck
67+
```
68+
69+
### Run on Firebase Test Lab
70+
71+
You can also test on Firebase Test Lab, which allow you to run the integration
72+
tests on devices hosted in a Google data center.
73+
74+
See [here](../README.md#running-integration-tests-on-firebase-test-lab) for
75+
instructions of how to setup Firebase Test Lab for your project.
76+
77+
Run:
78+
```bash
79+
./gradlew :firebase-dataconnect:deviceCheck
80+
```
81+
82+
## Code Formatting
83+
84+
Run below to format Kotlin and Java code:
85+
```bash
86+
./gradlew :firebase-dataconnect:spotlessApply
87+
```
88+
89+
See [here](../README.md#code-formatting) if you want to be able to format code
90+
from within Android Studio.
91+
92+
## Build Local Jar of Firebase Data Connect SDK
93+
94+
```bash
95+
./gradlew -PprojectsToPublish="firebase-dataconnect" publishReleasingLibrariesToMavenLocal
96+
```
97+
98+
Developers may then take a dependency on these locally published versions by adding
99+
the `mavenLocal()` repository to your [repositories
100+
block](https://docs.gradle.org/current/userguide/declaring_repositories.html) in
101+
your app module's build.gradle.
102+
103+
## Misc
104+
After importing the project into Android Studio and building successfully
105+
for the first time, Android Studio will delete the run configuration xml files
106+
in `./idea/runConfigurations`. Undo these changes with the command:
107+
108+
```
109+
$ git checkout .idea/runConfigurations
110+
```
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
/*
2+
* Copyright 2024 Google LLC
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
17+
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
18+
19+
plugins {
20+
id("com.android.library")
21+
id("kotlin-android")
22+
alias(libs.plugins.kotlinx.serialization)
23+
}
24+
25+
android {
26+
val compileSdkVersion : Int by rootProject
27+
val targetSdkVersion : Int by rootProject
28+
val minSdkVersion : Int by rootProject
29+
30+
namespace = "com.google.firebase.dataconnect.androidTestutil"
31+
compileSdk = compileSdkVersion
32+
defaultConfig {
33+
minSdk = minSdkVersion
34+
targetSdk = targetSdkVersion
35+
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
36+
}
37+
compileOptions {
38+
sourceCompatibility = JavaVersion.VERSION_1_8
39+
targetCompatibility = JavaVersion.VERSION_1_8
40+
}
41+
kotlinOptions { jvmTarget = "1.8" }
42+
43+
packaging {
44+
resources {
45+
excludes.add("META-INF/LICENSE.md")
46+
excludes.add("META-INF/LICENSE-notice.md")
47+
}
48+
}
49+
}
50+
51+
dependencies {
52+
implementation(project(":firebase-dataconnect"))
53+
implementation(project(":firebase-dataconnect:testutil"))
54+
55+
implementation("com.google.firebase:firebase-auth:22.3.1")
56+
implementation("com.google.firebase:firebase-appcheck:18.0.0")
57+
58+
implementation(libs.androidx.test.core)
59+
implementation(libs.androidx.test.junit)
60+
implementation(libs.auth0.jwt)
61+
implementation(libs.kotest.property)
62+
implementation(libs.kotlinx.coroutines.core)
63+
implementation(libs.kotlinx.serialization.core)
64+
implementation(libs.kotlinx.serialization.json)
65+
implementation(libs.truth)
66+
implementation(libs.turbine)
67+
}
68+
69+
tasks.withType<KotlinCompile>().all {
70+
kotlinOptions {
71+
freeCompilerArgs = listOf("-opt-in=kotlin.RequiresOptIn")
72+
}
73+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<manifest xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools">
3+
<application />
4+
</manifest>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
{
2+
"type": "service_account",
3+
"project_id": "prjh5zbv64sv6",
4+
"private_key_id": "abcdef0123456789abcdef0123456789abcdef01",
5+
"private_key": "-----BEGIN PRIVATE KEY-----\nMIIEvgIBADANBgkqhkiG9w0BAQEFAASCBKgwggSkAgEAAoIBAQCvfyKRUZMyp1FS\nbL2cZIMNA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v4XCioROnpYZuPym5Sz0gPz\nWreh0ElUd07sgAMojkDF8aliVhaA4xugC3+o21m2OFRdeE1zaZD/wI8fq1JBfOa4\nlb7GQ7AUJzyR2tQ57RTGl+mdqHZ3EQ8IzfVG9+phrbzLX6N/4iSobZx4DQKBgEYY\nn/uD+67OOEJT/yA0pKnZ7AKVetFt7K6HS+KcSCuOsI8rb/MiqOX5DQqwQwB9euOt\nA59fr2xwSHjRr364INXcYn6w7CWdz6o7q4JNHrYmBstno8/gOnMBRquPeroIPVJh\nJt63sRDs4klhssI1auckjf4WfJSYKbQ7ONuXj8kjAoGBAILZG9+YNZ9IKLtQzcdf\nbWzgQ2b9CujHdZ5agSGUHVeKSSIInQZAc5jRCKz35T9Xnh50qrixcNA90IvpjbGL\nCNmmvmB+IlIuH/Mzn6wb5fad8d80e1Yz+ueeAyZjMS6NYLwmZ1M52eeikRWdyO/h\nZ3q6UYLR9K+mhUFgV+X7g15T\n-----END PRIVATE KEY-----\n",
6+
"client_email": "firebase-adminsdk-trn2rx6xed@prjh5zbv64sv6.iam.gserviceaccount.com",
7+
"client_id": "123456789012345678901",
8+
"auth_uri": "https://accounts.google.com/o/oauth2/auth",
9+
"token_uri": "https://oauth2.googleapis.com/token",
10+
"auth_provider_x509_cert_url": "https://www.googleapis.com/oauth2/v1/certs",
11+
"client_x509_cert_url": "https://www.googleapis.com/robot/v1/metadata/x509/firebase-adminsdk-trn2rx6xed%40prjh5zbv64sv6.iam.gserviceaccount.com",
12+
"universe_domain": "googleapis.com"
13+
}

0 commit comments

Comments
 (0)