This repository has been archived by the owner on Apr 17, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 29
/
Copy pathbuild.gradle
112 lines (89 loc) · 2.88 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
buildscript {
ext.jacocoVersion = '0.8.1'
// JaCoCo
ext.execFile = 'jacoco/jacocoTest.exec'
ext.classFilesPath = 'intermediates/javac'
ext.fileFilter = [
'**/R.class',
'**/R$*.class',
'**/BuildConfig.*',
'**/Manifest*.*',
'**/*Test*.*',
'android/**/*.*'
]
repositories {
google()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.2.0-alpha13'
classpath 'com.github.dcendents:android-maven-gradle-plugin:2.0'
classpath 'com.google.gms:google-services:3.2.1'
classpath "org.jacoco:org.jacoco.core:$jacocoVersion"
}
}
plugins {
id "com.diffplug.gradle.spotless" version "3.10.0"
}
allprojects {
repositories {
google()
jcenter()
}
project.apply from: "${rootDir}/constants.gradle"
}
subprojects {
apply plugin: "com.diffplug.gradle.spotless"
spotless {
java {
target '**/*.java'
removeUnusedImports()
importOrderFile '../codequality/aerogear.importorder'
eclipse('4.7.1').configFile '../codequality/eclipse-code-style.xml'
}
}
afterEvaluate { project ->
dependencies {
lintChecks files('libs/checks.jar')
}
android.buildTypes.each { type ->
type.buildConfigField 'String', 'PROJECT_ROOT', "\"" + project.projectDir.absolutePath.replace("\\", "\\\\") + "/\""
}
}
}
task jacocoRootReport(type: JacocoReport, group: 'Coverage reports') {
apply plugin: 'jacoco'
description = 'Generates an aggregate report from all modules - auth, core, push, and security'
subprojects.each { dependsOn("${it.name}:jacocoTestReport") }
jacocoClasspath = configurations.jacocoAnt
reports {
xml.enabled = true
html.enabled = true
}
// these 'onlyIf' and 'doFirst' blocks are required since the sync module does not contain any unit tests
onlyIf = {
true
}
doFirst {
executionData = files(executionData.findAll {
it.exists()
})
}
def srcDirs = []
subprojects.each {srcDirs << "it.projectDir/src/main/java"}
sourceDirectories = files(srcDirs)
def classDirTrees = []
subprojects.each {classDirTrees << fileTree(dir: "$it.buildDir/$classFilesPath/debug", excludes: fileFilter)}
subprojects.each {classDirTrees << fileTree(dir: "$it.buildDir/$classFilesPath/debugUnitTest", excludes: fileFilter)}
subprojects.each {classDirTrees << fileTree(dir: "$it.buildDir/$classFilesPath/debugAndroidTest", excludes: fileFilter)}
classDirectories = files(classDirTrees)
def execData = []
subprojects.each {execData << "$it.buildDir/$execFile"}
executionData = files(execData)
}
// We want to expose the SDK version and name to the metrics subproject
project(':core') {
project.ext {
versionName = VERSION_NAME
}
}