forked from JakeWharton/u2020
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
173 lines (139 loc) · 4.75 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
buildscript {
repositories {
//maven {
// url 'https://oss.sonatype.org/content/repositories/snapshots/'
//}
//mavenCentral()
maven {
url 'http://repo1.maven.org/maven2/'
}
}
dependencies {
classpath 'com.android.tools.build:gradle:1.3.0'
classpath 'com.neenbedankt.gradle.plugins:android-apt:1.4'
}
}
// Manifest version information!
def versionMajor = 1
def versionMinor = 0
def versionPatch = 0
def versionBuild = 0 // bump for dogfood builds, public betas, etc.
apply plugin: 'com.android.application'
apply plugin: 'com.neenbedankt.android-apt'
repositories {
//maven {
// url 'https://oss.sonatype.org/content/repositories/snapshots/'
//}
//mavenCentral()
maven {
url 'http://repo1.maven.org/maven2/'
}
}
def gitSha = 'git rev-parse --short HEAD'.execute([], project.rootDir).text.trim()
def buildTime = new Date().format("yyyy-MM-dd'T'HH:mm:ss'Z'", TimeZone.getTimeZone("UTC"))
def isTravis = "true".equals(System.getenv("TRAVIS"))
def preDexEnabled = "true".equals(System.getProperty("pre-dex", "true"))
android {
compileSdkVersion 22
buildToolsVersion '22.0.1'
dexOptions {
// Skip pre-dexing when running on Travis CI or when disabled via -Dpre-dex=false.
preDexLibraries = preDexEnabled && !isTravis
}
signingConfigs {
u2020 {
storeFile file('u2020.keystore')
storePassword 'android'
keyAlias 'android'
keyPassword 'android'
}
}
defaultConfig {
minSdkVersion 15
targetSdkVersion 22
versionCode versionMajor * 10000 + versionMinor * 1000 + versionPatch * 100 + versionBuild
versionName "${versionMajor}.${versionMinor}.${versionPatch}"
signingConfig signingConfigs.u2020
buildConfigField "String", "GIT_SHA", "\"${gitSha}\""
buildConfigField "String", "BUILD_TIME", "\"${buildTime}\""
testInstrumentationRunner "com.jakewharton.u2020.U2020TestRunner"
}
buildTypes {
debug {
applicationIdSuffix '.debug'
}
}
productFlavors {
internal {
applicationId 'com.jakewharton.u2020.internal'
}
production {
applicationId 'com.jakewharton.u2020'
}
}
lintOptions {
textReport true
textOutput 'stdout'
fatal 'UnusedResources'
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_7
targetCompatibility JavaVersion.VERSION_1_7
}
packagingOptions {
exclude 'LICENSE.txt'
}
}
// TODO remove eventually: http://b.android.com/162285
configurations {
internalDebugCompile
}
configurations.all {
resolutionStrategy {
force 'com.android.support:support-annotations:22.2.1'
}
}
dependencies {
compile 'com.android.support:support-v4:22.2.1'
compile 'com.android.support:support-annotations:22.2.1'
compile 'com.android.support:appcompat-v7:22.2.1'
compile 'com.android.support:recyclerview-v7:22.2.1'
compile 'com.android.support:design:22.2.1'
compile 'com.squareup.dagger:dagger:1.2.2'
apt 'com.squareup.dagger:dagger-compiler:1.2.2'
compile 'com.squareup.okhttp:okhttp:2.3.0'
compile 'com.squareup.picasso:picasso:2.5.2'
compile 'com.squareup.retrofit:retrofit:1.9.0'
internalDebugCompile 'com.squareup.retrofit:retrofit-mock:1.9.0'
compile 'com.jakewharton:butterknife:7.0.1'
compile 'com.jakewharton.timber:timber:3.0.2'
compile 'com.jakewharton.byteunits:byteunits:0.9.0'
internalDebugCompile 'com.jakewharton.madge:madge:1.1.1'
internalDebugCompile 'com.jakewharton.scalpel:scalpel:1.1.1'
internalDebugCompile 'com.jakewharton:process-phoenix:1.0.0'
internalCompile 'com.squareup.leakcanary:leakcanary-android:1.3'
productionCompile 'com.squareup.leakcanary:leakcanary-android-no-op:1.3'
compile 'io.reactivex:rxjava:1.0.13'
compile 'io.reactivex:rxandroid:1.0.0'
compile 'com.jakewharton.threetenabp:threetenabp:1.0.1'
internalCompile 'com.mattprecious.telescope:telescope:1.4.0@aar'
androidTestCompile 'junit:junit:4.12'
androidTestCompile 'com.android.support.test.espresso:espresso-core:2.2'
// TODO https://code.google.com/p/android-test-kit/issues/detail?id=157
//androidTestCompile 'com.android.support.test.espresso:espresso-contrib:2.2'
androidTestCompile 'com.android.support.test:runner:0.3'
androidTestCompile 'com.android.support.test:rules:0.3'
testCompile 'junit:junit:4.12'
testCompile 'com.google.truth:truth:0.27'
}
def installAll = tasks.create('installAll')
installAll.description = 'Install all applications.'
android.applicationVariants.all { variant ->
installAll.dependsOn(variant.install)
// Ensure we end up in the same group as the other install tasks.
installAll.group = variant.install.group
}
// The default 'assemble' task only applies to normal variants. Add test variants as well.
android.testVariants.all { variant ->
tasks.getByName('assemble').dependsOn variant.assemble
}