forked from amahi/android
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
201 lines (163 loc) · 6.99 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
196
197
198
199
200
201
buildscript {
repositories {
jcenter()
maven { url 'https://maven.fabric.io/public' }
google()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.0.1'
classpath 'io.fabric.tools:gradle:1.22.1'
}
}
apply plugin: "com.android.application"
apply plugin: 'io.fabric'
android {
compileSdkVersion 26
buildToolsVersion '27.0.1'
signingConfigs {
release {
def signingFile = file("signing.properties")
def fakeSigningFile = file("fakeSigning.properties")
def signingProperties = new Properties()
if (signingFile.exists()) {
signingProperties.load(signingFile.newInputStream())
} else {
signingProperties.load(fakeSigningFile.newInputStream())
}
storeFile file(signingProperties["keystore.file"])
storePassword signingProperties["keystore.password"]
keyAlias signingProperties["key.alias"]
keyPassword signingProperties["key.password"]
}
}
dexOptions {
jumboMode true
}
defaultConfig {
def versionMajor = 3
def versionMinor = 0
def versionPatch = 0
versionName buildVersionName(versionMajor, versionMinor, versionPatch)
versionCode buildVersionCode(versionMajor, versionMinor, versionPatch)
minSdkVersion 17
targetSdkVersion 25
def apiFile = file("api.properties")
def apiProperties = new Properties()
// NOTE-cpg: this fake api is here for the tests to pass
def fakeApiFile = file("fakeApi.properties")
if (apiFile.exists()) {
apiProperties.load(apiFile.newInputStream())
} else {
apiProperties.load(fakeApiFile.newInputStream())
}
buildConfigField "String", "API_URL_AMAHI", formatStringField(apiProperties["url.amahi"])
buildConfigField "String", "API_URL_PROXY", formatStringField(apiProperties["url.proxy"])
buildConfigField "String", "API_CLIENT_ID", formatStringField(apiProperties["client.id"])
buildConfigField "String", "API_CLIENT_SECRET", formatStringField(apiProperties["client.secret"])
buildConfigField "String", "CHROMECAST_APP_ID", formatStringField(apiProperties["chromecast.app.id"])
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
betaRelease {
signingConfig signingConfigs.debug
}
release {
signingConfig signingConfigs.release
}
}
android {
lintOptions {
abortOnError false
}
}
compileOptions {
targetCompatibility 1.8
sourceCompatibility 1.8
}
}
ext {
archRoomVersion = "1.1.0"
}
static def buildVersionName(versionMajor, versionMinor, versionPatch) {
return "${versionMajor}.${versionMinor}.${versionPatch}"
}
static def buildVersionCode(versionMajor, versionMinor, versionPatch) {
return versionMajor * 10**2 + versionMinor * 10**1 + versionPatch * 10**0
}
static def formatStringField(field) {
return "\"${field}\""
}
dependencies {
repositories {
jcenter()
mavenCentral()
mavenLocal()
maven { url 'https://maven.fabric.io/public' }
maven { url 'http://dl.bintray.com/megabitdragon/maven' }
maven { url 'https://jitpack.io' }
google()
}
def SUPPORT_LIBRARY_VERSION = "26.1.0"
implementation "com.android.support:support-v4:${SUPPORT_LIBRARY_VERSION}"
implementation "com.android.support:support-v13:${SUPPORT_LIBRARY_VERSION}"
implementation "com.android.support:recyclerview-v7:${SUPPORT_LIBRARY_VERSION}"
implementation "com.android.support:appcompat-v7:${SUPPORT_LIBRARY_VERSION}"
implementation "com.android.support:design:${SUPPORT_LIBRARY_VERSION}"
implementation "com.android.support:preference-v7:${SUPPORT_LIBRARY_VERSION}"
implementation "com.android.support:customtabs:${SUPPORT_LIBRARY_VERSION}"
implementation "com.android.support:leanback-v17:${SUPPORT_LIBRARY_VERSION}"
implementation "com.android.support:mediarouter-v7:${SUPPORT_LIBRARY_VERSION}"
implementation "com.android.support:cardview-v7:${SUPPORT_LIBRARY_VERSION}"
implementation 'com.google.android.gms:play-services-cast-framework:11.6.0'
implementation('com.crashlytics.sdk.android:crashlytics:2.6.6@aar') {
transitive = true
}
implementation 'com.amulyakhare:com.amulyakhare.textdrawable:1.0.1'
implementation 'com.github.dmytrodanylyk.android-process-button:library:1.0.4'
implementation 'com.jakewharton.timber:timber:4.5.1'
// Otto and Retrofit
implementation 'com.squareup:otto:1.3.8'
implementation 'com.github.apl-devs:appintro:v4.2.0'
implementation 'com.github.bumptech.glide:glide:3.7.0'
implementation 'com.squareup.retrofit2:retrofit:2.3.0'
implementation 'com.squareup.retrofit2:converter-gson:2.3.0'
implementation 'com.squareup.okhttp3:logging-interceptor:3.8.0'
implementation 'org.videolan:libvlc:2.1.1'
implementation 'pub.devrel:easypermissions:0.4.2'
testImplementation 'org.robolectric:robolectric:3.1.2'
testImplementation 'junit:junit:4.12'
testImplementation 'org.robolectric:shadows-multidex:3.0'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.1'
androidTestImplementation 'com.android.support.test:runner:1.0.1'
androidTestImplementation "com.android.support:support-annotations:${SUPPORT_LIBRARY_VERSION}"
// Dagger
implementation 'com.squareup.dagger:dagger:1.2.5'
compileOnly 'com.squareup.dagger:dagger-compiler:1.2.5'
annotationProcessor 'com.squareup.dagger:dagger-compiler:1.2.5'
implementation 'com.github.wseemann:FFmpegMediaMetadataRetriever:1.0.14'
implementation 'com.google.android.exoplayer:exoplayer-core:2.7.3'
implementation 'android.arch.persistence.room:runtime:' + rootProject.archRoomVersion
annotationProcessor 'android.arch.persistence.room:compiler:' + rootProject.archRoomVersion
// Uncomment the dependencies below to enable Chuck Interceptor for logging
/*
debugImplementation 'com.readystatesoftware.chuck:library:1.1.0'
releaseImplementation 'com.readystatesoftware.chuck:library-no-op:1.1.0'
betaReleaseImplementation 'com.readystatesoftware.chuck:library-no-op:1.1.0'
*/
}
task generateWrapper(type: Wrapper) {
description "Generates Gradle wrapper."
gradleVersion = "2.2.1"
}
android.applicationVariants.all { variant ->
def variantName = variant.name.capitalize()
task("generate${variantName}Javadoc", type: Javadoc) {
description "Generates ${variantName} documentation."
source = files(variant.javaCompiler.source)
ext.androidClasspath = android.getBootClasspath().join(File.pathSeparator)
classpath = files(variant.javaCompiler.classpath, ext.androidClasspath)
options {
linksOffline "http://d.android.com/reference", "${android.sdkDirectory}/docs/reference"
}
}
}