2017-04-23 19:22:19 +00:00
|
|
|
apply plugin: "com.android.application"
|
2017-05-24 11:37:26 +00:00
|
|
|
apply plugin: "com.google.firebase.firebase-perf"
|
2017-04-23 19:22:19 +00:00
|
|
|
|
|
|
|
import com.android.build.OutputFile
|
|
|
|
|
2017-08-18 20:03:44 +00:00
|
|
|
project.ext.react = [
|
|
|
|
// whether to bundle JS and assets in staging mode
|
2017-08-22 16:19:55 +00:00
|
|
|
bundleInDebug : false,
|
|
|
|
jsBundleDirDebug : "$buildDir/intermediates/assets/debug",
|
|
|
|
nodeExecutableAndArgs: ["/usr/local/bin/node"]
|
2017-08-18 20:03:44 +00:00
|
|
|
]
|
2017-06-22 13:09:50 +00:00
|
|
|
|
2017-04-23 19:22:19 +00:00
|
|
|
apply from: "../../node_modules/react-native/react.gradle"
|
|
|
|
apply from: "../../node_modules/react-native-vector-icons/fonts.gradle"
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Set this to true to create two separate APKs instead of one:
|
|
|
|
* - An APK that only works on ARM devices
|
|
|
|
* - An APK that only works on x86 devices
|
|
|
|
* The advantage is the size of the APK is reduced by about 4MB.
|
|
|
|
* Upload all the APKs to the Play Store and people will download
|
|
|
|
* the correct one based on the CPU architecture of their device.
|
|
|
|
*/
|
|
|
|
def enableSeparateBuildPerCPUArchitecture = false
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Run Proguard to shrink the Java bytecode in release builds.
|
|
|
|
*/
|
|
|
|
def enableProguardInReleaseBuilds = false
|
|
|
|
|
|
|
|
android {
|
2017-08-18 20:03:44 +00:00
|
|
|
compileSdkVersion 26
|
2017-06-12 13:10:47 +00:00
|
|
|
buildToolsVersion '25.0.3'
|
2017-04-23 19:22:19 +00:00
|
|
|
|
|
|
|
defaultConfig {
|
|
|
|
applicationId "com.reactnativefirebasedemo"
|
|
|
|
minSdkVersion 16
|
2017-08-18 20:03:44 +00:00
|
|
|
targetSdkVersion 26
|
2017-04-23 19:22:19 +00:00
|
|
|
versionCode 1
|
|
|
|
versionName "1.0"
|
|
|
|
ndk {
|
|
|
|
abiFilters "armeabi-v7a", "x86"
|
|
|
|
}
|
2017-10-03 17:02:33 +00:00
|
|
|
multiDexEnabled true
|
2017-04-23 19:22:19 +00:00
|
|
|
}
|
|
|
|
splits {
|
|
|
|
abi {
|
|
|
|
reset()
|
|
|
|
enable enableSeparateBuildPerCPUArchitecture
|
|
|
|
universalApk false // If true, also generate a universal APK
|
|
|
|
include "armeabi-v7a", "x86"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
buildTypes {
|
|
|
|
release {
|
|
|
|
minifyEnabled enableProguardInReleaseBuilds
|
|
|
|
proguardFiles getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
// 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
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2017-10-03 16:23:28 +00:00
|
|
|
project.ext.firebaseVersion = '11.4.2'
|
2017-05-30 15:16:56 +00:00
|
|
|
|
2017-04-23 19:22:19 +00:00
|
|
|
dependencies {
|
2017-08-18 20:03:44 +00:00
|
|
|
// compile(project(':react-native-firebase')) {
|
|
|
|
// transitive = false
|
|
|
|
// }
|
2017-04-23 19:22:19 +00:00
|
|
|
compile project(':react-native-vector-icons')
|
2017-08-18 20:03:44 +00:00
|
|
|
compile project(':react-native-firebase')
|
2017-04-23 19:22:19 +00:00
|
|
|
compile fileTree(dir: "libs", include: ["*.jar"])
|
2017-05-30 15:16:56 +00:00
|
|
|
compile "com.google.android.gms:play-services-base:$firebaseVersion"
|
|
|
|
compile "com.google.firebase:firebase-ads:$firebaseVersion"
|
|
|
|
compile "com.google.firebase:firebase-auth:$firebaseVersion"
|
|
|
|
compile "com.google.firebase:firebase-config:$firebaseVersion"
|
|
|
|
compile "com.google.firebase:firebase-core:$firebaseVersion"
|
|
|
|
compile "com.google.firebase:firebase-crash:$firebaseVersion"
|
|
|
|
compile "com.google.firebase:firebase-database:$firebaseVersion"
|
|
|
|
compile "com.google.firebase:firebase-messaging:$firebaseVersion"
|
|
|
|
compile "com.google.firebase:firebase-perf:$firebaseVersion"
|
|
|
|
compile "com.google.firebase:firebase-storage:$firebaseVersion"
|
2017-09-27 14:41:25 +00:00
|
|
|
compile "com.google.firebase:firebase-firestore:$firebaseVersion"
|
2017-08-18 20:03:44 +00:00
|
|
|
compile "com.android.support:appcompat-v7:26.0.1"
|
2017-04-23 19:22:19 +00:00
|
|
|
compile "com.facebook.react:react-native:+" // From node_modules
|
|
|
|
}
|
|
|
|
|
|
|
|
// 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'
|