This repository has been archived by the owner on Apr 29, 2023. It is now read-only.
forked from aragaer/jtt_android
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle
119 lines (103 loc) · 3.66 KB
/
build.gradle
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
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
// -*- Mode: Gradle; tab-width: 4; indent-tabs-mode: nil; -*-
// vim: et ts=4 sts=4 sw=4 syntax=groovy
buildscript {
repositories {
mavenCentral()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.3.2'
}
}
apply plugin: 'com.android.application'
apply plugin: 'jacoco'
repositories {
mavenCentral()
}
dependencies {
compile 'com.luckycatlabs:SunriseSunsetCalculator:1.1'
compile 'com.android.support:support-v4:25.3.1'
compile 'com.google.dagger:dagger:2.10'
annotationProcessor 'com.google.dagger:dagger-compiler:2.10'
testCompile 'junit:junit:4.12'
testCompile 'org.mockito:mockito-core:1.10.19'
testCompile 'org.powermock:powermock-api-mockito:1.6.5'
testCompile 'org.powermock:powermock-module-junit4:1.6.5'
testCompile 'org.hamcrest:hamcrest-integration:1.3'
testCompile 'org.hamcrest:hamcrest-core:1.3'
testCompile 'org.hamcrest:hamcrest-library:1.3'
testCompile 'com.luckycatlabs:SunriseSunsetCalculator:1.1'
androidTestCompile 'com.android.support.test.espresso:espresso-core:2.2.2', {
exclude group: 'com.android.support', module: 'support-annotations'
}
androidTestCompile 'com.android.support.test.uiautomator:uiautomator-v18:2.1.2'
}
android {
sourceSets {
debug.setRoot('build-types/debug')
release.setRoot('build-types/release')
}
compileSdkVersion 'android-25'
buildToolsVersion '25.0.3'
defaultConfig {
testApplicationId "com.aragaer.jtt.test"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
signingConfigs {
release {
storeFile file(System.getenv('HOME')+'/'+RELEASE_STORE_FILE)
storePassword RELEASE_STORE_PASSWORD
keyAlias RELEASE_KEY_ALIAS
keyPassword RELEASE_KEY_PASSWORD
}
}
testOptions {
animationsDisabled = true
}
buildTypes {
debug {
testCoverageEnabled true
}
release {
minifyEnabled true
proguardFile 'proguard.cfg'
signingConfig signingConfigs.release
}
}
}
task jacocoTestReport(type: JacocoReport, dependsOn: ["testDebugUnitTest", "createDebugCoverageReport"]) {
group = "Reporting"
description = "Generate Jacoco coverage reports after running tests."
reports {
xml.enabled = true
html.enabled = true
}
// Class R is used, but usage will not be covered, so ignore this class from report
classDirectories = fileTree(
dir: './build/intermediates/classes/debug',
excludes: ['**/R.class',
'**/R$*.class',
'**/Dagger*Component.class', // covers component implementations
'**/Dagger*Component$Builder.class', // covers component builders
'**/*Module_*Factory.class'
])
sourceDirectories = files('src/main/java')
executionData = fileTree(dir: "$buildDir", includes: [
'jacoco/testDebugUnitTest.exec',
"outputs/code-coverage/connected/*coverage.ec"
])
}
task jacocoTestReportQuick(type: JacocoReport, dependsOn: "test") {
reports.html.enabled = true
classDirectories = tasks.jacocoTestReport.classDirectories
sourceDirectories = tasks.jacocoTestReport.sourceDirectories
executionData = files('build/jacoco/testReleaseUnitTest.exec')
}
gradle.taskGraph.whenReady { graph ->
if (graph.hasTask(createDebugAndroidTestCoverageReport)) {
android.defaultConfig.testInstrumentationRunnerArgument "notAnnotation", "android.support.test.filters.LargeTest"
}
}
tasks.withType(Test) {
testLogging.exceptionFormat = 'full'
}