Skip to content

Commit e84f615

Browse files
macgillsashishkumar468
authored andcommitted
commons-app#3630 [Library Discussion] Core-ktx (commons-app#3660)
1 parent 841f274 commit e84f615

File tree

2 files changed

+20
-45
lines changed

2 files changed

+20
-45
lines changed

app/build.gradle

Lines changed: 19 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -11,19 +11,18 @@ apply from: 'quality.gradle'
1111

1212
def isRunningOnTravisAndIsNotPRBuild = System.getenv("CI") == "true" && file('../play.p12').exists()
1313

14-
if (isRunningOnTravisAndIsNotPRBuild) {
14+
if(isRunningOnTravisAndIsNotPRBuild) {
1515
apply plugin: 'com.github.triplet.play'
1616
}
1717

1818
dependencies {
1919

2020
implementation project(':wikimedia-data-client')
2121
// Utils
22+
implementation 'com.github.nicolas-raoul:Quadtree:ac16ea8035bf07'
2223
implementation 'in.yuvi:http.fluent:1.3'
2324
implementation 'com.google.code.gson:gson:2.8.5'
24-
implementation ("com.squareup.okhttp3:okhttp:$OKHTTP_VERSION"){
25-
force = true //API 19 support
26-
}
25+
implementation 'com.squareup.okhttp3:okhttp:4.2.0'
2726
implementation 'com.squareup.okio:okio:2.2.2'
2827
implementation 'io.reactivex.rxjava2:rxandroid:2.1.0'
2928
implementation 'io.reactivex.rxjava2:rxjava:2.2.3'
@@ -45,16 +44,7 @@ dependencies {
4544
implementation 'com.dinuscxj:circleprogressbar:1.1.1'
4645
implementation 'com.karumi:dexter:5.0.0'
4746
implementation "com.jakewharton:butterknife:$BUTTERKNIFE_VERSION"
48-
implementation 'androidx.lifecycle:lifecycle-extensions:2.2.0'
49-
5047
kapt "com.jakewharton:butterknife-compiler:$BUTTERKNIFE_VERSION"
51-
implementation "com.hannesdorfmann:adapterdelegates4-kotlin-dsl-layoutcontainer:$ADAPTER_DELEGATES_VERSION"
52-
implementation "com.hannesdorfmann:adapterdelegates4-pagination:$ADAPTER_DELEGATES_VERSION"
53-
implementation "androidx.paging:paging-runtime-ktx:$PAGING_VERSION"
54-
testImplementation "androidx.paging:paging-common-ktx:$PAGING_VERSION"
55-
implementation "androidx.paging:paging-rxjava2-ktx:$PAGING_VERSION"
56-
implementation "androidx.recyclerview:recyclerview:1.2.0-alpha02"
57-
implementation "com.squareup.okhttp3:okhttp-ws:$OKHTTP_VERSION"
5848

5949
// Logging
6050
implementation 'ch.acra:acra-dialog:5.3.0'
@@ -63,7 +53,7 @@ dependencies {
6353
api('com.github.tony19:logback-android-classic:1.1.1-6') {
6454
exclude group: 'com.google.android', module: 'android'
6555
}
66-
implementation "com.squareup.okhttp3:logging-interceptor:$OKHTTP_VERSION"
56+
implementation "com.squareup.okhttp3:logging-interceptor:4.2.0"
6757

6858
// Dependency injector
6959
implementation "com.google.dagger:dagger-android-support:$DAGGER_VERSION"
@@ -75,21 +65,19 @@ dependencies {
7565

7666
//Mocking
7767
testImplementation 'com.nhaarman.mockitokotlin2:mockito-kotlin:2.2.0'
78-
testImplementation 'org.mockito:mockito-inline:2.13.0'
68+
testImplementation 'org.mockito:mockito-inline:2.8.47'
7969
testImplementation 'org.mockito:mockito-core:2.23.0'
8070
testImplementation "org.powermock:powermock-module-junit4:2.0.0-beta.5"
8171
testImplementation "org.powermock:powermock-api-mockito2:2.0.0-beta.5"
8272

8373
// Unit testing
84-
testImplementation 'junit:junit:4.13'
74+
testImplementation 'junit:junit:4.12'
8575
testImplementation 'org.robolectric:robolectric:4.3'
8676
testImplementation 'androidx.test:core:1.2.0'
87-
testImplementation "com.squareup.okhttp3:mockwebserver:$OKHTTP_VERSION"
77+
testImplementation 'com.squareup.okhttp3:mockwebserver:3.12.1'
8878
testImplementation "org.powermock:powermock-module-junit4:2.0.0-beta.5"
8979
testImplementation "org.powermock:powermock-api-mockito2:2.0.0-beta.5"
9080
testImplementation 'org.mockito:mockito-core:2.23.0'
91-
testImplementation "com.jraska.livedata:testing-ktx:1.1.2"
92-
testImplementation "androidx.arch.core:core-testing:2.1.0"
9381

9482
// Android testing
9583
androidTestImplementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$KOTLIN_VERSION"
@@ -99,7 +87,7 @@ dependencies {
9987
androidTestImplementation 'androidx.test:runner:1.2.0'
10088
androidTestImplementation 'androidx.test:rules:1.2.0'
10189
androidTestImplementation 'androidx.annotation:annotation:1.1.0'
102-
androidTestImplementation 'com.squareup.okhttp3:mockwebserver:4.8.0'
90+
androidTestImplementation 'com.squareup.okhttp3:mockwebserver:3.12.1'
10391
androidTestUtil 'androidx.test:orchestrator:1.2.0'
10492

10593
// Debugging
@@ -114,48 +102,43 @@ dependencies {
114102
implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
115103
implementation "androidx.exifinterface:exifinterface:1.0.0"
116104
implementation "androidx.core:core-ktx:$CORE_KTX_VERSION"
117-
implementation "androidx.multidex:multidex:2.0.1"
118105

119106
//swipe_layout
120107
implementation 'com.daimajia.swipelayout:library:1.2.0@aar'
121108

122109
//Room
123110
implementation "androidx.room:room-runtime:$ROOM_VERSION"
124-
implementation "androidx.room:room-ktx:$ROOM_VERSION"
111+
kapt "androidx.room:room-compiler:$ROOM_VERSION" // For Kotlin use kapt instead of annotationProcessor
112+
implementation 'com.squareup.retrofit2:retrofit:2.7.1'
125113
implementation "androidx.room:room-rxjava2:$ROOM_VERSION"
126-
kapt "androidx.room:room-compiler:$ROOM_VERSION"
127-
// For Kotlin use kapt instead of annotationProcessor
128-
implementation 'com.squareup.retrofit2:retrofit:2.8.1'
129114
testImplementation "androidx.arch.core:core-testing:2.1.0"
130115

131116
// Pref
132117
// Java language implementation
133118
implementation "androidx.preference:preference:$PREFERENCE_VERSION"
134119
// Kotlin
135120
implementation "androidx.preference:preference-ktx:$PREFERENCE_VERSION"
136-
137-
implementation "androidx.multidex:multidex:$MULTIDEX_VERSION"
138121
}
139122

140123
android {
141124
compileSdkVersion 28
125+
buildToolsVersion "28.0.3"
142126

143127
defaultConfig {
144128
//applicationId 'fr.free.nrw.commons'
145-
versionCode 775
146-
versionName '2.13.1'
129+
versionCode 561
130+
versionName '2.12.3'
147131
setProperty("archivesBaseName", "app-commons-v$versionName-" + getBranchName())
148132

149133
minSdkVersion 19
150134
targetSdkVersion 28
151135
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
152136
testInstrumentationRunnerArguments clearPackageData: 'true'
153137

154-
multiDexEnabled true
155-
156138
testOptions {
157139
execution 'ANDROIDX_TEST_ORCHESTRATOR'
158140
}
141+
159142
vectorDrawables.useSupportLibrary = true
160143
}
161144

@@ -182,7 +165,7 @@ android {
182165
test.resources.srcDirs += 'src/main/resoures'
183166
}
184167

185-
signingConfigs {
168+
signingConfigs {
186169
release
187170
}
188171

@@ -191,7 +174,7 @@ android {
191174
minifyEnabled true
192175
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
193176
testProguardFile 'test-proguard-rules.txt'
194-
if (isRunningOnTravisAndIsNotPRBuild) {
177+
if(isRunningOnTravisAndIsNotPRBuild) {
195178
signingConfig signingConfigs.release
196179
}
197180
}
@@ -214,18 +197,17 @@ android {
214197

215198
configurations.all {
216199
resolutionStrategy.force 'androidx.annotation:annotation:1.0.2'
217-
exclude module: 'okhttp-ws'
218200
}
201+
219202
flavorDimensions 'tier'
220203
productFlavors {
221204
prod {
222205

223-
applicationId 'fr.free.nrw.commons'
206+
applicationId 'fr.free.nrw.commons'
224207

225208
buildConfigField "String", "WIKIMEDIA_API_POTD", "\"https://commons.wikimedia.org/w/api.php?action=featuredfeed&feed=potd&feedformat=rss&language=en\""
226209
buildConfigField "String", "WIKIMEDIA_API_HOST", "\"https://commons.wikimedia.org/w/api.php\""
227210
buildConfigField "String", "WIKIDATA_API_HOST", "\"https://www.wikidata.org/w/api.php\""
228-
buildConfigField "String", "WIKIDATA_URL", "\"https://www.wikidata.org\""
229211
buildConfigField "String", "WIKIMEDIA_FORGE_API_HOST", "\"https://tools.wmflabs.org/\""
230212
buildConfigField "String", "WIKIMEDIA_CAMPAIGNS_URL", "\"https://raw.githubusercontent.com/commons-app/campaigns/master/campaigns.json\""
231213
buildConfigField "String", "IMAGE_URL_BASE", "\"https://upload.wikimedia.org/wikipedia/commons\""
@@ -247,7 +229,6 @@ android {
247229
buildConfigField "String", "COMMIT_SHA", "\"" + getBuildVersion().toString() + "\""
248230
buildConfigField "String", "TEST_USERNAME", "\"" + System.getenv("test_user_name") + "\""
249231
buildConfigField "String", "TEST_PASSWORD", "\"" + System.getenv("test_user_password") + "\""
250-
buildConfigField "String", "DEPICTS_PROPERTY", "\"P180\""
251232

252233
dimension 'tier'
253234
}
@@ -259,7 +240,6 @@ android {
259240
buildConfigField "String", "WIKIMEDIA_API_POTD", "\"https://commons.wikimedia.org/w/api.php?action=featuredfeed&feed=potd&feedformat=rss&language=en\""
260241
buildConfigField "String", "WIKIMEDIA_API_HOST", "\"https://commons.wikimedia.beta.wmflabs.org/w/api.php\""
261242
buildConfigField "String", "WIKIDATA_API_HOST", "\"https://www.wikidata.org/w/api.php\""
262-
buildConfigField "String", "WIKIDATA_URL", "\"https://www.wikidata.org\""
263243
buildConfigField "String", "WIKIMEDIA_FORGE_API_HOST", "\"https://tools.wmflabs.org/\""
264244
buildConfigField "String", "WIKIMEDIA_CAMPAIGNS_URL", "\"https://raw.githubusercontent.com/commons-app/campaigns/master/campaigns_beta_active.json\""
265245
buildConfigField "String", "IMAGE_URL_BASE", "\"https://upload.beta.wmflabs.org/wikipedia/commons\""
@@ -281,7 +261,6 @@ android {
281261
buildConfigField "String", "COMMIT_SHA", "\"" + getBuildVersion().toString() + "\""
282262
buildConfigField "String", "TEST_USERNAME", "\"" + System.getenv("test_user_name") + "\""
283263
buildConfigField "String", "TEST_PASSWORD", "\"" + System.getenv("test_user_password") + "\""
284-
buildConfigField "String", "DEPICTS_PROPERTY", "\"P245962\""
285264

286265
dimension 'tier'
287266
}
@@ -301,7 +280,7 @@ android {
301280
buildToolsVersion buildToolsVersion
302281
}
303282

304-
if (isRunningOnTravisAndIsNotPRBuild) {
283+
if(isRunningOnTravisAndIsNotPRBuild) {
305284
play {
306285
track = "alpha"
307286
userFraction = 1

gradle.properties

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,17 +16,13 @@
1616
org.gradle.jvmargs=-Xmx1536M
1717
android.enableBuildCache=true
1818

19-
KOTLIN_VERSION=1.3.72
19+
KOTLIN_VERSION=1.3.21
2020
BUTTERKNIFE_VERSION=10.1.0
2121
LEAK_CANARY_VERSION=1.6.2
2222
DAGGER_VERSION=2.21
2323
ROOM_VERSION=2.2.3
2424
PREFERENCE_VERSION=1.1.0
2525
CORE_KTX_VERSION=1.2.0
26-
ADAPTER_DELEGATES_VERSION=4.3.0
27-
PAGING_VERSION=2.1.2
28-
MULTIDEX_VERSION=2.0.1
29-
OKHTTP_VERSION=3.12.1
3026

3127
systemProp.http.proxyPort=0
3228
systemProp.http.proxyHost=

0 commit comments

Comments
 (0)