forked from appium/appium-uiautomator2-server
/
build.gradle
67 lines (56 loc) · 2.13 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
// Top-level build file where you can add configuration options common to all sub-projects/modules.
import groovy.json.JsonSlurper
import org.apache.tools.ant.taskdefs.condition.Os
buildscript {
repositories {
maven {
url "https://plugins.gradle.org/m2/"
}
jcenter()
google()
}
dependencies {
classpath 'com.android.tools.build:gradle:4.1.0'
classpath "org.sonarsource.scanner.gradle:sonarqube-gradle-plugin:3.1.1"
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
plugins {
id "org.sonarqube" version "3.1.1"
}
apply plugin: 'org.sonarqube'
allprojects {
if (Os.isFamily(Os.FAMILY_WINDOWS)) {
/**
* In Windows OS, gradle can't build the project
* if the project path is containing more than 240 characters.
* As a temporary fix, changing the 'buildDir' to 'windowsBuildDir' property in package.json file
* if the 'windowsBuildDir' property not available it will build the apks in the default value
* of 'buildDir' which is current repo.
* refer: https://code.google.com/p/android/issues/detail?id=187430
*/
def packagejson = new JsonSlurper().parseText(new File('./package.json').text)
if (packagejson.windowsBuildDir) {
buildDir = packagejson.windowsBuildDir + "/${rootProject.name}/${project.name}/build"
}
}
repositories {
jcenter()
google()
}
}
sonarqube {
properties {
property "sonar.host.url", "https://sonarqube.stuq.ceshiren.com/"
property "sonar.login", ""
property "sonar.projectKey", "appium-uiautomator2-server-ushio"
property "sonar.projectName", "appium-uiautomator2-server-ushio"
property "sonar.sourceEncoding", "UTF-8"
property "sonar.sources", "src"
property "sonar.coverage.jacoco.xmlReportPaths","/Users/ushio/Projects/as/appium-uiautomator2-server/app/build/reports/jacoco/jacocoTestReport/jacocoTestReport.xml"
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}