在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
开源软件名称:firebase/firebase-android-sdk开源软件地址:https://github.com/firebase/firebase-android-sdk开源编程语言:Java 52.5%开源软件介绍:Firebase Android Open Source DevelopmentThis repository contains a subset of the Firebase Android SDK source. It currently includes the following Firebase libraries, and some of their dependencies:
Firebase is an app development platform with tools to help you build, grow and monetize your app. More information about Firebase can be found at https://firebase.google.com. Table of contentsGetting Started
TestingFirebase Android libraries exercise all three types of tests recommended by the Android Testing Pyramid. Depending on the requirements of the specific project, some or all of these tests may be used to support changes.
Unit TestingThese are tests that run on your machine's local Java Virtual Machine (JVM). At runtime, these tests are executed against a modified version of android.jar where all final modifiers have been stripped off. This lets us sandbox behaviors at desired places and use popular mocking libraries. Unit tests can be executed on the command line by running ./gradlew :<firebase-project>:check Integration TestingThese are tests that run on a hardware device or emulator. These tests have access to Instrumentation APIs, give you access to information such as the Android Context. In Firebase, instrumentation tests are used at different capacities by different projects. Some tests may exercise device capabilities, while stubbing any calls to the backend, while some others may call out to nightly backend builds to ensure distributed API compatibility. Along with Espresso, they are also used to test projects that have UI components. Project SetupBefore you can run integration tests, you need to add a If you don't have a suitable testing project already:
Running Integration Tests on Local EmulatorIntegration tests can be executed on the command line by running ./gradlew :<firebase-project>:connectedCheck Running Integration Tests on Firebase Test Lab
Integration tests can be executed on the command line by running ./gradlew :<firebase-project>:deviceCheck This will execute tests on devices that are configured per project, if nothing is configured for the
project, the tests will run on Projects can be configured in the following way:
AnnotationsFirebase SDKs use some special annotations for tooling purposes. @KeepAPIs that need to be preserved up until the app's runtime can be annotated with @Keep. The @Keep annotation is blessed to be honored by android's default proguard configuration. A common use for this annotation is because of reflection. These APIs should be generally discouraged, because they can't be proguarded. @KeepForSdkAPIs that are intended to be used by Firebase SDKs should be annotated with
@PublicApiWe annotate APIs that meant to be used by developers with @PublicAPI. This annotation will be used by tooling to help inform the version bump (major, minor, patch) that is required for the next release. ProguardingFirebase SDKs do not proguard themselves, but support proguarding. Firebase SDKs themselves are proguard friendly, but the dependencies of Firebase SDKs may not be. Proguard configIn addition to preguard.txt, projects declare an additional set of proguard rules in a proguard.txt that are honored by the developer's app while building the app's proguarded apk. This file typically contains the keep rules that need to be honored during the app' s proguarding phase. As a best practice, these explicit rules should be scoped to only libraries whose source code is outside the firebase-android-sdk codebase making annotation based approaches insufficient.The combination of keep rules resulting from the annotations, the preguard.txt and the proguard.txt collectively determine the APIs that are preserved at runtime. PublishingFirebase is published as a collection of libraries each of which either represents a top level product, or contains shared functionality used by one or more projects. The projects are published as managed maven artifacts available at Google's Maven Repository. This section helps reason about how developers may make changes to firebase projects and have their apps depend on the modified versions of Firebase. DependenciesAny dependencies, within the projects, or outside of Firebase are encoded as
maven dependencies
into the CommandsThe simplest way to publish a project and all its associated dependencies is to just publish all projects. The following command builds SNAPSHOT dependencies of all projects. All pom level dependencies within the published artifacts will also point to SNAPSHOT versions that are co-published. ./gradlew publishAllToLocal Developers may take a dependency on these locally published versions by adding
the For more advanced use cases where developers wish to make changes to a project, but have transitive dependencies point to publicly released versions, individual projects may be published as follows. # e.g. to publish Firestore and Functions
./gradlew -PprojectsToPublish=":firebase-firestore,:firebase-functions" \
publishProjectsToMavenLocal Code FormattingCode in this repo is formatted with the google-java-format tool. You can enable this formatting in Android Studio by downloading and installing the google-java-format plugin. The plugin is disabled by default, but the repo contains configuration information and links to additional plugins. To run formatting on your entire project you can run ./gradlew :<firebase-project>:googleJavaFormat ContributingWe love contributions! Please read our contribution guidelines to get started. |
2022-08-15
2022-08-17
2022-09-23
2023-10-27
2022-08-18
请发表评论