-
-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathbuild.gradle
115 lines (98 loc) · 3.29 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
buildscript {
repositories {
google()
jcenter()
}
apply from: './gradle/constants.gradle'
dependencies {
classpath 'com.android.tools.build:gradle:4.0.1'
//classpath 'com.android.tools.build:gradle:3.6.1' //Latest tested
/*
* Iadt PLUGIN: import using legacy plugin application (support dynamic versioning).
*/
classpath "es.rafaco.inappdevtools:inappdevtools-plugin:${PROJECT_VERSION}"
// Internal plugins for publications
classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.8.4'
classpath 'com.github.dcendents:android-maven-gradle-plugin:2.1'
// Compat Preprocessor: custom artifact from my fork. PR sent to dannyhe.
//classpath 'wang.dannyhe.tools:plugin:0.0.7'
classpath files('./compat/libs/wang.dannyhe.tools.preprocessor-0.0.7a.jar')
}
}
plugins {
/*
* Iadt PLUGIN: Standard usage using plugins DSL.
* NOTE: Replace "X.X.X" for latest version.
* TODO: Upgrade to Gradle 5.6, it allow dynamic version
*
* id "es.rafaco.inappdevtools" version "X.X.X" apply false
*/
id "org.sonarqube" version "2.8"
}
allprojects {
repositories {
mavenLocal()
maven { url "https://jitpack.io"}
google()
jcenter()
}
}
// Clean all modules
task clean(type: Delete) {
delete rootProject.buildDir
delete './captures'
delete './plugin/build'
}
subprojects {
rootProject.clean.dependsOn tasks.matching { it.name == 'clean' }
}
//TODO: Re-enable JavaDoc generation after common-logging removed.
subprojects {
tasks.withType(Javadoc).all { enabled = false }
}
//Doze Utils
apply from: './gradle/doze_utils.gradle'
//SonarCloud Report (running task sonarqube)
sonarqube {
androidVariant 'supportDebug'
properties {
property "sonar.projectVersion", PROJECT_VERSION
property "sonar.login", System.getenv('SONAR_TOKEN')
}
}
task prepareLocalSonar(){
doLast{
def isCircleCi = System.getenv('CI')
if (isCircleCi){
println "Build environment is CI, skipped."
return
}
println "Build environment is LOCAL, preparing..."
System.setProperty("sonar.branch.name", "local-develop")
System.setProperty("sonar.branch.target", "develop") //TODO: get from git command
Properties localProperties = new Properties()
def targetPropertyName = 'sonar.nodejs.executable'
def localPropertiesFile = project.rootProject.file('local.properties')
if (localPropertiesFile.exists()) {
localProperties.load(localPropertiesFile.newDataInputStream())
def localValue = localProperties.getProperty(targetPropertyName, null)
if (localValue != null){
System.setProperty(targetPropertyName, localValue)
}
}
}
}
project.tasks["sonarqube"].dependsOn "prepareLocalSonar"
//Gradle Scanner Report (enable with param --scan)
if (hasProperty('buildScan')) {
buildScan {
termsOfServiceUrl = 'https://gradle.com/terms-of-service'
termsOfServiceAgree = 'yes'
}
}
//Show Gradle Lint compile warnings
/*allprojects {
tasks.withType(JavaCompile) {
options.compilerArgs << "-Xlint:unchecked" << "-Xlint:deprecation"
}
}*/