-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathbuild.gradle
102 lines (88 loc) · 3.23 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
apply plugin: "org.sonarqube"
buildscript {
ext.gradleVersion = '4.0.0'
ext.kotlinVersion = '1.4.21'
ext.sonarqubeVersion = '3.1.1'
repositories {
google()
jcenter()
mavenCentral()
maven { url "https://plugins.gradle.org/m2/" }
maven { url "https://jitpack.io" }
}
dependencies {
classpath "com.android.tools.build:gradle:$gradleVersion"
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlinVersion"
classpath "org.sonarsource.scanner.gradle:sonarqube-gradle-plugin:$sonarqubeVersion"
}
}
allprojects {
repositories {
google()
jcenter()
mavenCentral()
maven { url "http://dl.bintray.com/typesafe/maven-releases" }
maven { url "https://maven.google.com" }
maven { url "https://jitpack.io" }
apply from: "$rootProject.projectDir/jacoco_global.gradle"
}
}
ext {
// SDK and Tools
compileSdkVersion = 30
buildToolsVersion = '29.0.3'
minSdkVersion = 19
targetSdkVersion = 30
//Androidx
androidxFragmentVersion = '1.2.5'
loaderVersion = '1.1.0'
vectorDrawableVersion = '1.1.0'
androidLegacyVersion = '1.0.0'
appcompatVersion = '1.2.0'
workManagerVersion = '2.3.4'
annotationVersion = '1.1.0'
//Firebase
firebaseAnalyticsVersion = '19.0.0'
firebasePerfVersion = '19.0.8'
//Play Services
playServicesAnalytics = '17.0.0'
//Rx
rxJavaVersion = '2.2.19'
rxAndroidVersion = '2.1.1'
rxBindingsVersion = '3.1.0'
rxJavaDebug = '1.4.0'
// Tests & Quality
junitVersion = '4.13.1'
mockitoVersion = '3.5.13'
powermockVersion = '2.0.2'
robolectricVersion = '4.4'
testRunnerVersion = '1.3.0'
espressoVersion = '3.3.0'
androidCoreTest = '1.3.0'
}
task clean(type: Delete) {
delete rootProject.buildDir
}
rootProject.afterEvaluate {
tasks['sonarqube'].with {
dependsOn.clear()
dependsOn 'createGlobalSkeletoidUnitTestReport'
}
}
sonarqube {
def testCoverageBuildType = rootProject.getProperties().get('testBuildType') ?: 'qa'
properties {
property "sonar.projectKey", "mydroidisbetterthanyours"
property "sonar.sources", "src"
//Remember to change in jacoco_global and jacoco files also
property "sonar.exclusions", "**/*test*/**, build/**, *.iml, **/*generated*, **/views/*.*, **/interfaces/*.*, **/dialogs/*.*, **/animation/*.*, **/UnfreezeScreenActivity.*, **/Schedulers.*, **/utils/http/HttpCodes.*"
property "sonar.tests", "./src/test/"
property "sonar.test.inclusions", "**/*test*/**"
property "sonar.import_unknown_files", true
property "sonar.java.binaries", "${buildDir}/intermediates/javac/${testCoverageBuildType}/classes,${buildDir}/tmp/kotlin-classes/${testCoverageBuildType}"
property "sonar.java.source", "${getProjectDir()}/src/main/java"
property "sonar.java.coveragePlugin", "jacoco"
property "sonar.coverage.jacoco.xmlReportPaths", fileTree(dir: "${rootProject.buildDir}/reports/jacoco/", includes: ["**/createGlobalSkeletoidUnitTestReport.xml"])
property "sonar.jacoco.itReportPath", fileTree(dir: "${buildDir}/outputs/code-coverage/connected/", includes: ["**/*.ec"])
}
}