react-native-navigation的迁移库

prepare-robolectric.gradle 959B

123456789101112131415161718192021222324252627282930313233
  1. def robolectricDependenciesFolder = new File(rootProject.buildDir, "robolectric-3.2.2-dependencies")
  2. configurations.create('robolectricRuntime')
  3. dependencies {
  4. robolectricRuntime "org.robolectric:android-all:6.0.1_r3-robolectric-0"
  5. robolectricRuntime "org.robolectric:shadows-core:3.2.2"
  6. }
  7. rootProject.task(type: Copy, overwrite: true, "downloadRobolectricDependencies") {
  8. println "downloadRobolectricDependencies into " + robolectricDependenciesFolder
  9. from configurations.robolectricRuntime
  10. into robolectricDependenciesFolder
  11. }
  12. project.afterEvaluate {
  13. tasks.all {
  14. if (it.name.startsWith("test")) {
  15. it.dependsOn(rootProject.tasks.findByName("downloadRobolectricDependencies"))
  16. }
  17. }
  18. }
  19. android {
  20. testOptions {
  21. unitTests.all {
  22. systemProperty 'robolectric.offline', 'true'
  23. systemProperty 'robolectric.dependency.dir', robolectricDependenciesFolder
  24. }
  25. }
  26. }