-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathbuild.gradle
133 lines (115 loc) · 3.97 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
120
121
122
123
124
125
126
127
128
129
130
131
132
133
// -*- Mode: Gradle; tab-width: 4; indent-tabs-mode: nil; -*-
// vim: et ts=4 sts=4 sw=4 syntax=groovy
buildscript {
repositories {
google()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.4.2'
}
}
apply plugin: 'com.android.application'
apply plugin: 'jacoco'
wrapper {
gradleVersion = '5.1.1'
distributionType = Wrapper.DistributionType.ALL
}
repositories {
mavenCentral()
jcenter()
google()
}
dependencies {
repositories {
google()
}
implementation 'com.luckycatlabs:SunriseSunsetCalculator:1.1'
implementation 'androidx.viewpager:viewpager:1.0.0'
implementation 'com.google.dagger:dagger:2.10'
implementation 'org.jetbrains:annotations-java5:15.0'
annotationProcessor 'com.google.dagger:dagger-compiler:2.10'
testImplementation 'junit:junit:4.12'
testImplementation 'org.mockito:mockito-core:1.10.19'
testImplementation 'org.powermock:powermock-api-mockito:1.6.5'
testImplementation 'org.powermock:powermock-module-junit4:1.6.5'
testImplementation 'org.hamcrest:hamcrest-integration:1.3'
testImplementation 'org.hamcrest:hamcrest-core:1.3'
testImplementation 'org.hamcrest:hamcrest-library:1.3'
testImplementation 'com.luckycatlabs:SunriseSunsetCalculator:1.1'
androidTestImplementation 'androidx.test:rules:1.2.0'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.1.0', {
exclude group: 'com.android.support', module: 'support-annotations'
}
androidTestImplementation 'androidx.test.uiautomator:uiautomator:2.2.0'
}
android {
sourceSets {
debug.setRoot('build-types/debug')
release.setRoot('build-types/release')
}
compileSdkVersion 'android-29'
buildToolsVersion '29.0.1'
defaultConfig {
testApplicationId "com.aragaer.jtt.test"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
minSdkVersion 14
targetSdkVersion 29
resConfigs "en", "ru", "de", "ja"
}
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
shrinkResources true
}
}
}
task jacocoTestReport(type: JacocoReport, dependsOn: "testDebugUnitTest") {
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 = files('jacoco/testDebugUnitTest.exec')
}
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", "androidx.test.filters.LargeTest"
}
}
tasks.withType(Test) {
testLogging.exceptionFormat = 'full'
}