mirror of
https://github.com/zhigang1992/react-native-firebase.git
synced 2026-04-21 10:34:39 +08:00
All packages now peer-depend on an explicit version of the `app` package. BREAKING CHANGE: breaking change to mark new internal versioning requirements.
82 lines
1.9 KiB
Groovy
82 lines
1.9 KiB
Groovy
import io.invertase.gradle.common.PackageJson
|
|
|
|
buildscript {
|
|
// The Android Gradle plugin is only required when opening the android folder stand-alone.
|
|
// This avoids unnecessary downloads and potential conflicts when the library is included as a
|
|
// module dependency in an application project.
|
|
if (project == rootProject) {
|
|
repositories {
|
|
google()
|
|
jcenter()
|
|
}
|
|
|
|
dependencies {
|
|
classpath("com.android.tools.build:gradle:3.5.2")
|
|
}
|
|
}
|
|
}
|
|
|
|
plugins {
|
|
id "io.invertase.gradle.build" version "1.4"
|
|
}
|
|
|
|
def packageJson = PackageJson.getForProject(project)
|
|
def firebaseBomVersion = packageJson['sdkVersions']['android']['firebase']
|
|
|
|
project.ext {
|
|
set('react-native', [
|
|
versions: [
|
|
android : [
|
|
minSdk : 16,
|
|
targetSdk : 28,
|
|
compileSdk: 28,
|
|
// optional as gradle.buildTools comes with one by default
|
|
// overriding here though to match the version RN uses
|
|
buildTools: "28.0.3"
|
|
],
|
|
|
|
firebase: [
|
|
bom: firebaseBomVersion,
|
|
],
|
|
],
|
|
])
|
|
}
|
|
|
|
android {
|
|
defaultConfig {
|
|
multiDexEnabled true
|
|
}
|
|
lintOptions {
|
|
disable 'GradleCompatible'
|
|
abortOnError false
|
|
}
|
|
compileOptions {
|
|
sourceCompatibility JavaVersion.VERSION_1_8
|
|
targetCompatibility JavaVersion.VERSION_1_8
|
|
}
|
|
|
|
sourceSets {
|
|
main {
|
|
java.srcDirs = ['src/main/java', 'src/reactnative/java']
|
|
}
|
|
}
|
|
}
|
|
|
|
repositories {
|
|
google()
|
|
jcenter()
|
|
}
|
|
|
|
dependencies {
|
|
implementation platform("com.google.firebase:firebase-bom:${ReactNative.ext.getVersion("firebase", "bom")}")
|
|
implementation "com.google.firebase:firebase-core"
|
|
implementation "com.google.firebase:firebase-common"
|
|
}
|
|
|
|
apply from: file("./firebase-json.gradle")
|
|
|
|
ReactNative.shared.applyPackageVersion()
|
|
ReactNative.shared.applyDefaultExcludes()
|
|
ReactNative.module.applyAndroidVersions()
|
|
ReactNative.module.applyReactNativeDependency("api")
|