/
build.gradle
250 lines (206 loc) 路 9.51 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
apply plugin: 'com.android.application'
apply plugin: 'de.timfreiheit.resourceplaceholders.plugin'
android {
compileSdkVersion 27
buildToolsVersion '27.0.3'
defaultConfig {
applicationId "openfoodfacts.github.scrachx.openfood"
minSdkVersion 16
targetSdkVersion 27
versionCode 52
versionName "0.9.0.2"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
vectorDrawables.useSupportLibrary = true
}
buildTypes {
release {
crunchPngs true
}
}
dataBinding {
enabled true
}
flavorDimensions "versionCode"
productFlavors {
off {
applicationId "openfoodfacts.github.scrachx.openfood"
resValue "string", "app_name", "OpenFoodFacts"
buildConfigField 'String', 'HOST', '"https://ssl-api.openfoodfacts.org"'
buildConfigField 'String', 'OFOTHERLINKAPP', '"org.openbeautyfacts.scanner"'
buildConfigField 'String', 'OFWEBSITE', '"https://world.openfoodfacts.org/"'
buildConfigField 'String', 'WIKIDATA', '"https://www.wikidata.org/wiki/Special:EntityData/"'
}
obf {
applicationId "openfoodfacts.github.scrachx.openbeauty"
resValue "string", "app_name", "OpenBeautyFacts"
buildConfigField 'String', 'HOST', '"https://ssl-api.openbeautyfacts.org"'
buildConfigField 'String', 'OFOTHERLINKAPP', '"org.openfoodfacts.scanner"'
buildConfigField 'String', 'OFWEBSITE', '"https://world.openbeautyfacts.org/"'
buildConfigField 'String', 'WIKIDATA', '"https://www.wikidata.org/wiki/Special:EntityData/"'
}
opff {
applicationId "org.openpetfoodfacts.scanner"
resValue "string", "app_name", "OpenPetFoodFacts"
buildConfigField 'String', 'HOST', '"https://ssl-api.openpetfoodfacts.org"'
buildConfigField 'String', 'OFOTHERLINKAPP', '"org.openfoodfacts.scanner"'
buildConfigField 'String', 'OFWEBSITE', '"https://world.openpetfoodfacts.org/"'
buildConfigField 'String', 'WIKIDATA', '"https://www.wikidata.org/wiki/Special:EntityData/"'
}
opf {
applicationId "org.openproductsfacts.scanner"
resValue "string", "app_name", "OpenProductsFacts"
buildConfigField 'String', 'HOST', '"https://ssl-api.openproductsfacts.org"'
buildConfigField 'String', 'OFOTHERLINKAPP', '"org.openfoodfacts.scanner"'
buildConfigField 'String', 'OFWEBSITE', '"https://world.openproductsfacts.org/"'
buildConfigField 'String', 'WIKIDATA', '"https://www.wikidata.org/wiki/Special:EntityData/"'
}
}
dexOptions {
preDexLibraries = false
javaMaxHeapSize "4g"
}
defaultConfig {
multiDexEnabled true
// jackOptions.enabled = true
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
lintOptions {
abortOnError false
disable 'MissingTranslation'
}
packagingOptions {
exclude 'META-INF/DEPENDENCIES.txt'
exclude 'META-INF/LICENSE.txt'
exclude 'META-INF/NOTICE.txt'
exclude 'META-INF/NOTICE'
exclude 'META-INF/LICENSE'
exclude 'META-INF/DEPENDENCIES'
exclude 'META-INF/notice.txt'
exclude 'META-INF/license.txt'
exclude 'META-INF/dependencies.txt'
exclude 'META-INF/LGPL2.1'
}
testOptions {
// avoid "Method ... not mocked."
unitTests.returnDefaultValues = true
execution 'ANDROID_TEST_ORCHESTRATOR'
}
}
buildscript {
repositories {
mavenCentral()
jcenter()
maven { url "https://jitpack.io" }
}
}
apply plugin: 'org.greenrobot.greendao'
greendao {
schemaVersion 7
}
android {
// Other settings
buildTypes {
release {
minifyEnabled true
shrinkResources true
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
//Android
implementation "com.android.support:customtabs:$rootProject.supportLibraryVersion"
implementation "com.android.support:appcompat-v7:$rootProject.supportLibraryVersion"
implementation "com.android.support:recyclerview-v7:$rootProject.supportLibraryVersion"
implementation "com.android.support:cardview-v7:$rootProject.supportLibraryVersion"
implementation "com.android.support:support-v4:$rootProject.supportLibraryVersion"
implementation "com.android.support:preference-v14:$rootProject.supportLibraryVersion"
implementation "com.android.support:design:$rootProject.supportLibraryVersion"
implementation "com.android.support:support-annotations:$rootProject.supportLibraryVersion"
implementation 'com.android.support.constraint:constraint-layout:1.1.0'
implementation "com.android.support:multidex:$rootProject.multidexVersion"
//DI
annotationProcessor "com.google.dagger:dagger-compiler:$rootProject.daggerVersion"
implementation "com.google.dagger:dagger:$rootProject.daggerVersion"
compileOnly 'javax.annotation:jsr250-api:1.0'
//Rx
implementation "io.reactivex.rxjava2:rxjava:$rootProject.rxVersion"
implementation "io.reactivex.rxjava2:rxandroid:$rootProject.rxAndroidVersion"
//Networking
implementation "com.squareup.retrofit2:retrofit:$rootProject.retrofitVersion"
implementation "com.squareup.retrofit2:converter-jackson:$rootProject.retrofitVersion"
implementation "com.squareup.retrofit2:adapter-rxjava2:$rootProject.retrofitVersion"
implementation "com.squareup.okhttp3:logging-interceptor:$rootProject.okhttpVersion"
//scheduling jobs
implementation 'com.firebase:firebase-jobdispatcher:0.8.5'
//Serialization/Deserialization
implementation "com.fasterxml.jackson.core:jackson-core:$rootProject.jacksonVersion"
implementation "com.fasterxml.jackson.core:jackson-databind:$rootProject.jacksonVersion"
implementation "com.fasterxml.jackson.core:jackson-annotations:$rootProject.jacksonVersion"
// compile 'io.rest-assured:json-path:3.0.7'
//CSV Serialization/Deserialization
implementation "com.opencsv:opencsv:$rootProject.openCsvVersion"
//Database
implementation "org.greenrobot:greendao:$rootProject.greenDaoVersion"
//Image Loading
implementation "com.squareup.picasso:picasso:$rootProject.picassoVersion"
//Image from gallery or camera
implementation "com.github.jkwiecien:EasyImage:$rootProject.easyImageVersion"
//Binding
implementation "com.jakewharton:butterknife:$rootProject.butterknifeVersion"
annotationProcessor "com.jakewharton:butterknife-compiler:$rootProject.butterknifeVersion"
//Barcode and QR Scanner
implementation "me.dm7.barcodescanner:zxing:$rootProject.qrScannerVersion"
//HTML Dom
implementation "org.jsoup:jsoup:$rootProject.htmlDomVersion"
//Apache
implementation "org.apache.commons:commons-collections4:$rootProject.apacheCollectionsVersion"
implementation "commons-validator:commons-validator:$rootProject.apacheValidatorVersion"
//UI Component : Custom Toast
implementation "net.steamcrafted:load-toast:$rootProject.loadToastVersion"
//UI Component : ImageView with Zooming
implementation "com.github.chrisbanes:PhotoView:$rootProject.zoomingImgVersion"
//UI Component : Material Dialog
implementation("com.afollestad.material-dialogs:core:$rootProject.materialDialogVersion") {
transitive = true
}
//UI Component : Material Drawer
implementation('com.mikepenz:materialdrawer:6.0.2@aar') {
transitive = true
}
//UI Component : Adapters
//DO NOT UPDATE : RecyclerViewCacheUtil removed, needs rework
implementation 'com.mikepenz:fastadapter-commons:2.1.0@aar'
//UI Component : Fab
implementation "com.github.clans:fab:$rootProject.fabVersion"
//UI Component : Font Icons
implementation "com.mikepenz:iconics-core:$rootProject.fontIconCoreVersion"
implementation "com.mikepenz:google-material-typeface:$rootProject.googleMaterialFontVersion"
implementation "com.mikepenz:material-design-iconic-typeface:$rootProject.materialFontVersion"
implementation "com.mikepenz:fontawesome-typeface:$rootProject.awesomeFontVersion"
implementation('com.theartofdev.edmodo:android-image-cropper:2.6.0') {
exclude group: 'com.android.support', module: 'appcompat-v7'
}
//Testing
androidTestUtil 'com.android.support.test:orchestrator:1.0.2'
testImplementation "junit:junit:$rootProject.jUnitVersion"
testImplementation "org.mockito:mockito-core:$rootProject.mockitoVersion"
testImplementation "net.javacrumbs.json-unit:json-unit-fluent:$rootProject.jsonUnitVersion"
// Required for instrumented tests
androidTestImplementation 'com.android.support.test:runner:1.0.2'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
androidTestImplementation 'com.android.support.test.espresso:espresso-intents:3.0.2'
androidTestImplementation 'com.android.support.test.espresso:espresso-web:3.0.2'
androidTestImplementation('com.android.support.test.espresso:espresso-contrib:3.0.1') {
exclude group: 'com.android.support', module: 'appcompat-v7'
exclude group: 'com.android.support', module: 'support-v4'
exclude group: 'com.android.support', module: 'design'
exclude module: 'recyclerview-v7'
}
resourcePlaceholders {
files = ['xml/shortcuts.xml']
}
}