react-native-navigation的迁移库

build.gradle 2.3KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. apply plugin: "com.android.application"
  2. import com.android.build.OutputFile
  3. apply from: "../../node_modules/react-native/react.gradle"
  4. /**
  5. * Set this to true to create two separate APKs instead of one:
  6. * - An APK that only works on ARM devices
  7. * - An APK that only works on x86 devices
  8. * The advantage is the size of the APK is reduced by about 4MB.
  9. * Upload all the APKs to the Play Store and people will download
  10. * the correct one based on the CPU architecture of their device.
  11. */
  12. def enableSeparateBuildPerCPUArchitecture = false
  13. /**
  14. * Run Proguard to shrink the Java bytecode in release builds.
  15. */
  16. def enableProguardInReleaseBuilds = false
  17. android {
  18. compileSdkVersion 23
  19. buildToolsVersion "23.0.3"
  20. defaultConfig {
  21. applicationId "com.example"
  22. minSdkVersion 16
  23. targetSdkVersion 23
  24. versionCode 1
  25. versionName "1.0"
  26. ndk {
  27. abiFilters "armeabi-v7a", "x86"
  28. }
  29. }
  30. splits {
  31. abi {
  32. reset()
  33. enable enableSeparateBuildPerCPUArchitecture
  34. universalApk false // If true, also generate a universal APK
  35. include "armeabi-v7a", "x86"
  36. }
  37. }
  38. buildTypes {
  39. release {
  40. minifyEnabled enableProguardInReleaseBuilds
  41. proguardFiles getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro"
  42. }
  43. }
  44. // applicationVariants are e.g. debug, release
  45. applicationVariants.all { variant ->
  46. variant.outputs.each { output ->
  47. // For each separate APK per architecture, set a unique version code as described here:
  48. // http://tools.android.com/tech-docs/new-build-system/user-guide/apk-splits
  49. def versionCodes = ["armeabi-v7a": 1, "x86": 2]
  50. def abi = output.getFilter(OutputFile.ABI)
  51. if (abi != null) { // null for the universal-debug, universal-release variants
  52. output.versionCodeOverride =
  53. versionCodes.get(abi) * 1048576 + defaultConfig.versionCode
  54. }
  55. }
  56. }
  57. }
  58. dependencies {
  59. compile fileTree(dir: 'libs', include: ['*.jar'])
  60. compile 'com.android.support:appcompat-v7:23.0.1'
  61. compile 'com.facebook.react:react-native:+'
  62. compile project(':react-native-navigation')
  63. }