Files
react-native-firebase/packages/admob/android/build.gradle
SaeedZhiany 24ed7161d3 refactor(*): load Android Gradle Plugin conditionally (#2863)
* Loaded Android Gradle Plugin conditionally, Upgraded AGP version to 3.5.2
* Upgraded AGP version to 3.5.2
* upgraded Gradle wrapper version to 5.6.4
2019-11-23 17:22:07 +00:00

92 lines
2.4 KiB
Groovy

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.3"
}
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: "21.1.0"
],
ads : [
consent: "1.0.6"
],
],
])
}
apply from: file("./../../app/android/firebase-json.gradle")
def firebaseJSONAdmobAppIDString = ""
def firebaseJSONAdmobDelayAppMeasurementInitBool = false
if (rootProject.ext.firebaseJson) {
firebaseJSONAdmobAppIDString = rootProject.ext.firebaseJson.getStringValue("admob_android_app_id", "")
firebaseJSONAdmobDelayAppMeasurementInitBool = rootProject.ext.firebaseJson.isFlagEnabled("admob_delay_app_measurement_init")
}
if (!firebaseJSONAdmobAppIDString) {
// todo throw a build error?
}
android {
defaultConfig {
multiDexEnabled true
manifestPlaceholders = [
firebaseJSONAdmobAppID: firebaseJSONAdmobAppIDString,
firebaseJSONAdmobDelayAppMeasurementInit: firebaseJSONAdmobDelayAppMeasurementInitBool
]
}
lintOptions {
disable 'GradleCompatible'
abortOnError false
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
}
repositories {
google()
jcenter()
}
dependencies {
api project(':@react-native-firebase_app')
implementation platform("com.google.firebase:firebase-bom:${ReactNative.ext.getVersion("firebase", "bom")}")
implementation "com.google.firebase:firebase-ads"
implementation "com.google.android.ads.consent:consent-library:${ReactNative.ext.getVersion("ads", "consent")}"
}
ReactNative.shared.applyPackageVersion()
ReactNative.shared.applyDefaultExcludes()
ReactNative.module.applyAndroidVersions()
ReactNative.module.applyReactNativeDependency("api")