forked from MirakelX/mirakel-android
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle
180 lines (166 loc) · 5.19 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
buildscript {
repositories {
mavenCentral()
mavenLocal()
maven {
url "https://plugins.gradle.org/m2/"
}
}
dependencies {
classpath 'com.android.tools.build:gradle:1.3.0'
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')
}
}
dependencies {
repositories {
mavenCentral()
}
}
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"
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 = 22
buildToolsVersion = "22.0.1"
minSDKVersion = 11
}
configure(allprojects) {
ext.androidSDKVersion = "22"
ext.androidBuildToolsVersion = "22.0.1"
ext.androidSupportVersion = "22.2.0"
ext.androidPluginVersion ="0.14.0"
ext.androidMinSDKVersion ="14"
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.7.6.0"
ext.changelogVersion = "2.0.0"
ext.undoBarVersion = "1.4@aar"
ext.jacocoVersion = "0.7.5.201505241946"
}
apply plugin: 'org.sonarqube'
subprojects {
repositories {
mavenCentral()
jcenter()
}
gradle.projectsEvaluated {
tasks.withType(JavaCompile) {
options.compilerArgs << "-Xlint:unchecked" << "-Xlint:deprecation"
}
}
repositories {
jcenter()
}
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'
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"
minSdkVersion 14
targetSdkVersion 21
}
jacoco {
version = "$jacocoVersion"
}
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',
]
}
}
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')
}
task wrapper(type: Wrapper) {
gradleVersion = '2.5'
}