This repository has been archived by the owner on Jul 4, 2018. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 323
/
Copy pathbuild.gradle
170 lines (143 loc) · 6.44 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
/*
* Copyright (C) 2014 Luke Klinker
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
File keystoreProperties = rootProject.file("keystore.properties")
def props = new Properties()
if (keystoreProperties.exists()) {
props.load(new FileInputStream(keystoreProperties))
} else {
props['keystorefile'] = 'none';
}
android {
dexOptions {
jumboMode true
javaMaxHeapSize "4g"
}
packagingOptions {
exclude 'LICENSE'
exclude 'README.md'
exclude 'Other/'
exclude 'META-INF/LICENSE'
exclude 'META-INF/LICENSE.txt'
exclude 'META-INF/NOTICE'
exclude 'META-INF/DEPENDENCIES'
}
compileSdkVersion Integer.parseInt(project.TARGET_SDK)
buildToolsVersion project.BUILD_TOOLS_VERSION
defaultConfig {
def code = System.getenv("BUILD_NUMBER") as Integer ?: Integer.parseInt(project.VERSION_CODE)
code += 250
applicationId "com.klinker.android.twitter"
minSdkVersion Integer.parseInt(project.MIN_SDK)
targetSdkVersion Integer.parseInt(project.TARGET_SDK)
versionCode code
versionName project.VERSION_NAME
multiDexEnabled true
File secretsExists = new File("secrets.properties")
if (secretsExists.exists()) {
def secretsFile = rootProject.file('secrets.properties')
def secrets = new Properties()
secrets.load(new FileInputStream(secretsFile))
buildConfigField "String", "CONSUMER_KEY", secrets.getProperty('CONSUMER_KEY')
buildConfigField "String", "CONSUMER_SECRET", secrets.getProperty('CONSUMER_SECRET')
buildConfigField "String", "YOUTUBE_API_KEY", secrets.getProperty('YOUTUBE_API_KEY')
buildConfigField "String", "TWEETMARKER_KEY", secrets.getProperty('TWEETMARKER_KEY')
buildConfigField "String", "TWITLONGER_KEY", secrets.getProperty('TWITLONGER_KEY')
buildConfigField "String", "TWITPIC_API_KEY", secrets.getProperty('TWITPIC_API_KEY')
buildConfigField "String", "GIPHY_KEY", secrets.getProperty('GIPHY_KEY')
buildConfigField "String", "ARTICLE_API_KEY", secrets.getProperty('ARTICLE_KEY')
} else {
buildConfigField "String", "CONSUMER_KEY", "\"View Talon's readme to learn about inserting your keys.\""
buildConfigField "String", "CONSUMER_SECRET", "\"View Talon's readme to learn about inserting your keys.\""
buildConfigField "String", "YOUTUBE_API_KEY", "\"View Talon's readme to learn about inserting your keys.\""
buildConfigField "String", "TWEETMARKER_KEY", "\"View Talon's readme to learn about inserting your keys.\""
buildConfigField "String", "TWITLONGER_KEY", "\"View Talon's readme to learn about inserting your keys.\""
buildConfigField "String", "TWITPIC_API_KEY", "\"View Talon's readme to learn about inserting your keys.\""
buildConfigField "String", "GIPHY_KEY", "\"View Talon's readme to learn about inserting your keys.\""
buildConfigField "String", "ARTICLE_API_KEY", "\"View Talon's readme to learn about inserting your keys.\""
}
}
File keystore = new File(props['keystorefile'])
if (keystore.exists()) {
signingConfigs {
release {
storeFile keystore
storePassword props['keystorepassword']
keyAlias props['keyalias']
keyPassword props['keypassword']
}
}
buildTypes {
release {
minifyEnabled true
shrinkResources true
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
signingConfig signingConfigs.release
}
}
}
lintOptions {
abortOnError false
}
aaptOptions {
noCompress 'apk'
}
useLibrary 'org.apache.http.legacy'
}
dependencies {
compile "org.jetbrains.kotlin:kotlin-stdlib-jre7:${KOTLIN_VERSION}"
wearApp project(':wear')
provided 'org.projectlombok:lombok:1.14.8'
compile "com.android.support:appcompat-v7:${project.ANDROID_SUPPORT_VERSION}"
compile "com.android.support:customtabs:${project.ANDROID_SUPPORT_VERSION}"
compile "com.android.support:support-emoji:${project.ANDROID_SUPPORT_VERSION}"
compile ('com.klinkerapps:searchview:2.2.5') {
exclude module: 'recyclerview-v7'
}
compile 'com.klinkerapps:article_viewer:0.23.2'
compile 'com.astuetz:pagerslidingtabstrip:1.0.1'
compile 'com.github.castorflex.smoothprogressbar:library:0.5.1'
compile 'de.timroes.android:EnhancedListView:0.3.2@aar'
compile 'org.lucasr.smoothie:smoothie:0.1.0'
compile 'com.klinkerapps:simple_videoview:1.1.2@aar'
compile 'com.klinkerapps:launcher-apis:1.1.0@aar'
compile 'com.google.android.apps.dashclock:dashclock-api:+'
compile 'com.nineoldandroids:library:2.4.0'
compile 'com.yalantis:ucrop:1.5.0'
//compile 'org.twitter4j:twitter4j-core:4.0.4'
//compile 'org.twitter4j:twitter4j-stream:4.0.4'
compile 'org.apache.httpcomponents:httpmime:4.3.5'
compile 'org.apache.httpcomponents:httpcore:4.4.6'
compile 'org.jsoup:jsoup:1.10.2'
compile files('lib/YouTubeAndroidPlayerApi.jar') // version 1.2.1
compile files('lib/twitter4j-klinker24-fork.jar')
compile files('lib/twitter4j-stream-klinker24-fork.jar')
compile(name: 'datetimepicker', ext: 'aar')
compile(name: 'bitmap-cache', ext: 'aar')
compile(name: 'sectioned-recyclerview', ext: 'aar')
compile project(':shared_assets')
}
configurations.all {
resolutionStrategy.eachDependency { DependencyResolveDetails details ->
def requested = details.requested
if (requested.group == 'com.android.support') {
if (!requested.name.startsWith("multidex")) {
details.useVersion ANDROID_SUPPORT_VERSION
}
}
}
}