forked from tomahawk-player/tomahawk-android
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
187 lines (168 loc) · 5.46 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
buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:0.14.0'
}
}
import org.apache.tools.ant.taskdefs.condition.Os
apply plugin: 'com.android.application'
repositories {
mavenCentral()
jcenter()
}
dependencies {
compile "com.android.support:appcompat-v7:21.0.0"
compile "com.android.support:support-v4:21.0.0"
compile "se.emilsjolander:stickylistheaders:2.4.1"
compile("ch.acra:acra:4.5.0") {
transitive = false
}
compile "com.fasterxml.jackson.core:jackson-databind:2.4.1.3"
compile "com.google.guava:guava:18.0"
compile "com.squareup.picasso:picasso:2.3.3"
compile "com.github.castorflex.verticalviewpager:library:19.0.0"
compile "de.mrmaffen:vlc-android-sdk:1.0.3"
compile "de.mrmaffen:rdio-android-sdk:1.0.0"
compile "de.mrmaffen:deezer-android-sdk:1.0.0"
compile "de.mrmaffen:holocircularprogressbar:1.0.1"
compile files("libs/RemoteMetadataProvider.jar")
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 "net.sourceforge.findbugs:jsr305:1.3.7"
compile "com.squareup.retrofit:retrofit:1.6.1"
compile 'com.sothree.slidinguppanel:library:2.0.2'
compile "com.nineoldandroids:library:2.4.0"
compile('com.uservoice:uservoice-android-sdk:1.1.2') {
transitive = false
}
}
/*
* Gets the version name from the latest Git tag
*/
def getNewVersionName = { ->
boolean isChanged = 'git diff --cached'.execute().text.length() > 0 ||
'git diff'.execute().text.length() > 0
return 'git describe --tags'.execute().text.replace('\n', '') + (isChanged ? "_modified" : "")
}
android {
compileSdkVersion 21
buildToolsVersion "21.1.0"
defaultConfig {
minSdkVersion 11
targetSdkVersion 21
renderscriptTargetApi 21
renderscriptSupportModeEnabled true
versionName '0.74'
versionCode 740
ndk {
moduleName "libspotifywrapper"
stl "stlport_static"
ldLibs "log", "OpenSLES"
cFlags " -std=c++0x -D__STDC_INT64__"
}
}
lintOptions {
abortOnError false
}
dexOptions {
jumboMode = true
}
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']
jniLibs.srcDir 'libs'
jni.srcDirs = [] //disable automatic ndk-build call
}
// 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')
}
buildTypes {
release {
zipAlign true
runProguard true
proguardFile 'proguard-android.txt'
applicationVariants.all { variant ->
def file = variant.outputFile
variant.outputFile = new File((String) file.parent,
file.name.replace(".apk", "-" + getNewVersionName() + ".apk"))
}
}
debug {
versionNameSuffix "_debug"
zipAlign true
}
}
productFlavors {
arm {
versionName getNewVersionName() + "_arm"
versionCode Integer.parseInt("1" + defaultConfig.versionCode)
ndk {
abiFilters "armeabi", "armeabi-v7a"
}
}
}
}
////////////////////////////////////////////////////
// NDK Support (by https://gist.github.com/pboos) //
////////////////////////////////////////////////////
// Make sure the environment variable $ANDROID_NDK_HOME is set:
// example: ANDROID_NDK_HOME /home/maffen/SDKs/android-ndk-r8e
task ndkBuild(type: Exec) {
if (Os.isFamily(Os.FAMILY_WINDOWS)) {
commandLine new File((String) System.env.ANDROID_NDK_HOME, 'ndk-build.cmd')
} else {
commandLine new File((String) System.env.ANDROID_NDK_HOME, 'ndk-build')
}
}
tasks.withType(JavaCompile) {
compileTask -> compileTask.dependsOn ndkBuild
}
/*
* 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";
}