-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathbuild.gradle
More file actions
83 lines (71 loc) · 2.46 KB
/
build.gradle
File metadata and controls
83 lines (71 loc) · 2.46 KB
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
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
jcenter()
}
dependencies {
// TODO necessary but why?
classpath 'com.android.tools.build:gradle:1.0.0'
// include coveralls plugin for coverage reports
classpath 'org.kt3k.gradle.plugin:coveralls-gradle-plugin:1.0.2'
}
}
// some defaults for all sub projects
configure(allprojects) { project ->
buildscript {
repositories {
jcenter()
}
}
}
apply from: "Scripts/sdk_manager.gradle"
// some defaults for all sub projects
subprojects {
repositories {
// common dependency repository
jcenter()
def sdkDir = guessSdkDir()
maven { url "file://${sdkDir}/extras/android/m2repository" }
mavenCentral()
mavenLocal()
}
}
ext.obtainSdkDir = {
sdkDir = ${System.getenv("ANDROID_HOME")}
if(sdkDir == null) sdkDir = readLocalPropertiesValue("sdk.dir")
sdkDir
}
ext.readLocalPropertiesValue = { key ->
if (!project.file("local.properties").exists()) {
return ""
}
Properties properties = new Properties()
properties.load(project.file("local.properties").newDataInputStream())
return properties.getProperty(key)
}
// Improve build server performance by allowing disabling of pre-dexing
// (see http://tools.android.com/tech-docs/new-build-system/tips#TOC-Improving-Build-Server-performance.)
project.ext.preDexLibs = !project.hasProperty('disablePreDex')
ext.robolectricDependsOnNeeded = true;
subprojects {
project.plugins.whenPluginAdded { plugin ->
if ("com.android.build.gradle.AppPlugin".equals(plugin.class.name)) {
project.android.dexOptions.preDexLibraries = rootProject.ext.preDexLibs
} else if ("com.android.build.gradle.LibraryPlugin".equals(plugin.class.name)) {
project.android.dexOptions.preDexLibraries = rootProject.ext.preDexLibs
}
}
}
// ensure clean is also triggered for root build folder
apply plugin: 'java'
apply plugin: 'build-dashboard'
buildDashboard {
reports.html.destination = "build/"
}
// clean up dashboard from not generated reports
test.reports.html.enabled = false
test.reports.junitXml.enabled = false
// Android Studio Support - avoid missing task error at compiling test classes before test execution
task testCompile {}
// code coverage for all unit tests
apply from: 'Scripts/jacoco-coveralls-support.gradle'