This repository has been archived by the owner on Jan 26, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 117
/
build.gradle
195 lines (181 loc) · 5.81 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
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
import org.gradle.internal.os.OperatingSystem;
buildscript {
repositories {
// That's because gradle is not able to use SNI – sorry for HTTP (That's why we verify the SHA1 keys ;))
maven { url "http://maven.azapps.de/artifactory/mirakel/" }
maven { url "https://plugins.gradle.org/m2/" }
}
dependencies {
classpath 'com.android.tools.build:gradle:2.0.0-alpha2'
classpath 'com.jakewharton.hugo:hugo-plugin:1.2.1'
classpath "org.sonarqube.gradle:gradle-sonarqube-plugin:1.0"
classpath files('build/build_deps/gradle-witness.jar')
classpath "org.jacoco:org.jacoco.core:0.7.5.201505241946"
}
}
dependencies {
repositories {
maven { url "http://maven.azapps.de/artifactory/mirakel/" }
}
}
def String getProjectProperty(String propertyName) {
String propertyValue = "null"
if (hasProperty(propertyName)) {
propertyValue = this.properties[propertyName]
} else {
throw GradleScriptException("PropertyName " + propertyName + " is not defined in properties file")
}
return propertyValue
}
gradle.projectsEvaluated {
def projects=["date-time-picker","widget","settings","colorpickerpreference","donationslib","new_ui","model"]
for(String proj:projects){
def res_dir=rootDir.toString()+"/"+proj+"/res"
def res_v14_dir=rootDir.toString()+"/"+proj+"/res-v14"
if (OperatingSystem.current().isLinux()) {
def script = (rootDir.toString()+"/build/scripts/generate_v14_compatible_resources.py --res-dir "+res_dir+" --res-v14-compatibility-dir "+res_v14_dir+"").execute()
script.err.eachLine {line -> println "ERROR: " + line}
script.waitFor()
}
def res = fileTree(dir: res_dir)
def res_v14 =fileTree(dir: res_v14_dir)
delete proj+"/merged-res";
copy{
from (res_dir){
include '**/*.xml', '**/*.png'
}
from (res_v14_dir){
include '**/*.xml', '**/*.png'
}
into (rootDir.toString()+"/"+proj+"/merged-res")
}
}
}
ext {
compileSdkVersion = 23
buildToolsVersion = "23.0.1"
}
if (OperatingSystem.current().isLinux()) {
configure(allprojects) {
ext.minSdkVersion = "14"
}
} else {
configure(allprojects) {
ext.minSdkVersion = "17"
}
}
configure(allprojects) {
ext.androidSDKVersion = "23"
ext.androidBuildToolsVersion = "23.0.2"
ext.androidSupportVersion = "23.1.1"
ext.androidPluginVersion ="0.14.0"
ext.jodaLibraryVersion = "2.8.2"
ext.nineoldandroisVersion="2.4.0"
ext.robotiumVersion = "5.2.1"
ext.gsonVersion = "2.2.+"
ext.junitVersion = "4.11"
ext.guavaVersion = "18.0"
ext.butterknifeVersion = "6.1.0"
ext.dashclockVersion = "2.0.0"
ext.robolectricVersion= "2.3"
ext.FAB_VERSION= "0.0.8"
ext.snackbarVersion = "2.10.6"
ext.materialdesignVersion = "1.0"
ext.acraVersion = "4.6.2"
ext.materialDialogsVersion = "0.8.5.0@aar"
ext.changelogVersion = "2.0.0"
ext.undoBarVersion = "1.4@aar"
ext.jacocoVersion = "0.7.5.201505241946"
ext.bottomsheetVersion ="1.2.0"
}
apply plugin: 'org.sonarqube'
subprojects {
repositories {
maven { url "http://maven.azapps.de/artifactory/mirakel/" }
}
gradle.projectsEvaluated {
tasks.withType(JavaCompile) {
options.compilerArgs << "-Xlint:unchecked" << "-Xlint:deprecation"
}
}
task allDeps(type: DependencyReportTask) {}
if(project.equals(project(':new_ui'))||project.equals(project(':dashclock'))){
apply plugin: 'com.android.application'
}else{
apply plugin: 'com.android.library'
}
apply plugin: 'jacoco'
apply plugin: 'hugo'
apply plugin: 'witness'
if (OperatingSystem.current().isLinux()) {
android {
defaultConfig {
minSdkVersion 14
}
}
} else {
android {
defaultConfig {
minSdkVersion 17
}
}
}
android {
publishNonDefault true
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_7
targetCompatibility JavaVersion.VERSION_1_7
}
compileSdkVersion rootProject.ext.compileSdkVersion
buildToolsVersion rootProject.ext.buildToolsVersion
packagingOptions {
exclude 'META-INF/LICENSE.txt'
exclude 'META-INF/NOTICE.txt'
}
lintOptions{
enable 'RtlHardcoded','RtlCompat', 'RtlEnabled','NewerVersionAvailable'
disable 'InvalidPackage'
}
defaultConfig {
testApplicationId "de.azapps.mirakelandroid.test"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
targetSdkVersion 23
}
buildTypes {
debug {
testCoverageEnabled = true
}
release {
testCoverageEnabled = false
}
}
}
sonarqube {
properties {
property "sonar.projectName", "${project.name}"
property "sonar.language", "java"
property "sonar.sources", "src"
property "sonar.binaries", "build"
property "sonar.junit.reportsPath", "../new_ui/build/test-results/fdroidDebug/"
property "sonar.jacoco.reportPath", "../new_ui/jacoco.exec"
}
}
dependencyVerification {
verify = [
'com.jakewharton.hugo:hugo-annotations:eee719367df475c50e302f962abde1446c1aa0ea5617b541df6412b630554990',
]
}
}
task wrapper(type: Wrapper) {
gradleVersion = '2.8'
}
sonarqube {
properties {
property "sonar.projectName", "Mirakel"
property "sonar.projectKey", "mirakel-android"
property "sonar.junit.reportsPath", "new_ui/build/test-results/fdroidDebug/"
property "sonar.jacoco.reportPath", "new_ui/jacoco.exec"
}
tasks.sonarqube.dependsOn(':new_ui:testFdroidDebugUnitTest')
tasks.sonarqube.dependsOn(':dashclock:assembleDebug')
}