/
build.gradle
134 lines (110 loc) · 4.21 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
134
apply plugin: 'com.android.application'
apply plugin: 'jacoco'
jacoco {
toolVersion = "0.8.0"
}
android {
compileSdkVersion 28
buildToolsVersion "27.0.3"
defaultConfig {
applicationId "ch.epfl.sweng.runpharaa"
minSdkVersion 15
targetSdkVersion 28
versionCode 1
versionName "1.0"
testInstrumentationRunner 'android.support.test.runner.AndroidJUnitRunner'
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
debug {
testCoverageEnabled true
}
}
productFlavors {
}
testOptions {
unitTests.returnDefaultValues = true
}
}
//For mockito
repositories {
jcenter()
}
dependencies {
implementation fileTree(include: ['*.jar'], dir: 'libs')
implementation 'com.android.support:appcompat-v7:28.0.0-rc02'
implementation 'com.android.support:design:28.0.0-rc02'
implementation 'com.android.support.constraint:constraint-layout:1.1.3'
//dependecies for Google maps
implementation 'com.google.android.gms:play-services-maps:15.0.1' //dependency for google maps
implementation 'com.google.android.gms:play-services-location:15.0.1' //dependency for google maps
//dependencies for firebase
implementation 'com.google.firebase:firebase-core:16.0.4'
//dependencies for database
implementation 'com.google.firebase:firebase-database:16.0.3'
implementation 'com.google.firebase:firebase-core:16.0.4'
//dependencies for Google's authentication
implementation 'com.google.firebase:firebase-auth:16.0.4'
implementation 'com.google.android.gms:play-services-auth:16.0.1'
//dependencies for mockito
//testImplementation "org.mockito:mockito-core:+"
//testImplementation "org.mockito:mockito-inline:+"
//androidTestImplementation "org.mockito:mockito-android:+"
//dependencies for round images
implementation 'de.hdodenhof:circleimageview:2.2.0'
//dependency to mock google maps
implementation 'com.google.maps.android:android-maps-utils:0.5+'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:rules:1.0.2'
androidTestImplementation 'com.android.support.test:runner:1.0.2'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
androidTestImplementation "com.android.support.test.espresso:espresso-intents:3.0.2"
androidTestImplementation 'com.android.support.test.espresso:espresso-contrib:3.0.2'
}
configurations.all {
resolutionStrategy.eachDependency { DependencyResolveDetails details ->
def requested = details.requested
if (requested.group == 'com.android.support') {
details.useVersion '26.1.0'
}
}
}
/*
def adb = android.getAdbExe().toString()
tasks.whenTaskAdded { task ->
if (task.name.startsWith('install')) {
task.doLast {
android.applicationVariants.all { variant ->
"${adb} devices".execute().text.eachLine {
if (it.endsWith("device")) {
def device = it.split()[0]
println "Granting test permissions on device ${device}\n"
"${adb} shell appops set ${variant.applicationId} 58 allow".execute()
}
}
}
}
}
}
*/
tasks.withType(Test) {
jacoco.includeNoLocationClasses = true
}
task jacocoTestReport(type: JacocoReport, dependsOn: ['testDebugUnitTest', 'createDebugCoverageReport']) {
reports {
xml.enabled = true
html.enabled = true
}
def fileFilter = ['**/R.class', '**/R$*.class', '**/BuildConfig.*', '**/Manifest*.*', '**/*Test*.*', 'android/**/*.*']
def debugTree = fileTree(dir: "$project.buildDir/intermediates/classes/debug", excludes: fileFilter)
def mainSrc = "$project.projectDir/src/main/java"
sourceDirectories = files([mainSrc])
classDirectories = files([debugTree])
executionData = fileTree(dir: project.buildDir, includes: [
'jacoco/testDebugUnitTest.exec', 'outputs/code-coverage/connected/*coverage.ec'
])
}
apply plugin: 'com.google.gms.google-services'