forked from mycelium-com/wallet-android
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle
267 lines (237 loc) · 10.4 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
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
apply plugin: 'com.android.application'
repositories {
mavenCentral()
}
buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath androidBuildArtifact
}
}
configurations {
compile.exclude group: 'org.apache.httpcomponents', module: 'httpclient'
}
dependencies {
testCompile "junit:junit:$junitVersion"
androidTestCompile "junit:junit:$junitVersion"
androidTestCompile 'com.android.support:support-annotations:23.3.0'
androidTestCompile 'com.android.support.test:runner:0.5'
androidTestCompile 'com.android.support.test:rules:0.5'
compile project(includePrefix + ':libs:zxing-android')
compile project(includePrefix + ':coinapult')
compile project(includePrefix + ':wapi')
compile project(includePrefix + ':trezor')
compile project(includePrefix + ':lt-api')
compile(project(includePrefix + ':mbwlib')) {
exclude module: 'jcip-annotations'
}
compile project(includePrefix + ':btchip')
compile project(includePrefix + ':LVL')
compile guavaArtifact
compile 'com.squareup.retrofit2:retrofit:2.3.0'
compile 'com.squareup.retrofit2:converter-gson:2.3.0'
compile 'com.squareup.okhttp3:logging-interceptor:3.6.0'
// TODO: upgrade this! and remove the exclude support-v4 below
//not upgrading. This will be removed from the core app
compile('com.google.android.gms:play-services-base:7.8.0') {
exclude module: 'support-v4'
}
compile('com.google.android.gms:play-services-gcm:7.8.0') {
exclude module: 'support-v4'
}
compile('com.google.code.findbugs:annotations:3.0.1') {
exclude module: 'jsr305'
}
// https://mvnrepository.com/artifact/com.google.protobuf/protobuf-java
annotationProcessor 'com.jakewharton:butterknife-compiler:8.1.0'
compile 'com.squareup:otto:1.3.4'
compile 'com.android.support:appcompat-v7:19.1.0'
compile 'com.android.support:support-v4:19.1.0'
compile 'com.android.support:recyclerview-v7:22.2.0'
compile 'org.ocpsoft.prettytime:prettytime:3.2.5.Final'
compile 'de.cketti.library.changelog:ckchangelog:1.2.2'
compile 'com.squareup.retrofit:retrofit:1.9.0'
compile 'com.jakewharton:butterknife:8.1.0'
compile 'io.reactivex:rxandroid:1.1.0'
compile 'com.squareup.okhttp:okhttp:2.7.5'
compile 'com.android.support:multidex:1.0.1'
compile 'commons-codec:commons-codec:1.5'
compile 'com.google.protobuf:protobuf-java:3.1.0'
compile 'com.android.support.constraint:constraint-layout:1.0.0-alpha7'
annotationProcessor 'com.jakewharton:butterknife-compiler:8.1.0'
}
android {
configurations {
all*.exclude module: 'jcip-annotations'
all*.exclude module: 'jsr305'
}
dexOptions {
javaMaxHeapSize "4g"
jumboMode = true
}
lintOptions {
//gradle build complains about com.android.support:support-v4:22.2.0 not being compatible
}
packagingOptions {
exclude 'META-INF/LICENSE'
exclude 'META-INF/NOTICE'
exclude 'META-INF/DEPENDENCIES'
// bitcoinj brings in a native library for x86_64, which seems to confuse the playstore upload - just strip the file
exclude 'lib/x86_64/darwin/libscrypt.dylib'
}
compileOptions {
sourceCompatibility = 'VERSION_1_7'
targetCompatibility = 'VERSION_1_7'
}
buildToolsVersion androidSdkBuildVersion
defaultConfig {
versionCode 2091107
versionName '2.9.11.7'
multiDexEnabled true
minSdkVersion 14
targetSdkVersion 19
compileSdkVersion 25
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
signingConfigs {
release {
keyAlias = ''
}
btctestnet {
keyAlias = ''
}
commonDebug {
storeFile commonDebugKeystore
storePassword 'android'
keyAlias 'androiddebugkey'
keyPassword 'android'
}
}
buildTypes {
release {
minifyEnabled false
applicationVariants.all { variant ->
variant.outputs.each { output ->
def file = output.outputFile
if (file != null && file.name.endsWith('.apk')) {
def versionExtension = "-" + defaultConfig.versionName + "build" + defaultConfig.versionCode + ".apk"
output.outputFile = new File(file.parent, file.name.replace(".apk", versionExtension))
}
}
}
}
debug {
applicationIdSuffix '.debug'
debuggable true
}
}
productFlavors {
prodnet {
applicationId 'com.mycelium.wallet'
versionName = defaultConfig.versionName
signingConfig signingConfigs.release
ext {
MTAssetID = "LaA8aiRBha2BcC6PCqMuK8xzZqdA3Lb6VVv41K"
MassAssetID = "La4szjzKfJyHQ75qgDEnbzp4qY8GQeDR5Z7h2W"
RMCAssetID = "La4aGUPuNKZyC393pS2Nb4RJdk2WvmoaAdrRLZ"
RMCApiClientURL = "https://rmc-ico.gear.mycelium.com/api/"
ColoredCoinsApiURLs = '{"https://coloredcoinsd.gear.mycelium.com/v3/", "https://api.coloredcoins.org/v3/"}'
ColuBlockExplorerApiURLs = '{"https://coloredcoins.gear.mycelium.com/api/", "https://explorer.coloredcoins.org/api/"}'
RMCChangeAddress = "18c91fJmVg7btPjxpwrhgwd37GkVghq9me"
}
}
dev {
// if we are not on master, include the branchname in appId
def appId = 'com.mycelium.devwallet';
def branch = getGitBranch()
if (branch != "" && branch != "master") {
appId = appId + "_" + branch.replaceAll("-", "_")
versionName = defaultConfig.versionName + "-DEV_" + branch
}
applicationId appId
signingConfig signingConfigs.debug
ext {
MTAssetID = "La3JCiNMGmc74rcfYiBAyTUstFgmGDRDkGGCRM"
MassAssetID = "La4szjzKfJyHQ75qgDEnbzp4qY8GQeDR5Z7h2W"
RMCAssetID = "La8yFVyKmHGf4KWjcPqATZeTrSxXyzB3JRPxDc"
RMCApiClientURL = "https://rmc-ico-test.gear.mycelium.com/api/"
ColoredCoinsApiURLs = '{"http://testnet.api.coloredcoins.org/v3/"}'
ColuBlockExplorerApiURLs = '{"http://testnet.explorer.coloredcoins.org/api/"}'
RMCChangeAddress = "mx92L6iuCfxQUz4cLNU4jJpfWbavVHgYj9"
}
}
devprod {
applicationId 'com.mycelium.devprodwallet'
signingConfig signingConfigs.debug
ext {
MTAssetID = "LaA8aiRBha2BcC6PCqMuK8xzZqdA3Lb6VVv41K"
MassAssetID = "La4szjzKfJyHQ75qgDEnbzp4qY8GQeDR5Z7h2W"
RMCAssetID = "La3bgndN7QSYqV8pWuuqbfBPyHMZRK14Tb2BPg"
RMCApiClientURL = "https://rmc-ico-stg.gear.mycelium.com/api/"
ColoredCoinsApiURLs = '{"https://coloredcoinsd.gear.mycelium.com/v3/", "https://api.coloredcoins.org/v3/"}'
ColuBlockExplorerApiURLs = '{"https://coloredcoins.gear.mycelium.com/api/", "https://explorer.coloredcoins.org/api/"}'
RMCChangeAddress = "18c91fJmVg7btPjxpwrhgwd37GkVghq9me"
}
}
btctestnet {
// targetting version 19 for mainnet but 23 for testnet is a result of our temporary
// featuring of the modularization branch in the testnet release and google not allowing
// to down-grade the security model.
targetSdkVersion 23
applicationId 'com.mycelium.testnetwallet'
versionName = defaultConfig.versionName + '-TESTNET'
signingConfig signingConfigs.btctestnet
ext {
MTAssetID = "La3JCiNMGmc74rcfYiBAyTUstFgmGDRDkGGCRM"
MassAssetID = "La4szjzKfJyHQ75qgDEnbzp4qY8GQeDR5Z7h2W"
RMCAssetID = "La8yFVyKmHGf4KWjcPqATZeTrSxXyzB3JRPxDc"
RMCApiClientURL = "https://rmc-ico-test.gear.mycelium.com/api/"
ColoredCoinsApiURLs = '{"http://testnet.api.coloredcoins.org/v3/"}'
ColuBlockExplorerApiURLs = '{"http://testnet.explorer.coloredcoins.org/api/"}'
RMCChangeAddress = "mx92L6iuCfxQUz4cLNU4jJpfWbavVHgYj9"
}
}
}
applicationVariants.all { variant ->
def flavor = variant.productFlavors[0]
variant.buildConfigField "String", "MTAssetID", "\"${flavor.ext.MTAssetID}\""
variant.buildConfigField "String", "MassAssetID", "\"${flavor.ext.MassAssetID}\""
variant.buildConfigField "String", "RMCAssetID", "\"${flavor.ext.RMCAssetID}\""
variant.buildConfigField "String", "RMCApiClientURL", "\"${flavor.ext.RMCApiClientURL}\""
variant.buildConfigField "String[]", "ColoredCoinsApiURLs", "${flavor.ext.ColoredCoinsApiURLs}"
variant.buildConfigField "String[]", "ColuBlockExplorerApiURLs", "${flavor.ext.ColuBlockExplorerApiURLs}"
variant.buildConfigField "String", "RMCChangeAddress", "\"${flavor.ext.RMCChangeAddress}\""
}
testOptions {
unitTests.returnDefaultValues = true
}
}
if (commonDebugKeystore.exists()) {
android.buildTypes.debug.signingConfig = android.signingConfigs.commonDebug
android.productFlavors.dev.signingConfig = android.signingConfigs.commonDebug
logger.info("keytore_debug detected")
}
if (project.hasProperty('prodKeyStore') &&
project.hasProperty('prodKeyAlias') &&
project.hasProperty('prodKeyStorePassword') &&
project.hasProperty('prodKeyAliasPassword')) {
android.signingConfigs.release.storeFile = file('../../' + prodKeyStore)
android.signingConfigs.release.keyAlias = prodKeyAlias
android.signingConfigs.release.storePassword = prodKeyStorePassword
android.signingConfigs.release.keyPassword = prodKeyAliasPassword
} else {
android.productFlavors.prodnet.signingConfig = null
}
if (project.hasProperty('testKeyStore') &&
project.hasProperty('testKeyAlias') &&
project.hasProperty('testKeyStorePassword') &&
project.hasProperty('testKeyAliasPassword')) {
android.signingConfigs.btctestnet.storeFile = file('../../' + testKeyStore)
android.signingConfigs.btctestnet.keyAlias = testKeyAlias
android.signingConfigs.btctestnet.storePassword = testKeyStorePassword
android.signingConfigs.btctestnet.keyPassword = testKeyAliasPassword
} else {
android.productFlavors.btctestnet.signingConfig = null
}