Skip to content

Commit

Permalink
commons-app#3630 [Library Discussion] Core-ktx (commons-app#3660)
Browse files Browse the repository at this point in the history
  • Loading branch information
macgills authored and ashishkumar468 committed Oct 10, 2020
1 parent 841f274 commit e84f615
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 45 deletions.
59 changes: 19 additions & 40 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -11,19 +11,18 @@ apply from: 'quality.gradle'

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

if (isRunningOnTravisAndIsNotPRBuild) {
if(isRunningOnTravisAndIsNotPRBuild) {
apply plugin: 'com.github.triplet.play'
}

dependencies {

implementation project(':wikimedia-data-client')
// Utils
implementation 'com.github.nicolas-raoul:Quadtree:ac16ea8035bf07'
implementation 'in.yuvi:http.fluent:1.3'
implementation 'com.google.code.gson:gson:2.8.5'
implementation ("com.squareup.okhttp3:okhttp:$OKHTTP_VERSION"){
force = true //API 19 support
}
implementation 'com.squareup.okhttp3:okhttp:4.2.0'
implementation 'com.squareup.okio:okio:2.2.2'
implementation 'io.reactivex.rxjava2:rxandroid:2.1.0'
implementation 'io.reactivex.rxjava2:rxjava:2.2.3'
Expand All @@ -45,16 +44,7 @@ dependencies {
implementation 'com.dinuscxj:circleprogressbar:1.1.1'
implementation 'com.karumi:dexter:5.0.0'
implementation "com.jakewharton:butterknife:$BUTTERKNIFE_VERSION"
implementation 'androidx.lifecycle:lifecycle-extensions:2.2.0'

kapt "com.jakewharton:butterknife-compiler:$BUTTERKNIFE_VERSION"
implementation "com.hannesdorfmann:adapterdelegates4-kotlin-dsl-layoutcontainer:$ADAPTER_DELEGATES_VERSION"
implementation "com.hannesdorfmann:adapterdelegates4-pagination:$ADAPTER_DELEGATES_VERSION"
implementation "androidx.paging:paging-runtime-ktx:$PAGING_VERSION"
testImplementation "androidx.paging:paging-common-ktx:$PAGING_VERSION"
implementation "androidx.paging:paging-rxjava2-ktx:$PAGING_VERSION"
implementation "androidx.recyclerview:recyclerview:1.2.0-alpha02"
implementation "com.squareup.okhttp3:okhttp-ws:$OKHTTP_VERSION"

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

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

//Mocking
testImplementation 'com.nhaarman.mockitokotlin2:mockito-kotlin:2.2.0'
testImplementation 'org.mockito:mockito-inline:2.13.0'
testImplementation 'org.mockito:mockito-inline:2.8.47'
testImplementation 'org.mockito:mockito-core:2.23.0'
testImplementation "org.powermock:powermock-module-junit4:2.0.0-beta.5"
testImplementation "org.powermock:powermock-api-mockito2:2.0.0-beta.5"

// Unit testing
testImplementation 'junit:junit:4.13'
testImplementation 'junit:junit:4.12'
testImplementation 'org.robolectric:robolectric:4.3'
testImplementation 'androidx.test:core:1.2.0'
testImplementation "com.squareup.okhttp3:mockwebserver:$OKHTTP_VERSION"
testImplementation 'com.squareup.okhttp3:mockwebserver:3.12.1'
testImplementation "org.powermock:powermock-module-junit4:2.0.0-beta.5"
testImplementation "org.powermock:powermock-api-mockito2:2.0.0-beta.5"
testImplementation 'org.mockito:mockito-core:2.23.0'
testImplementation "com.jraska.livedata:testing-ktx:1.1.2"
testImplementation "androidx.arch.core:core-testing:2.1.0"

// Android testing
androidTestImplementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$KOTLIN_VERSION"
Expand All @@ -99,7 +87,7 @@ dependencies {
androidTestImplementation 'androidx.test:runner:1.2.0'
androidTestImplementation 'androidx.test:rules:1.2.0'
androidTestImplementation 'androidx.annotation:annotation:1.1.0'
androidTestImplementation 'com.squareup.okhttp3:mockwebserver:4.8.0'
androidTestImplementation 'com.squareup.okhttp3:mockwebserver:3.12.1'
androidTestUtil 'androidx.test:orchestrator:1.2.0'

// Debugging
Expand All @@ -114,48 +102,43 @@ dependencies {
implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
implementation "androidx.exifinterface:exifinterface:1.0.0"
implementation "androidx.core:core-ktx:$CORE_KTX_VERSION"
implementation "androidx.multidex:multidex:2.0.1"

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

//Room
implementation "androidx.room:room-runtime:$ROOM_VERSION"
implementation "androidx.room:room-ktx:$ROOM_VERSION"
kapt "androidx.room:room-compiler:$ROOM_VERSION" // For Kotlin use kapt instead of annotationProcessor
implementation 'com.squareup.retrofit2:retrofit:2.7.1'
implementation "androidx.room:room-rxjava2:$ROOM_VERSION"
kapt "androidx.room:room-compiler:$ROOM_VERSION"
// For Kotlin use kapt instead of annotationProcessor
implementation 'com.squareup.retrofit2:retrofit:2.8.1'
testImplementation "androidx.arch.core:core-testing:2.1.0"

// Pref
// Java language implementation
implementation "androidx.preference:preference:$PREFERENCE_VERSION"
// Kotlin
implementation "androidx.preference:preference-ktx:$PREFERENCE_VERSION"

implementation "androidx.multidex:multidex:$MULTIDEX_VERSION"
}

android {
compileSdkVersion 28
buildToolsVersion "28.0.3"

defaultConfig {
//applicationId 'fr.free.nrw.commons'
versionCode 775
versionName '2.13.1'
versionCode 561
versionName '2.12.3'
setProperty("archivesBaseName", "app-commons-v$versionName-" + getBranchName())

minSdkVersion 19
targetSdkVersion 28
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
testInstrumentationRunnerArguments clearPackageData: 'true'

multiDexEnabled true

testOptions {
execution 'ANDROIDX_TEST_ORCHESTRATOR'
}

vectorDrawables.useSupportLibrary = true
}

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

signingConfigs {
signingConfigs {
release
}

Expand All @@ -191,7 +174,7 @@ android {
minifyEnabled true
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
testProguardFile 'test-proguard-rules.txt'
if (isRunningOnTravisAndIsNotPRBuild) {
if(isRunningOnTravisAndIsNotPRBuild) {
signingConfig signingConfigs.release
}
}
Expand All @@ -214,18 +197,17 @@ android {

configurations.all {
resolutionStrategy.force 'androidx.annotation:annotation:1.0.2'
exclude module: 'okhttp-ws'
}

flavorDimensions 'tier'
productFlavors {
prod {

applicationId 'fr.free.nrw.commons'
applicationId 'fr.free.nrw.commons'

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

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

dimension 'tier'
}
Expand All @@ -301,7 +280,7 @@ android {
buildToolsVersion buildToolsVersion
}

if (isRunningOnTravisAndIsNotPRBuild) {
if(isRunningOnTravisAndIsNotPRBuild) {
play {
track = "alpha"
userFraction = 1
Expand Down
6 changes: 1 addition & 5 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -16,17 +16,13 @@
org.gradle.jvmargs=-Xmx1536M
android.enableBuildCache=true

KOTLIN_VERSION=1.3.72
KOTLIN_VERSION=1.3.21
BUTTERKNIFE_VERSION=10.1.0
LEAK_CANARY_VERSION=1.6.2
DAGGER_VERSION=2.21
ROOM_VERSION=2.2.3
PREFERENCE_VERSION=1.1.0
CORE_KTX_VERSION=1.2.0
ADAPTER_DELEGATES_VERSION=4.3.0
PAGING_VERSION=2.1.2
MULTIDEX_VERSION=2.0.1
OKHTTP_VERSION=3.12.1

systemProp.http.proxyPort=0
systemProp.http.proxyHost=
Expand Down

0 comments on commit e84f615

Please sign in to comment.