Files
react-native-firebase/tests/android/app/build.gradle
2019-03-26 13:03:57 +00:00

142 lines
3.6 KiB
Groovy
Executable File

apply plugin: "com.android.application"
apply plugin: "com.google.firebase.firebase-perf"
apply plugin: 'io.fabric'
crashlytics {
enableNdk true
}
import com.android.build.OutputFile
project.ext.react = [
entryFile: "index.js"
]
// up to mono root
apply from: "../../node_modules/react-native/react.gradle"
def enableSeparateBuildPerCPUArchitecture = false
def firebasePackages = [
'app',
'analytics',
'config',
'crashlytics',
'functions',
'fiam',
'iid',
'mlkit',
'perf',
'utils'
]
android {
compileSdkVersion 28
defaultConfig {
applicationId "com.invertase.testing"
minSdkVersion 18
targetSdkVersion 28
versionCode 1
versionName "1.0"
ndk {
abiFilters "armeabi-v7a", "x86"
}
testBuildType System.getProperty('testBuildType', 'debug')
missingDimensionStrategy "minReactNative", "minReactNative46"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
multiDexEnabled true
}
splits {
abi {
reset()
enable enableSeparateBuildPerCPUArchitecture
universalApk false // If true, also generate a universal APK
include "armeabi-v7a", "x86"
}
}
signingConfigs {
release {
storeFile file("keystore.jks")
storePassword "12345678"
keyAlias "key0"
keyPassword "12345678"
}
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro"
signingConfig signingConfigs.release
matchingFallbacks = ['release']
}
debug {
matchingFallbacks = ['debug']
}
}
compileOptions {
sourceCompatibility 1.8
targetCompatibility 1.8
}
// applicationVariants are e.g. debug, release
applicationVariants.all { variant ->
variant.outputs.each { output ->
// For each separate APK per architecture, set a unique version code as described here:
// http://tools.android.com/tech-docs/new-build-system/user-guide/apk-splits
def versionCodes = ["armeabi-v7a": 1, "x86": 2]
def abi = output.getFilter(OutputFile.ABI)
if (abi != null) { // null for the universal-debug, universal-release variants
output.versionCodeOverride =
versionCodes.get(abi) * 1048576 + defaultConfig.versionCode
}
}
}
packagingOptions {
exclude 'META-INF/proguard/androidx-annotations.pro'
exclude 'META-INF/-no-jdk.kotlin_module'
exclude 'META-INF/DEPENDENCIES'
exclude 'META-INF/NOTICE'
exclude 'META-INF/LICENSE'
exclude 'META-INF/LICENSE.txt'
exclude 'META-INF/NOTICE.txt'
}
}
dependencies {
//noinspection GradleDynamicVersion
implementation "com.facebook.react:react-native:+"
implementation fileTree(dir: "libs", include: ["*.jar"])
/* ----------------------------
* REACT NATIVE FIREBASE
* ---------------------------- */
firebasePackages.each { firebasePackage ->
implementation project(path: ":@react-native-firebase_${firebasePackage}")
}
/* ------------------------
* TESTING SDKS/LIBRARIES
* ------------------------ */
implementation(project(path: ':jet')) {
transitive = false
}
androidTestImplementation project(path: ":detox")
androidTestImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.2'
androidTestImplementation 'com.android.support.test:rules:1.0.2'
}
// Run this once to be able to run the application with BUCK
// puts all compile dependencies into folder libs for BUCK to use
task copyDownloadableDepsToLibs(type: Copy) {
from configurations.compile
into 'libs'
}
apply plugin: 'com.google.gms.google-services'