-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle
92 lines (80 loc) · 3.89 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
buildscript {
repositories {
jcenter()
maven { url "https://plugins.gradle.org/m2/" }
}
dependencies {
classpath 'com.android.tools.build:gradle:2.1.2'
classpath 'com.google.gms:google-services:3.0.0'
classpath "org.sonarsource.scanner.gradle:sonarqube-gradle-plugin:2.0.1"
classpath 'com.dicedmelon.gradle:jacoco-android:0.1.1' // https://github.com/arturdm/jacoco-android-gradle-plugin/releases
}
}
allprojects {
repositories {
jcenter()
}
//noinspection GroovyAssignabilityCheck -- false lint warning; ignoring
configurations.all {
resolutionStrategy {
/*
"Use latest" strategy means risking
1. fail fast and;
2. resolve conflicts using "force()", below.
*/
failOnVersionConflict()
/*
TL;DR:
Because the Test APK and App APK share a classpath, its easy for a dependency from
"compile" and "test" to conflict. You can either detect and address each version
conflict one-by-one, or fix the version for the whole project.
Details:
https://sites.google.com/a/android.com/tools/tech-docs/new-build-system/user-guide#TOC-Resolving-conflicts-between-main-and-test-APK
*/
force "com.android.support:support-v4:$rootProject.ANDROID_SUPPORT_LIBRARY_VER"
force "com.android.support:support-annotations:$rootProject.ANDROID_SUPPORT_LIBRARY_VER"
force "com.android.support:appcompat-v7:$rootProject.ANDROID_SUPPORT_LIBRARY_VER"
force "com.android.support:recyclerview-v7:$rootProject.ANDROID_SUPPORT_LIBRARY_VER"
force "org.hamcrest:hamcrest-core:$rootProject.HAMCREST_VER"
force "io.reactivex:rxjava:$rootProject.RXJAVA_VER"
}
}
}
// Disable PreDexing for CI builds
// https://sites.google.com/a/android.com/tools/tech-docs/new-build-system/tips#TOC-Improving-Build-Server-performance
project.ext.preDexLibs = !project.hasProperty('disablePreDex')
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
}
}
}
// Project-wide constants
ext {
APPLICATION_ID = 'io.pivotal.pairwithme'
TEST_APPLICATION_ID = APPLICATION_ID + '.test'
VERSION_CODE = 1
VERSION_NAME = '0.0.1'
ANDROID_SDK_VER = 23
MIN_SDK_VER = 15 // https://developer.android.com/about/dashboards/index.html
ANDROID_BUILD_TOOLS_VER = '23.0.3' // https://developer.android.com/tools/revisions/build-tools.html
// Core App Libraries
ANDROID_SUPPORT_LIBRARY_VER = '23.4.0' // https://developer.android.com/tools/support-library/index.html#revisions
FIREBASE_VER = '9.2.1'
RXJAVA_VER = '1.1.8' // https://github.com/ReactiveX/RxJava/releases
JODA_TIME_VER = '2.9.4' // http://www.joda.org/joda-time/installation.html
ANDROID_JODA_TIME_VER = JODA_TIME_VER + ".1" // https://github.com/dlew/joda-time-android/releases
// Testing
JUNIT_VER = '4.12' // https://github.com/junit-team/junit4/releases/latest
HAMCREST_VER = '1.3' // https://search.maven.org/#search%7Cga%7C1%7Cg%3Aorg.hamcrest
MOCKITO_VER = '1.10.19' // https://github.com/mockito/mockito/blob/master/doc/release-notes/official.md
// Instrumented Testing -- https://google.github.io/android-testing-support-library/downloads/release-notes/
ESPRESSO_VER = '2.2.2'
ANDROID_TEST_SUPPORT_LIBRARY_VER = '0.5'
}
task clean(type: Delete) {
delete rootProject.buildDir
}