@@ -3,12 +3,13 @@ apply plugin: "com.android.application"
33import com.android.build.OutputFile
44
55/**
6- * The react.gradle file registers two tasks: bundleDebugJsAndAssets and bundleReleaseJsAndAssets.
6+ * The react.gradle file registers a task for each build variant (e.g. bundleDebugJsAndAssets
7+ * and bundleReleaseJsAndAssets).
78 * These basically call `react-native bundle` with the correct arguments during the Android build
89 * cycle. By default, bundleDebugJsAndAssets is skipped, as in debug/dev mode we prefer to load the
910 * bundle directly from the development server. Below you can see all the possible configurations
1011 * and their defaults. If you decide to add a configuration block, make sure to add it before the
11- * `apply from: "react.gradle"` line.
12+ * `apply from: "../../node_modules/react-native/ react.gradle"` line.
1213 *
1314 * project.ext.react = [
1415 * // the name of the generated asset file containing your JS bundle
@@ -23,6 +24,15 @@ import com.android.build.OutputFile
2324 * // whether to bundle JS and assets in release mode
2425 * bundleInRelease: true,
2526 *
27+ * // whether to bundle JS and assets in another build variant (if configured).
28+ * // See http://tools.android.com/tech-docs/new-build-system/user-guide#TOC-Build-Variants
29+ * // The configuration property can be in the following formats
30+ * // 'bundleIn${productFlavor}${buildType}'
31+ * // 'bundleIn${buildType}'
32+ * // bundleInFreeDebug: true,
33+ * // bundleInPaidRelease: true,
34+ * // bundleInBeta: true,
35+ *
2636 * // the root of your project, i.e. where "package.json" lives
2737 * root: "../../",
2838 *
@@ -45,15 +55,20 @@ import com.android.build.OutputFile
4555 * // date; if you have any other folders that you want to ignore for performance reasons (gradle
4656 * // indexes the entire tree), add them here. Alternatively, if you have JS files in android/
4757 * // for example, you might want to remove it from here.
48- * inputExcludes: ["android/**", "ios/**"]
58+ * inputExcludes: ["android/**", "ios/**"],
59+ *
60+ * // override which node gets called and with what additional arguments
61+ * nodeExecutableAndArgs: ["node"]
62+ *
63+ * // supply additional arguments to the packager
64+ * extraPackagerArgs: []
4965 * ]
5066 */
5167
52- apply from : " react.gradle"
68+ apply from : " ../../node_modules/react-native/ react.gradle"
5369
5470/**
55- * Set this to true to create three separate APKs instead of one:
56- * - A universal APK that works on all devices
71+ * Set this to true to create two separate APKs instead of one:
5772 * - An APK that only works on ARM devices
5873 * - An APK that only works on x86 devices
5974 * The advantage is the size of the APK is reduced by about 4MB.
@@ -83,9 +98,9 @@ android {
8398 }
8499 splits {
85100 abi {
86- enable enableSeparateBuildPerCPUArchitecture
87- universalApk true
88101 reset()
102+ enable enableSeparateBuildPerCPUArchitecture
103+ universalApk false // If true, also generate a universal APK
89104 include " armeabi-v7a" , " x86"
90105 }
91106 }
@@ -113,5 +128,12 @@ android {
113128dependencies {
114129 compile fileTree(dir : " libs" , include : [" *.jar" ])
115130 compile " com.android.support:appcompat-v7:23.0.1"
116- compile " com.facebook.react:react-native:0.18.+"
131+ compile " com.facebook.react:react-native:+" // From node_modules
132+ }
133+
134+ // Run this once to be able to run the application with BUCK
135+ // puts all compile dependencies into folder libs for BUCK to use
136+ task copyDownloadableDepsToLibs (type : Copy ) {
137+ from configurations. compile
138+ into ' libs'
117139}
0 commit comments