123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141 |
- apply plugin: "com.android.application"
-
- import com.android.build.OutputFile
-
- /**
- * The react.gradle file registers a task for each build variant (e.g. bundleDebugJsAndAssets
- * and bundleReleaseJsAndAssets).
- * These basically call `react-native bundle` with the correct arguments during the Android build
- * cycle. By default, bundleDebugJsAndAssets is skipped, as in debug/dev mode we prefer to load the
- * bundle directly from the development server. Below you can see all the possible configurations
- * and their defaults. If you decide to add a configuration block, make sure to add it before the
- * `apply from: "../../node_modules/react-native/react.gradle"` line.
- *
- * project.ext.react = [
- *
- * bundleAssetName: "index.android.bundle",
- *
- *
- * entryFile: "index.android.js",
- *
- *
- * bundleInDebug: false,
- *
- *
- * bundleInRelease: true,
- *
- *
- *
- *
- *
- *
- *
- *
- *
- *
- *
- * root: "../../",
- *
- *
- * jsBundleDirDebug: "$buildDir/intermediates/assets/debug",
- *
- *
- * jsBundleDirRelease: "$buildDir/intermediates/assets/release",
- *
- *
- *
- * resourcesDirDebug: "$buildDir/intermediates/res/merged/debug",
- *
- *
- *
- * resourcesDirRelease: "$buildDir/intermediates/res/merged/release",
- *
- *
- *
- *
- *
- *
- * inputExcludes: ["android/**", "ios/**"],
- *
- *
- * nodeExecutableAndArgs: ["node"]
- *
- *
- * extraPackagerArgs: []
- * ]
- */
-
- apply from: "../../node_modules/react-native/react.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 {
- compileSdkVersion 23
- buildToolsVersion "23.0.3"
-
- defaultConfig {
- applicationId "com.exampleredux"
- minSdkVersion 16
- targetSdkVersion 23
- versionCode 1
- versionName "1.0"
- ndk {
- abiFilters "armeabi-v7a", "x86"
- }
- }
- splits {
- abi {
- reset()
- enable enableSeparateBuildPerCPUArchitecture
- universalApk false
- include "armeabi-v7a", "x86"
- }
- }
- buildTypes {
- release {
- minifyEnabled enableProguardInReleaseBuilds
- proguardFiles getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro"
- }
- }
-
- applicationVariants.all { variant ->
- variant.outputs.each { output ->
-
-
- def versionCodes = ["armeabi-v7a": 1, "x86": 2]
- def abi = output.getFilter(OutputFile.ABI)
- if (abi != null) {
- output.versionCodeOverride =
- versionCodes.get(abi) * 1048576 + defaultConfig.versionCode
- }
- }
- }
- }
-
- dependencies {
- compile fileTree(dir: "libs", include: ["*.jar"])
- compile "com.android.support:appcompat-v7:23.0.1"
- compile "com.facebook.react:react-native:+"
- compile project(':react-native-navigation')
- }
-
-
-
- task copyDownloadableDepsToLibs(type: Copy) {
- from configurations.compile
- into 'libs'
- }
|