-
Notifications
You must be signed in to change notification settings - Fork 6
/
build.gradle
159 lines (134 loc) · 5.75 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
buildscript {
def versionMajor = 1
def versionMinor = 0
def versionPatch = 1
ext.versions = [
'versionCode' : versionMajor * 10000 + versionMinor * 100 + versionPatch,
'versionName' : "${versionMajor}.${versionMinor}.${versionPatch}",
'minSdk' : 16,
'targetSdk' : 27,
'compileSdk' : 27,
'sourceCompatibility': JavaVersion.VERSION_1_8,
'targetCompatibility': JavaVersion.VERSION_1_8,
'supportLibrary' : '27.1.1',
'buildTools' : '27.0.3'
]
ext.deps = [
'support' : [
'annotations': "com.android.support:support-annotations:${versions.supportLibrary}",
'appcompat' : "com.android.support:appcompat-v7:${versions.supportLibrary}"
],
androidPlugin: 'com.android.tools.build:gradle:3.1.2',
rxJava : "io.reactivex.rxjava2:rxjava:2.1.12",
rxJavaReplay : "com.jakewharton.rx2:replaying-share:2.0.1",
jUnit : "junit:junit:4.12",
mockito : "org.mockito:mockito-core:2.8.9",
]
repositories {
google()
mavenCentral()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.3.0'
classpath 'com.github.dcendents:android-maven-gradle-plugin:2.1'
classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.8.0'
//noinspection GradleDependency
classpath 'org.kt3k.gradle.plugin:coveralls-gradle-plugin:2.8.2'
classpath 'com.bugsnag:bugsnag-android-gradle-plugin:4.+'
}
}
project.ext.preDexLibs = !project.hasProperty('disablePreDex')
subprojects {
group = 'org.smartregister'
ext.androidToolsBuildGradle = '3.1.2'
ext.androidBuildToolsVersion = '27.0.3'
ext.androidMinSdkVersion = 16
ext.androidCompileSdkVersion = 27
ext.androidTargetSdkVersion = 27
ext.androidAnnotationsVersion = '3.0.1'
ext.androidAnnotationsAPIVersion = '3.0.1'
repositories {
jcenter()
mavenCentral()
mavenLocal()
maven { url 'https://jitpack.io' }
maven { url "${projectDir}/libs/" }
// maven { url "http://nexus.motechproject.org/content/repositories/drishti" }
// maven { url "http://nexus.motechproject.org/content/repositories/snapshots" }
maven { url "http://acra.googlecode.com/svn/repository/releases" }
maven { url "https://repo.maven.apache.org/maven2" }
maven { url "http://cloudant.github.io/cloudant-sync-eap/repository" }
maven { url "${projectDir}/opensrp-bidan/../libs/" }
maven { url "${projectDir}/opensrp-gizi/../libs/" }
maven { url "${projectDir}/opensrp-vaksinator/../libs/" }
mavenLocal()
}
// Improve build server performance by allowing disabling of pre-dexing
// (see http://tools.android.com/tech-docs/new-build-system/tips#TOC-Improving-Build-Server-performance.)
project.plugins.whenPluginAdded { plugin ->
if ("com.android.build.gradle.AppPlugin".equals(plugin.class.name)) {
project.android.dexOptions.preDexLibraries = rootProject.ext.preDexLibs
} else if ("com.android.build.gradle.LibraryPlugin".equals(plugin.class.name)) {
project.android.dexOptions.preDexLibraries = rootProject.ext.preDexLibs
}
}
}
apply plugin: 'java'
apply plugin: 'build-dashboard'
apply plugin: "com.github.kt3k.coveralls"
buildDashboard {
reports.html.setDestination(file("build/"))
}
test.reports.html.enabled = false
test.reports.junitXml.enabled = false
allprojects {
apply plugin: 'jacoco'
repositories {
google()
jcenter()
}
}
subprojects { subProject ->
def exclude = ['org/smartregister/*/R*.class', '**/BuildConfig.class', '**/R.class', '**/R$*.class', '**/BuildConfig.*', '**/Manifest*.*']
task jacocoTestReport(type: JacocoReport, dependsOn: ['testDebugUnitTest']) {
reports {
xml.enabled = true
html.enabled = true
}
sourceDirectories = files(["${project.projectDir}/src/main/java"])
classDirectories = files([fileTree(dir: "$project.buildDir/intermediates/classes/debug", excludes: exclude)])
executionData = fileTree(dir: "$project.buildDir", includes: [
"jacoco/testDebugUnitTest.exec"
])
rootProject.coveralls.sourceDirs.addAll(sourceDirectories.flatten())
}
project.plugins.whenPluginAdded { plugin ->
if ("com.android.build.gradle.AppPlugin".equals(plugin.class.name)) {
project.android.dexOptions.preDexLibraries = rootProject.ext.preDexLibs
} else if ("com.android.build.gradle.LibraryPlugin".equals(plugin.class.name)) {
project.android.dexOptions.preDexLibraries = rootProject.ext.preDexLibs
}
}
}
def publishedProjects = subprojects.findAll { !it.path.contains('opensrp') }
task jacocoRootReport(type: JacocoReport, group: 'Coverage reports') {
description = 'Generates an aggregate report from all subprojects'
dependsOn(publishedProjects.jacocoTestReport)
additionalSourceDirs = files(publishedProjects.sourceSets.main.allSource.srcDirs)
sourceDirectories = files(publishedProjects.jacocoTestReport.sourceDirectories)
classDirectories = files(publishedProjects.jacocoTestReport.classDirectories)
executionData = files(publishedProjects.jacocoTestReport.executionData)
reports {
html.enabled = true
xml.enabled = true
}
}
coveralls {
jacocoReportPath = "${buildDir}/reports/jacoco/jacocoRootReport/jacocoRootReport.xml"
}
tasks.coveralls {
group = 'Coverage reports'
description = 'Uploads the aggregated coverage report to Coveralls'
dependsOn jacocoRootReport
}