-
Notifications
You must be signed in to change notification settings - Fork 573
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into rl.rename.harm.threshold
- Loading branch information
Showing
273 changed files
with
36,248 additions
and
567 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
dataconnect.local.properties |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
# Unreleased | ||
* [feature] Initial release of the Data Connect SDK (public preview). Learn how to | ||
[get started](https://firebase.google.com/docs/data-connect/android-sdk) | ||
with the SDK in your app. | ||
* [feature] Added App Check support. | ||
([#6176](https://github.com/firebase/firebase-android-sdk/pull/6176)) | ||
* [feature] Added `AnyValue` to support the `Any` custom GraphQL scalar type. | ||
([#6285](https://github.com/firebase/firebase-android-sdk/pull/6285)) | ||
* [feature] Added `OrderDirection` enum support. | ||
([#6307](https://github.com/firebase/firebase-android-sdk/pull/6307)) | ||
* [feature] Added ability to specify `SerializersModule` when serializing. | ||
([#6297](https://github.com/firebase/firebase-android-sdk/pull/6297)) | ||
* [feature] Added `CallerSdkType`, which enables tracking of the generated SDK usage. | ||
([#6298](https://github.com/firebase/firebase-android-sdk/pull/6298) and | ||
[#6179](https://github.com/firebase/firebase-android-sdk/pull/6179)) | ||
* [changed] Changed gRPC proto package to v1beta (was v1alpha). | ||
([#6299](https://github.com/firebase/firebase-android-sdk/pull/6299)) | ||
* [changed] Added `equals` and `hashCode` methods to `GeneratedConnector`. | ||
([#6177](https://github.com/firebase/firebase-android-sdk/pull/6177)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,110 @@ | ||
# firebase-dataconnect | ||
|
||
This is the Firebase Android Data Connect SDK. | ||
|
||
## Building | ||
|
||
All Gradle commands should be run from the source root (which is one level up | ||
from this folder). See the README.md in the source root for instructions on | ||
publishing/testing Firebase Data Connect. | ||
|
||
To build Firebase Data Connect, from the source root run: | ||
```bash | ||
./gradlew :firebase-dataconnect:assembleRelease | ||
``` | ||
|
||
## Unit Testing | ||
|
||
To run unit tests for Firebase Data Connect, from the source root run: | ||
```bash | ||
./gradlew :firebase-dataconnect:check | ||
``` | ||
|
||
## Integration Testing | ||
|
||
Running integration tests requires a Firebase project because they connect to | ||
the Firebase Data Connect backend. | ||
|
||
See [here](../README.md#project-setup) for how to setup a project. | ||
|
||
Once you setup the project, download `google-services.json` and place it in | ||
the source root. | ||
|
||
Make sure you have created a Firebase Data Connect instance for your project, | ||
before you proceed. | ||
|
||
By default, integration tests run against the Firebase Data Connect emulator. | ||
|
||
### Setting up the Firebase Data Connect Emulator | ||
|
||
The integration tests require that the Firebase Data Connect emulator is running | ||
on port 9399, which is default when running it via the Data Connect Toolkit. | ||
|
||
* [Install the Firebase CLI](https://firebase.google.com/docs/cli/). | ||
``` | ||
npm install -g firebase-tools | ||
``` | ||
* [Install the Firebase Data Connect | ||
emulator](https://firebase.google.com/docs/FIX_URL/security/test-rules-emulator#install_the_emulator). | ||
``` | ||
firebase setup:emulators:dataconnect | ||
``` | ||
* Run the emulator | ||
``` | ||
firebase emulators:start --only dataconnect | ||
``` | ||
* Select the `Firebase Data Connect Integration Tests (Firebase Data Connect | ||
Emulator)` run configuration to run all integration tests. | ||
|
||
To run the integration tests against prod, select | ||
`DataConnectProdIntegrationTest` run configuration. | ||
|
||
### Run on Local Android Emulator | ||
|
||
Then run: | ||
```bash | ||
./gradlew :firebase-dataconnect:connectedCheck | ||
``` | ||
|
||
### Run on Firebase Test Lab | ||
|
||
You can also test on Firebase Test Lab, which allow you to run the integration | ||
tests on devices hosted in a Google data center. | ||
|
||
See [here](../README.md#running-integration-tests-on-firebase-test-lab) for | ||
instructions of how to setup Firebase Test Lab for your project. | ||
|
||
Run: | ||
```bash | ||
./gradlew :firebase-dataconnect:deviceCheck | ||
``` | ||
|
||
## Code Formatting | ||
|
||
Run below to format Kotlin and Java code: | ||
```bash | ||
./gradlew :firebase-dataconnect:spotlessApply | ||
``` | ||
|
||
See [here](../README.md#code-formatting) if you want to be able to format code | ||
from within Android Studio. | ||
|
||
## Build Local Jar of Firebase Data Connect SDK | ||
|
||
```bash | ||
./gradlew -PprojectsToPublish="firebase-dataconnect" publishReleasingLibrariesToMavenLocal | ||
``` | ||
|
||
Developers may then take a dependency on these locally published versions by adding | ||
the `mavenLocal()` repository to your [repositories | ||
block](https://docs.gradle.org/current/userguide/declaring_repositories.html) in | ||
your app module's build.gradle. | ||
|
||
## Misc | ||
After importing the project into Android Studio and building successfully | ||
for the first time, Android Studio will delete the run configuration xml files | ||
in `./idea/runConfigurations`. Undo these changes with the command: | ||
|
||
``` | ||
$ git checkout .idea/runConfigurations | ||
``` |
73 changes: 73 additions & 0 deletions
73
firebase-dataconnect/androidTestutil/androidTestutil.gradle.kts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,73 @@ | ||
/* | ||
* Copyright 2024 Google LLC | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile | ||
|
||
plugins { | ||
id("com.android.library") | ||
id("kotlin-android") | ||
alias(libs.plugins.kotlinx.serialization) | ||
} | ||
|
||
android { | ||
val compileSdkVersion : Int by rootProject | ||
val targetSdkVersion : Int by rootProject | ||
val minSdkVersion : Int by rootProject | ||
|
||
namespace = "com.google.firebase.dataconnect.androidTestutil" | ||
compileSdk = compileSdkVersion | ||
defaultConfig { | ||
minSdk = minSdkVersion | ||
targetSdk = targetSdkVersion | ||
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner" | ||
} | ||
compileOptions { | ||
sourceCompatibility = JavaVersion.VERSION_1_8 | ||
targetCompatibility = JavaVersion.VERSION_1_8 | ||
} | ||
kotlinOptions { jvmTarget = "1.8" } | ||
|
||
packaging { | ||
resources { | ||
excludes.add("META-INF/LICENSE.md") | ||
excludes.add("META-INF/LICENSE-notice.md") | ||
} | ||
} | ||
} | ||
|
||
dependencies { | ||
implementation(project(":firebase-dataconnect")) | ||
implementation(project(":firebase-dataconnect:testutil")) | ||
|
||
implementation("com.google.firebase:firebase-auth:22.3.1") | ||
implementation("com.google.firebase:firebase-appcheck:18.0.0") | ||
|
||
implementation(libs.androidx.test.core) | ||
implementation(libs.androidx.test.junit) | ||
implementation(libs.auth0.jwt) | ||
implementation(libs.kotest.property) | ||
implementation(libs.kotlinx.coroutines.core) | ||
implementation(libs.kotlinx.serialization.core) | ||
implementation(libs.kotlinx.serialization.json) | ||
implementation(libs.truth) | ||
implementation(libs.turbine) | ||
} | ||
|
||
tasks.withType<KotlinCompile>().all { | ||
kotlinOptions { | ||
freeCompilerArgs = listOf("-opt-in=kotlin.RequiresOptIn") | ||
} | ||
} |
4 changes: 4 additions & 0 deletions
4
firebase-dataconnect/androidTestutil/src/main/AndroidManifest.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<manifest xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools"> | ||
<application /> | ||
</manifest> |
13 changes: 13 additions & 0 deletions
13
firebase-dataconnect/androidTestutil/src/main/assets/firebase-admin-service-account.key.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
{ | ||
"type": "service_account", | ||
"project_id": "prjh5zbv64sv6", | ||
"private_key_id": "abcdef0123456789abcdef0123456789abcdef01", | ||
"private_key": "-----BEGIN PRIVATE KEY-----\nMIIEvgIBADANBgkqhkiG9w0BAQEFAASCBKgwggSkAgEAAoIBAQCvfyKRUZMyp1FS\nbL2cZIMNA5AbDHBuZciEZFIbG7rx7d12Lnwz/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ElUd07sgAMojkDF8aliVhaA4xugC3+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", | ||
"client_email": "firebase-adminsdk-trn2rx6xed@prjh5zbv64sv6.iam.gserviceaccount.com", | ||
"client_id": "123456789012345678901", | ||
"auth_uri": "https://accounts.google.com/o/oauth2/auth", | ||
"token_uri": "https://oauth2.googleapis.com/token", | ||
"auth_provider_x509_cert_url": "https://www.googleapis.com/oauth2/v1/certs", | ||
"client_x509_cert_url": "https://www.googleapis.com/robot/v1/metadata/x509/firebase-adminsdk-trn2rx6xed%40prjh5zbv64sv6.iam.gserviceaccount.com", | ||
"universe_domain": "googleapis.com" | ||
} |
Oops, something went wrong.