react-native-navigation的迁移库

build.gradle 2.2KB

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