forked from tomahawk-player/tomahawk-android
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathbuild.gradle
195 lines (179 loc) · 5.8 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
buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:1.2.3'
}
}
apply plugin: 'com.android.application'
repositories {
mavenCentral()
jcenter()
flatDir {
dirs 'libs'
}
}
dependencies {
compile files('libs/RemoteMetadataProvider.jar')
compile 'com.android.support:appcompat-v7:23.1.0'
compile 'com.android.support:support-v4:23.1.0'
compile 'se.emilsjolander:stickylistheaders:2.4.1'
compile('ch.acra:acra:4.6.2') {
transitive = false
}
compile 'com.google.code.gson:gson:2.3.1'
compile 'com.google.android.gms:play-services-base:7.5.0'
compile('com.stanfy:gson-xml-java:0.1.7') {
exclude group: 'xmlpull', module: 'xmlpull'
}
compile 'com.squareup.picasso:picasso:2.4.0'
compile 'com.squareup.okhttp:okhttp:2.5.0'
compile 'com.squareup.okhttp:okhttp-urlconnection:2.5.0'
compile 'com.github.castorflex.smoothprogressbar:library:1.0.0'
compile 'de.mrmaffen:vlc-android-sdk:3.0.0'
compile 'de.mrmaffen:holocircularprogressbar:1.0.1'
compile 'org.apache.lucene:lucene-core:4.7.2'
compile 'org.apache.lucene:lucene-analyzers-common:4.7.2'
compile 'org.apache.lucene:lucene-queryparser:4.7.2'
compile 'commons-io:commons-io:2.4'
compile 'net.sourceforge.findbugs:jsr305:1.3.7'
compile 'com.squareup.retrofit:retrofit:1.8.0'
compile 'com.sothree.slidinguppanel:library:3.2.0'
compile('com.uservoice:uservoice-android-sdk:1.2.4')
compile 'de.greenrobot:eventbus:2.4.0'
compile 'com.daimajia.swipelayout:library:1.2.0@aar'
compile 'org.jdeferred:jdeferred-android-aar:1.2.4'
compile 'org.slf4j:slf4j-android:1.7.12'
compile 'com.github.rahatarmanahmed:circularprogressview:2.3.2'
}
android {
compileSdkVersion 23
buildToolsVersion '23.0.1'
defaultConfig {
minSdkVersion 14
targetSdkVersion 22
renderscriptTargetApi 22
renderscriptSupportModeEnabled true
versionName '0.93'
versionCode 930
}
lintOptions {
abortOnError false
}
dexOptions {
jumboMode = true
javaMaxHeapSize "2g"
}
packagingOptions {
exclude 'META-INF/DEPENDENCIES'
exclude 'META-INF/NOTICE'
exclude 'META-INF/LICENSE'
exclude 'META-INF/LICENSE.txt'
exclude 'META-INF/NOTICE.txt'
exclude 'META-INF/ASL2.0'
}
sourceSets {
main {
manifest.srcFile 'AndroidManifest.xml'
java.srcDirs = ['src']
aidl.srcDirs = ['src']
renderscript.srcDirs = ['src']
res.srcDirs = ['res']
assets.srcDirs = ['assets']
}
// Move the tests to tests/java, tests/res, etc...
instrumentTest.setRoot('tests')
// Move the build types to build-types/<type>
// For instance, build-types/debug/java, build-types/debug/AndroidManifest.xml, ...
// This moves them out of them default location under src/<type>/... which would
// conflict with src/ being used by the main source set.
// Adding new build types or product flavors should be accompanied
// by a similar customization.
debug.setRoot('build-types/debug')
release.setRoot('build-types/release')
}
/*
* Tries to get the version name from the latest Git tag
*/
def getNewVersionName = { ->
try {
boolean isChanged = 'git diff --cached'.execute([], projectDir).text.length() > 0 ||
'git diff'.execute([], projectDir).text.length() > 0
return 'git describe --tags'.execute([], projectDir).text.replace('\n', '') +
(isChanged ? "_modified" : "")
}
catch (IOException e) {
logger.error("Wasn't able to get version tag: " + e.getMessage());
return defaultConfig.versionName + "_nogit"
}
}
applicationVariants.all { variant ->
variant.outputs.each { output ->
def outputFile = output.outputFile
if (outputFile != null && outputFile.name.endsWith('.apk')) {
def fileName = outputFile.name.replace(".apk", "-" + getNewVersionName() + ".apk")
output.outputFile = new File(outputFile.parent, fileName)
}
}
}
buildTypes {
release {
zipAlignEnabled true
minifyEnabled true
proguardFile 'proguard-android.txt'
}
debug {
versionNameSuffix "_debug"
zipAlignEnabled true
}
}
productFlavors {
x86 {
ndk {
abiFilter "x86"
}
versionName getNewVersionName() + "_x86"
versionCode Integer.parseInt("6$defaultConfig.versionCode")
}
armv7a {
ndk {
abiFilter "armeabi-v7a"
}
versionName getNewVersionName() + "_armv7a"
versionCode Integer.parseInt("2$defaultConfig.versionCode")
}
arm {
ndk {
abiFilter "armeabi"
}
versionName getNewVersionName() + "_arm"
versionCode Integer.parseInt("1$defaultConfig.versionCode")
}
}
}
/*
* Include the file "signingconfig.gradle" (which defines the signingConfig), if it exists
* Example of the contents of such "signingconfig.gradle":
*
* android {
* signingConfigs {
* release {
* storeFile file("key.keystore")
* storePassword "password"
* keyAlias "alias"
* keyPassword "password"
* }
* }
*
* buildTypes {
* release {
* signingConfig signingConfigs.release
* }
* }
* }
*
*/
if (new File("signingconfig.gradle").exists()) {
apply from: "signingconfig.gradle";
}