react-native-navigation的迁移库

build.gradle 3.8KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113
  1. apply plugin: 'com.android.library'
  2. apply from: '../prepare-robolectric.gradle'
  3. def safeExtGet(prop, fallback) {
  4. rootProject.ext.has(prop) ? rootProject.ext.get(prop) : fallback
  5. }
  6. def DEFAULT_COMPILE_SDK_VERSION = 28
  7. def DEFAULT_MIN_SDK_VERSION = 19
  8. def DEFAULT_SUPPORT_LIB_VERSION = '28.0.0'
  9. def DEFAULT_TARGET_SDK_VERSION = 28
  10. android {
  11. compileSdkVersion safeExtGet('compileSdkVersion', DEFAULT_COMPILE_SDK_VERSION)
  12. defaultConfig {
  13. minSdkVersion safeExtGet('minSdkVersion', DEFAULT_MIN_SDK_VERSION)
  14. targetSdkVersion safeExtGet('targetSdkVersion', DEFAULT_TARGET_SDK_VERSION)
  15. versionCode 1
  16. versionName "1.0"
  17. }
  18. buildTypes {
  19. release {
  20. minifyEnabled false
  21. }
  22. debug {
  23. minifyEnabled false
  24. }
  25. }
  26. lintOptions {
  27. abortOnError false
  28. }
  29. testOptions {
  30. unitTests.all { t ->
  31. reports {
  32. html.enabled true
  33. }
  34. testLogging {
  35. events "PASSED", "SKIPPED", "FAILED", "standardOut", "standardError"
  36. }
  37. afterSuite { desc, result ->
  38. if (!desc.parent) { // will match the outermost suite
  39. def output = " ${result.resultType} (${result.successfulTestCount} successes, ${result.failedTestCount} failures, ${result.skippedTestCount} skipped) "
  40. def repeatLength = output.length()
  41. println '\n\n' + ('-' * repeatLength) + '\n' + output + '\n' + ('-' * repeatLength) + '\n'
  42. println "see report at file://${t.reports.html.destination}/index.html"
  43. }
  44. }
  45. }
  46. }
  47. compileOptions {
  48. sourceCompatibility JavaVersion.VERSION_1_8
  49. targetCompatibility JavaVersion.VERSION_1_8
  50. }
  51. flavorDimensions "RNN.reactNativeVersion"
  52. productFlavors {
  53. reactNative51 {
  54. dimension "RNN.reactNativeVersion"
  55. buildConfigField("int", "REACT_NATVE_VERSION_MINOR", "51")
  56. }
  57. reactNative55 {
  58. dimension "RNN.reactNativeVersion"
  59. buildConfigField("int", "REACT_NATVE_VERSION_MINOR", "55")
  60. }
  61. reactNative56 {
  62. dimension "RNN.reactNativeVersion"
  63. buildConfigField("int", "REACT_NATVE_VERSION_MINOR", "56")
  64. }
  65. reactNative57 {
  66. dimension "RNN.reactNativeVersion"
  67. buildConfigField("int", "REACT_NATVE_VERSION_MINOR", "57")
  68. }
  69. reactNative57_5 {
  70. dimension "RNN.reactNativeVersion"
  71. buildConfigField("int", "REACT_NATVE_VERSION_MINOR", "57")
  72. }
  73. }
  74. }
  75. allprojects { p ->
  76. p.afterEvaluate {
  77. p.android.compileOptions.sourceCompatibility JavaVersion.VERSION_1_8
  78. p.android.compileOptions.targetCompatibility JavaVersion.VERSION_1_8
  79. }
  80. p.repositories {
  81. maven { url "https://jitpack.io" }
  82. }
  83. }
  84. def supportLibVersion = safeExtGet('supportLibVersion', DEFAULT_SUPPORT_LIB_VERSION)
  85. dependencies {
  86. implementation "com.android.support:design:${supportLibVersion}"
  87. implementation "com.android.support:appcompat-v7:${supportLibVersion}"
  88. implementation "com.android.support:support-v4:${supportLibVersion}"
  89. implementation 'com.github.wix-playground:ahbottomnavigation:2.4.15'
  90. implementation 'com.github.wix-playground:reflow-animator:1.0.4'
  91. implementation 'com.github.clans:fab:1.6.4'
  92. //noinspection GradleDynamicVersion
  93. implementation 'com.facebook.react:react-native:+'
  94. // tests
  95. testImplementation 'junit:junit:4.12'
  96. testImplementation 'org.robolectric:robolectric:3.5.1'
  97. testImplementation 'org.assertj:assertj-core:3.8.0'
  98. testImplementation 'com.squareup.assertj:assertj-android:1.1.1'
  99. testImplementation 'org.mockito:mockito-core:2.13.0'
  100. }