|
| 1 | +buildscript { |
| 2 | + apply from: rootProject.file("../gradle/dependencies.gradle") |
| 3 | + |
| 4 | + repositories { |
| 5 | + google() |
| 6 | + jcenter() |
| 7 | + maven { url "https://oss.sonatype.org/content/repositories/snapshots" } // For Spoon snapshot, until 2.0.0 is released |
| 8 | + mavenLocal() |
| 9 | + } |
| 10 | + |
| 11 | + dependencies { |
| 12 | + classpath deps.gradle |
| 13 | + classpath deps.kotlinGradlePlugin |
| 14 | + classpath "com.jaredsburrows:gradle-spoon-plugin:latest.integration" |
| 15 | + } |
| 16 | +} |
| 17 | + |
| 18 | +repositories { |
| 19 | + jcenter() |
| 20 | + google() |
| 21 | + maven { url "https://oss.sonatype.org/content/repositories/snapshots" } // For Spoon snapshot, until 2.0.0 is released |
| 22 | +} |
| 23 | + |
| 24 | +apply plugin: "com.android.application" |
| 25 | +apply plugin: "kotlin-android" |
| 26 | +apply plugin: "com.jaredsburrows.spoon" |
| 27 | + |
| 28 | +android { |
| 29 | + compileSdkVersion rootProject.ext.minSdkVersion |
| 30 | + buildToolsVersion rootProject.ext.buildToolsVersion |
| 31 | + |
| 32 | + defaultConfig { |
| 33 | + applicationId "com.jaredsburrows.spoon.example" |
| 34 | + minSdkVersion rootProject.ext.minSdkVersion |
| 35 | + targetSdkVersion rootProject.ext.targetSdkVersion |
| 36 | + versionCode 1 |
| 37 | + versionName "1.0" |
| 38 | + |
| 39 | + testApplicationId "com.jaredsburrows.spoon.example.test" |
| 40 | + testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" |
| 41 | + } |
| 42 | + |
| 43 | + buildTypes { |
| 44 | + debug { |
| 45 | + testCoverageEnabled = true |
| 46 | + } |
| 47 | + } |
| 48 | +} |
| 49 | + |
| 50 | +spoon { |
| 51 | + debug = true |
| 52 | + |
| 53 | + output = file("$buildDir/custom-report-dir") |
| 54 | + |
| 55 | + if (project.hasProperty("spoonClassName")) { |
| 56 | + className = project.spoonClassName |
| 57 | + |
| 58 | + if (project.hasProperty("spoonMethodName")) { |
| 59 | + methodName = project.spoonMethodName |
| 60 | + } |
| 61 | + } |
| 62 | + |
| 63 | + instrumentationArgs = ["foo:bar"] |
| 64 | + |
| 65 | + adbTimeout = 30 |
| 66 | + |
| 67 | +// codeCoverage = true |
| 68 | + |
| 69 | + grantAllPermissions = true |
| 70 | +} |
| 71 | + |
| 72 | +configurations.all { |
| 73 | + resolutionStrategy { |
| 74 | + force deps.orgJacocoAgent |
| 75 | + force deps.orgJacocoAnt |
| 76 | + } |
| 77 | +} |
| 78 | + |
| 79 | +dependencies { |
| 80 | + implementation deps.kotlinStdlib |
| 81 | + |
| 82 | + androidTestImplementation deps.truth |
| 83 | + androidTestImplementation deps.junit |
| 84 | + androidTestImplementation deps.spoonClient |
| 85 | + androidTestImplementation deps.runner |
| 86 | + androidTestImplementation deps.rules |
| 87 | +} |
| 88 | + |
| 89 | +task checkReports() { |
| 90 | + doLast { |
| 91 | + assert project.tasks.spoonDebugAndroidTest != null |
| 92 | + assert project.file("$buildDir/custom-report-dir").exists() |
| 93 | + assert project.file("$buildDir/custom-report-dir/debug").exists() |
| 94 | +// assert project.file("$buildDir/custom-report-dir/debug/coverage").exists() |
| 95 | + } |
| 96 | +} |
0 commit comments