-
Notifications
You must be signed in to change notification settings - Fork 28
/
build.gradle
60 lines (51 loc) · 1.74 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
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
def getVersionCode = {
def stdout = new ByteArrayOutputStream()
exec {
commandLine 'git', 'rev-list', '--count', 'HEAD'
standardOutput = stdout
}
return stdout.toString().trim().toInteger()
}
def getVersionName = {
return new Date().format('yy.MM.dd')
}
ext.version_name = getVersionName()
ext.version_code = getVersionCode()
repositories {
google()
jcenter()
maven {
url "https://plugins.gradle.org/m2/"
}
}
dependencies {
classpath 'com.android.tools.build:gradle:7.4.2'
classpath "org.sonarsource.scanner.gradle:sonarqube-gradle-plugin:3.5.0.2730"
classpath "com.hiya:jacoco-android:0.2"
}
}
allprojects {
repositories {
google()
jcenter()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
apply plugin: "org.sonarqube"
//sonar configuration
sonarqube {
properties {
property "sonar.organization", "mercuriete-github"
property "sonar.projectKey", "mercuriete_android-mrz-reader"
property "sonar.host.url", "https://sonarcloud.io"
property "sonar.projectVersion", project.version_name
property "sonar.sourceEncoding", "UTF-8"
property "sonar.coverage.jacoco.xmlReportPaths", getRootDir().toString() + "/MRZReader/build/jacoco/jacoco.xml"
property "sonar.junit.reportsPath", getRootDir().toString() + "/MRZReader/build/test-results/testDebugUnitTest/"
property "sonar.androidLint.reportPaths", getRootDir().toString() + "/MRZReader/build/reports/lint-results-debug.xml"
}
}