forked from opensrp/opensrp-client-chw-core
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
157 lines (131 loc) · 4.79 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
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
google()
mavenCentral()
maven { url 'https://oss.sonatype.org/content/repositories/snapshots/' }
maven { url 'https://jitpack.io' }
maven { url "https://repo.maven.apache.org/maven2" }
maven { url "http://cloudant.github.io/cloudant-sync-eap/repository" }
maven{ url "https://plugins.gradle.org/m2/" }
mavenLocal()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:4.0.0'
classpath 'gradle.plugin.org.kt3k.gradle.plugin:coveralls-gradle-plugin:2.10.2'
classpath "io.codearte.gradle.nexus:gradle-nexus-staging-plugin:0.11.0"
classpath 'org.smartregister:gradle-jarjar-plugin:1.0.0-SNAPSHOT'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
apply plugin: 'com.github.kt3k.coveralls'
apply plugin: 'jacoco'
apply plugin: 'io.codearte.nexus-staging'
jacoco {
toolVersion = "0.8.0"
}
allprojects {
tasks.whenTaskAdded { task ->
if (task.name == "lint") {
task.enabled = false
}
}
repositories {
google()
mavenLocal()
mavenCentral()
maven { url 'https://maven.google.com' }
maven { url 'https://oss.sonatype.org/content/repositories/snapshots/' }
maven { url 'https://jitpack.io' }
maven { url "https://acra.googlecode.com/svn/repository/releases" }
maven { url "https://repo.maven.apache.org/maven2" }
maven { url "https://cloudant.github.io/cloudant-sync-eap/repository" }
maven { url 'https://maven.fabric.io/public' }
maven { url "https://s3.amazonaws.com/repo.commonsware.com" }
maven { url "https://s3.amazonaws.com/repo.commonsware.com" }
maven{ url "https://plugins.gradle.org/m2/" }
jcenter()
}
}
configure(allprojects) { project ->
version = VERSION_NAME
group = GROUP
buildscript {
repositories {
google()
jcenter()
mavenCentral()
mavenLocal()
maven { url 'https://oss.sonatype.org/content/repositories/snapshots/' }
}
}
}
project.ext.preDexLibs = !project.hasProperty('disablePreDex')
subprojects {
group = 'org.smartregister'
ext.androidToolsBuildGradle = '4.0.0'
ext.androidBuildToolsVersion = '29.0.3'
ext.androidMinSdkVersion = 18
ext.androidCompileSdkVersion = 28
ext.androidTargetSdkVersion = 28
ext.androidAnnotationsVersion = '3.0.1'
ext.androidAnnotationsAPIVersion = '3.0.1'
// 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
}
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
task jacocoTestReport(type: JacocoReport) {
sourceDirectories.setFrom(files())
classDirectories.setFrom(files())
executionData.setFrom(files())
reports {
html {
html.enabled = true
destination file("${buildDir}/reports/jacoco/jacocoRootReport/jacocoFullReport")
}
xml {
xml.enabled = true
destination file("${buildDir}/reports/jacoco/jacocoRootReport/jacocoFullReport.xml")
}
csv.enabled = false
}
// Work-around to allow us to build list of executionData files in doFirst
onlyIf = {
true
}
/*
* Builds list of source dirs, class dirs, and executionData files
* when task is run, not at script evaluation time
*/
doFirst {
subprojects.findAll { subproject ->
subproject.pluginManager.hasPlugin('java')
}.each { subproject ->
additionalSourceDirs files((Set<File>) subproject.sourceSets.main.allJava.srcDirs)
additionalClassDirs((FileCollection) subproject.sourceSets.main.output)
if (subproject.pluginManager.hasPlugin('jacoco')) {
executionData subproject.tasks.jacocoTestReport.executionData
}
}
executionData.setFrom(files(executionData.findAll {
it.exists()
}))
}
}
task build {
dependsOn tasks.jacocoTestReport
}
def isReleaseBuild() {
return version.contains("SNAPSHOT") == false
}