-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Expand file tree
/
Copy pathbuild.gradle
More file actions
71 lines (63 loc) · 2.56 KB
/
build.gradle
File metadata and controls
71 lines (63 loc) · 2.56 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
repositories {
maven { url 'https://dl.bintray.com/alexeydanilov/maven' }
}
apply plugin: 'com.android.application'
android {
compileSdkVersion 23
buildToolsVersion '25.0.3'
defaultConfig {
applicationId 'com.danikula.proxycache.test'
minSdkVersion 16
targetSdkVersion 23
versionCode 1
versionName '0.1'
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_7
targetCompatibility JavaVersion.VERSION_1_7
}
}
// temporary workaround for Robolectric issue https://github.com/robolectric/robolectric/issues/2647
android.applicationVariants.all { variant ->
def productFlavor = variant.productFlavors[0] != null ? "${variant.productFlavors[0].name.capitalize()}" : ""
def buildType = "${variant.buildType.name.capitalize()}"
tasks["compile${productFlavor}${buildType}UnitTestSources"].dependsOn(tasks["merge${productFlavor}${buildType}Assets"])
}
// display test progress http://stackoverflow.com/a/36130467/999458
tasks.withType(Test) {
testLogging {
// set options for log level LIFECYCLE
events "passed", "skipped", "failed", "standardOut"
showExceptions true
exceptionFormat "full"
showCauses true
showStackTraces true
// set options for log level DEBUG and INFO
debug {
events "started", "passed", "skipped", "failed", "standardOut", "standardError"
exceptionFormat "full"
}
info.events = debug.events
info.exceptionFormat = debug.exceptionFormat
afterSuite { desc, result ->
if (!desc.parent) { // will match the outermost suite
def output = "Results: ${result.resultType} (${result.testCount} tests, ${result.successfulTestCount} successes, ${result.failedTestCount} failures, ${result.skippedTestCount} skipped)"
def startItem = '| ', endItem = ' |'
def repeatLength = startItem.length() + output.length() + endItem.length()
println('\n' + ('-' * repeatLength) + '\n' + startItem + output + endItem + '\n' + ('-' * repeatLength))
}
}
}
}
dependencies {
compile project(':library')
testCompile 'org.slf4j:slf4j-simple:1.7.21'
testCompile 'junit:junit:4.12'
testCompile 'org.robolectric:robolectric:3.3.2'
testCompile 'com.squareup:fest-android:1.0.0'
testCompile 'com.google.guava:guava-jdk5:17.0'
testCompile('com.danikula:android-garden:2.1.4') {
exclude group: 'com.google.android'
}
testCompile 'org.mockito:mockito-all:1.9.5'
}