react-native-navigation的迁移库

build.gradle 2.7KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  1. apply plugin: 'com.android.library'
  2. apply from: '../prepare-robolectric.gradle'
  3. apply plugin: 'jacoco'
  4. android {
  5. compileSdkVersion 25
  6. buildToolsVersion "25.0.2"
  7. defaultConfig {
  8. minSdkVersion 16
  9. targetSdkVersion 25
  10. versionCode 1
  11. versionName "1.0"
  12. }
  13. buildTypes {
  14. release {
  15. minifyEnabled false
  16. }
  17. debug {
  18. minifyEnabled false
  19. }
  20. }
  21. lintOptions {
  22. abortOnError false
  23. }
  24. testOptions {
  25. unitTests.all { t ->
  26. reports {
  27. html.enabled true
  28. }
  29. testLogging {
  30. events "passed", "skipped", "failed", "standardOut", "standardError"
  31. }
  32. afterSuite { desc, result ->
  33. if (!desc.parent) { // will match the outermost suite
  34. def output = " ${result.resultType} (${result.successfulTestCount} successes, ${result.failedTestCount} failures, ${result.skippedTestCount} skipped) "
  35. def repeatLength = output.length()
  36. println '\n\n' + ('-' * repeatLength) + '\n' + output + '\n' + ('-' * repeatLength) + '\n'
  37. println "see report at file://${t.reports.html.destination}/index.html"
  38. }
  39. }
  40. jacoco {
  41. includeNoLocationClasses = true
  42. }
  43. }
  44. }
  45. }
  46. task unitTest(type: JacocoReport, dependsOn: 'testDebugUnitTest') {
  47. reports {
  48. xml.enabled = false
  49. html.enabled = true
  50. }
  51. def fileFilter = ['**/R.class', '**/R$*.class', '**/BuildConfig.*', '**/Manifest*.*', '**/*Test*.*', 'android/**/*.*']
  52. def debugTree = fileTree(dir: "${buildDir}/intermediates/classes/debug", excludes: fileFilter)
  53. def mainSrc = "${project.projectDir}/src/main/java"
  54. sourceDirectories = files([mainSrc])
  55. classDirectories = files([debugTree])
  56. executionData = files("${buildDir}/jacoco/testDebugUnitTest.exec")
  57. doLast {
  58. println "See code coverage at file://${jacoco.reportsDir}/unitTest/html/index.html"
  59. }
  60. }
  61. dependencies {
  62. compile fileTree(include: ['*.jar'], dir: 'libs')
  63. compile 'com.android.support:design:25.1.1'
  64. compile 'com.android.support:appcompat-v7:25.1.1'
  65. compile "com.android.support:support-v4:25.1.1"
  66. // node_modules
  67. compile 'com.facebook.react:react-native:+'
  68. // third party
  69. compile 'com.aurelhubert:ahbottomnavigation:1.3.3'
  70. compile 'com.balysv.materialmenu:material-menu-toolbar:1.5.4'
  71. // tests
  72. testCompile 'junit:junit:4.12'
  73. testCompile 'org.robolectric:robolectric:3.3'
  74. testCompile 'org.assertj:assertj-core:2.5.0'
  75. testCompile 'org.mockito:mockito-core:2.7.5'
  76. }