react-native-navigation的迁移库

build.gradle 2.2KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  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 25
  19. buildToolsVersion "25.0.1"
  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.facebook.react:react-native:+'
  61. compile project(':react-native-navigation')
  62. }