-
Notifications
You must be signed in to change notification settings - Fork 555
/
build.gradle
189 lines (158 loc) · 6.22 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
apply plugin: 'com.android.application'
// This does not break the build when Android Studio is missing the JRebel for Android plugin.
apply plugin: 'com.zeroturnaround.jrebel.android'
apply plugin: 'io.fabric'
apply plugin: 'kotlin-android'
ext {
play_services_version = '7.8.0'
support_lib_version = '23.0.1'
okhttp_version = '2.3.0'
}
dependencies {
compile "com.google.android.gms:play-services-maps:${play_services_version}"
compile "com.google.android.gms:play-services-location:${play_services_version}"
compile "com.google.android.gms:play-services-analytics:${play_services_version}"
compile 'com.sothree.slidinguppanel:library:2.0.2'
compile "com.android.support:support-v4:${support_lib_version}"
compile "com.android.support:appcompat-v7:${support_lib_version}"
compile "com.android.support:cardview-v7:${support_lib_version}"
compile "com.android.support:recyclerview-v7:${support_lib_version}"
compile "com.android.support:design:${support_lib_version}"
//DroneKit-Android client library.
compile 'com.o3dr.android:dronekit-android:2.6.8-beta2'
compile 'me.grantland:autofittextview:0.2.1'
compile(name:'shimmer-android-release', ext:'aar')
compile(name:'libuvccamera-release', ext:'aar')
compile files('libs/droneapi-java-0.3-SNAPSHOT.jar')
compile files('libs/protobuf-java-2.5.0.jar')
compile files('libs/jeromq-0.3.4.jar')
compile files('libs/sius-0.3.0-SNAPSHOT.jar')
compile "com.squareup.okhttp:okhttp:${okhttp_version}"
compile "com.squareup.okhttp:okhttp-urlconnection:${okhttp_version}"
compile 'com.jakewharton.timber:timber:3.1.0'
compile "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
compile('com.crashlytics.sdk.android:crashlytics:2.5.0@aar') {
transitive = true;
}
//Charts and graph library
compile 'com.github.lecho:hellocharts-library:1.5.5@aar'
}
//Decomposed version name and code (https://plus.google.com/+JakeWharton/posts/6f5TcVPRZij)
def versionMajor = 3
def versionMinor = 2
def versionPatch = 1
def versionBuild = 2 //bump for dogfood builds, public betas, etc.
//Logging levels
def logLevelVerbose = 2;
def logLevelDebug = 3;
def logLevelInfo = 4;
def logLevelWarn = 5;
def logLevelError = 6;
def logLevelAssert = 7;
android {
compileSdkVersion 23
buildToolsVersion "23.0.1"
defaultConfig {
applicationId 'org.droidplanner.android'
minSdkVersion 14
targetSdkVersion 22
versionCode versionMajor * 100000 + versionMinor * 1000 + versionPatch * 100 + versionBuild
versionName "Tower-v${versionMajor}.${versionMinor}.${versionPatch}"
buildConfigField "boolean", "WRITE_LOG_FILE", "true"
buildConfigField "int", "LOG_FILE_LEVEL", "$logLevelDebug"
buildConfigField "boolean", "ENABLE_CRASHLYTICS", "false"
// Enabling multidex support.
multiDexEnabled true
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_7
targetCompatibility JavaVersion.VERSION_1_7
}
sourceSets {
main {
manifest.srcFile 'AndroidManifest.xml'
java.srcDirs = ['src']
resources.srcDirs = ['src']
aidl.srcDirs = ['src']
renderscript.srcDirs = ['src']
res.srcDirs = ['res']
assets.srcDirs = ['assets']
}
// 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')
}
//FIXME: remove this after lint errors have been taken care of
lintOptions {
abortOnError false
}
signingConfigs {
release {
storeFile getAppKeystoreFile()
storePassword getAppKeystorePassword()
keyAlias getAppKey()
keyPassword getAppKeyPassword()
}
}
android.applicationVariants.all { variant ->
variant.outputs.each { output ->
def file = output.outputFile
if (file != null && file.name.endsWith('.apk')) {
def buildType = variant.buildType.getName()
def versionCode = defaultConfig.versionCode
output.outputFile = new File(file.parent, "tower-${buildType}.${versionCode}.apk")
}
}
}
buildTypes {
debug {
applicationIdSuffix ".debug"
versionNameSuffix ".debug.${versionBuild}"
resValue "string", "app_title", "Tower Dev"
}
beta {
signingConfig signingConfigs.release
applicationIdSuffix ".beta"
versionNameSuffix ".beta.${versionBuild}"
resValue "string", "app_title", "Tower Beta"
buildConfigField "boolean", "ENABLE_CRASHLYTICS", "true"
}
release {
signingConfig signingConfigs.release
resValue "string", "app_title", "Tower"
buildConfigField "boolean", "WRITE_LOG_FILE", "false"
buildConfigField "boolean", "ENABLE_CRASHLYTICS", "true"
}
}
}
/**
* @return The most recent git tag to be used as version name for the app.
*/
def getGitVersion(){
def cmd = "git describe --tag"
try {
def proc = cmd.execute()
return proc.text.trim()
}catch(IOException e){
//Unable to find 'git'
return "please update version name manually"
}
}
def getAppKeystoreFile() {
def filePath = hasProperty('ORG_DROIDPLANNER_ANDROID_KEYSTORE') ? ORG_DROIDPLANNER_ANDROID_KEYSTORE : null
return filePath ? file(filePath) : null
}
def getAppKeystorePassword(){
return hasProperty('ORG_DROIDPLANNER_ANDROID_KEYSTORE_PWD') ? ORG_DROIDPLANNER_ANDROID_KEYSTORE_PWD : ''
}
def getAppKeyPassword() {
return hasProperty('ORG_DROIDPLANNER_ANDROID_KEY_PWD') ? ORG_DROIDPLANNER_ANDROID_KEY_PWD : ''
}
def getAppKey() {
return hasProperty('ORG_DROIDPLANNER_ANDROID_KEY_ALIAS') ? ORG_DROIDPLANNER_ANDROID_KEY_ALIAS : ''
}