Skip to content

Latest commit

 

History

History
 
 

firebase-dataconnect

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:

./gradlew :firebase-dataconnect:assembleRelease

Unit Testing

To run unit tests for Firebase Data Connect, from the source root run:

./gradlew :firebase-dataconnect:check

Integration Testing

Running integration tests requires a Firebase project because they connect to the Firebase Data Connect backend.

See here 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.
    npm install -g firebase-tools
    
  • Install the Firebase Data Connect 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:

./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 for instructions of how to setup Firebase Test Lab for your project.

Run:

./gradlew :firebase-dataconnect:deviceCheck

Code Formatting

Run below to format Kotlin and Java code:

./gradlew :firebase-dataconnect:spotlessApply

See here if you want to be able to format code from within Android Studio.

Build Local Jar of Firebase Data Connect SDK

./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 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