-
Notifications
You must be signed in to change notification settings - Fork 3
/
build.gradle
165 lines (131 loc) · 5.17 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
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
description = 'OpenSRP growth monitoring client library'
buildscript {
repositories {
google()
jcenter()
}
dependencies {
classpath "com.android.tools.build:gradle:$androidToolsBuildGradle"
classpath 'org.kt3k.gradle.plugin:coveralls-gradle-plugin:2.8.3'
}
}
apply plugin: 'com.android.library'
apply plugin: 'jacoco'
apply plugin: 'com.github.kt3k.coveralls'
jacoco {
toolVersion = "0.8.5"
}
android {
compileSdkVersion androidCompileSdkVersion
buildToolsVersion androidBuildToolsVersion
defaultPublishConfig !isReleaseBuild() ? "debug" : "release"
defaultConfig {
minSdkVersion androidMinSdkVersion
targetSdkVersion androidTargetSdkVersion
versionCode Integer.parseInt(project.VERSION_CODE)
versionName project.VERSION_NAME
multiDexEnabled true
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
buildConfigField "int", "GROWTH_MONITORING_SYNC_TIME", '15'
}
debug {
buildConfigField "int", "GROWTH_MONITORING_SYNC_TIME", '15'
testCoverageEnabled true
}
}
dexOptions {
javaMaxHeapSize "4g"
}
lintOptions {
abortOnError false
}
// avoid errors with message 'Duplicate files copied in APK ...'
packagingOptions {
exclude 'LICENSE.txt'
exclude 'META-INF/LICENSE'
exclude 'META-INF/LICENSE.txt'
exclude 'META-INF/license.txt'
exclude 'META-INF/NOTICE.txt'
exclude 'META-INF/notice.txt'
exclude 'META-INF/ASL2.0'
}
testOptions {
unitTests {
includeAndroidResources = true
}
}
}
tasks.withType(Test) {
jacoco.includeNoLocationClasses = true
}
allprojects {
repositories {
maven { url 'https://oss.sonatype.org/content/repositories/snapshots/' }
maven { url "https://s3.amazonaws.com/repo.commonsware.com" }
mavenLocal()
}
}
dependencies {
implementation('org.smartregister:opensrp-client-core:1.8.25-SNAPSHOT@aar') {
transitive = true
exclude group: 'com.github.bmelnychuk', module: 'atv'
}
implementation('org.smartregister:opensrp-client-native-form:1.7.15-SNAPSHOT@aar') {
transitive = true
exclude group: 'com.android.support', module: 'recyclerview-v7'
}
implementation 'com.android.support:design:28.0.0'
implementation 'com.android.support:appcompat-v7:28.0.0'
implementation group: 'org.apache.commons', name: 'commons-csv', version: '1.4'
implementation 'com.google.code.gson:gson:2.8.5'
implementation 'com.mcxiaoke.volley:library:1.0.19'
implementation 'com.github.lecho:hellocharts-android:v1.5.8'
testImplementation 'junit:junit:4.12'
testImplementation('org.robolectric:robolectric:3.8') {
exclude group: 'com.google.guava', module: 'guava'
exclude group: 'org.apache.maven', module: 'maven-model'
exclude group: 'org.apache.maven', module: 'maven-ant-tasks'
exclude group: 'com.android.support'
exclude group: 'com.thoughtworks.xstream', module: 'xstream'
}
testImplementation("org.robolectric:shadows-multidex:3.8") {
exclude group: 'com.google.guava', module: 'guava'
}
androidTestImplementation('com.android.support.test.espresso:espresso-core:2.+') {
exclude group: 'com.android.support', module: 'support-annotations'
exclude group: 'junit', module: 'junit'
}
// PowerMock
def powerMockVersion = '1.7.1'
testImplementation "org.powermock:powermock-module-junit4:$powerMockVersion"
testImplementation "org.powermock:powermock-module-junit4-rule:$powerMockVersion"
testImplementation "org.powermock:powermock-api-mockito2:$powerMockVersion"
testImplementation("org.powermock:powermock-classloading-xstream:$powerMockVersion")
testImplementation 'org.apache.maven:maven-ant-tasks:2.1.3'
testImplementation group: 'org.skyscreamer', name: 'jsonassert', version: '1.2.3'
}
task jacocoTestReport(type: JacocoReport, dependsOn: ['testDebugUnitTest']) {
reports {
xml.enabled = true
html.enabled = true
}
getReports().getXml().setDestination(file("${buildDir}/reports/jacoco/jacocoRootReport/merged.xml"))
getReports().getHtml().setDestination(file("${buildDir}/reports/jacoco/jacocoRootReport/html"))
def fileFilter = ['**/R.class', '**/R$*.class', '**/BuildConfig.*', '**/Manifest*.*', '**/*Test*.*', 'android/**/*.*', '**/*$ViewBinder*.*']
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'
])
}
coveralls {
jacocoReportPath = "${buildDir}/reports/jacoco/jacocoRootReport/merged.xml"
}
apply from: '../maven.gradle'