Skip to content

Commit

Permalink
Feature/update dependencies (duckduckgo#421)
Browse files Browse the repository at this point in the history
* Update gradle and AGP

* Update dependencies; fix breaking change in WorkManager API)

* Extract remainder of dependency versions for consistency

* Update to latest alphas of constraintlayout, room and workManager
  • Loading branch information
CDRussell authored Feb 7, 2019
1 parent 875b402 commit 63e4cd4
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 22 deletions.
36 changes: 21 additions & 15 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -77,17 +77,22 @@ android {
}

ext {
androidX = "1.0.1"
materialDesign = "1.1.0-alpha01"
androidX = "1.0.2"
materialDesign = "1.1.0-alpha02"
architectureComponents = "1.1.1"
architectureComponentsExtensions = "1.1.1"
androidKtx = "1.0.1"
androidTestRunner = "1.0.2"
constraintLayout = "2.0.0-alpha2"
constraintLayout = "2.0.0-alpha3"
lifecycle = "2.0.0"
room = "2.1.0-alpha02"
workManager = "1.0.0-alpha11"
room = "2.1.0-alpha04"
workManager = "1.0.0-beta03"
legacySupport = "1.0.0"
espressoCore = "3.1.1"
coreTesting = "2.0.0"
androidTestRunner = "1.0.2"
testRunner = "1.1.1"

junit = "4.12"
dagger = "2.18"
retrofit = "2.3.0"
ankoVersion = "0.10.4"
Expand All @@ -101,11 +106,12 @@ ext {
leakCanary = "1.6.2"
mockito = "2.18.3"
mockitoKotlin = "2.0.0"
commonsMath = "3.6.1"
}


dependencies {
implementation 'androidx.legacy:legacy-support-v4:1.0.0'
implementation "androidx.legacy:legacy-support-v4:$legacySupport"
debugImplementation "com.squareup.leakcanary:leakcanary-android:$leakCanary"
releaseImplementation "com.squareup.leakcanary:leakcanary-android-no-op:$leakCanary"

Expand Down Expand Up @@ -137,8 +143,8 @@ dependencies {
// ViewModel and LiveData
implementation "androidx.lifecycle:lifecycle-extensions:$lifecycle"
kapt "androidx.lifecycle:lifecycle-compiler:$lifecycle"
testImplementation "androidx.arch.core:core-testing:$lifecycle"
androidTestImplementation "androidx.arch.core:core-testing:$lifecycle"
testImplementation "androidx.arch.core:core-testing:$coreTesting"
androidTestImplementation "androidx.arch.core:core-testing:$coreTesting"

// Room
implementation "androidx.room:room-runtime:$room"
Expand All @@ -163,16 +169,16 @@ dependencies {
implementation "com.airbnb.android:lottie:$lottieVersion"

// Apache commons
implementation "org.apache.commons:commons-math3:3.6.1"
implementation "org.apache.commons:commons-math3:$commonsMath"

testImplementation "org.mockito:mockito-core:$mockito"
testImplementation "com.nhaarman.mockitokotlin2:mockito-kotlin:$mockitoKotlin"
testImplementation "junit:junit:4.12"
testImplementation "junit:junit:$junit"

androidTestImplementation 'androidx.test:runner:1.1.0'
androidTestImplementation 'androidx.test:rules:1.1.0'
androidTestUtil "androidx.test:orchestrator:1.1.0"
androidTestImplementation "androidx.test.espresso:espresso-core:3.1.0"
androidTestImplementation "androidx.test:runner:$testRunner"
androidTestImplementation "androidx.test:rules:$testRunner"
androidTestUtil "androidx.test:orchestrator:$testRunner"
androidTestImplementation "androidx.test.espresso:espresso-core:$espressoCore"
androidTestImplementation "org.mockito:mockito-android:$mockito"
androidTestImplementation "com.squareup.okhttp3:mockwebserver:$okHttp"
androidTestImplementation "com.nhaarman.mockitokotlin2:mockito-kotlin:$mockitoKotlin"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ package com.duckduckgo.app.fire
import android.content.Context
import androidx.annotation.WorkerThread
import androidx.work.CoroutineWorker
import androidx.work.ListenableWorker.Result.SUCCESS
import androidx.work.ListenableWorker.Result.success
import androidx.work.WorkerParameters
import com.duckduckgo.app.global.view.ClearDataAction
import com.duckduckgo.app.settings.clear.ClearWhatOption
Expand All @@ -36,19 +36,19 @@ class DataClearingWorker(context: Context, workerParams: WorkerParameters) : Cor
lateinit var clearDataAction: ClearDataAction

@WorkerThread
override suspend fun doWork(): Payload {
override suspend fun doWork(): Result {

if (jobAlreadyExecuted()) {
Timber.i("This job has run before; no more work needed")
return Payload(SUCCESS)
return success()
}

settingsDataStore.lastExecutedJobId = id.toString()

clearData(settingsDataStore.automaticallyClearWhatOption)

Timber.i("Clear data job finished; returning SUCCESS")
return Payload(SUCCESS)
return success()
}

/**
Expand Down
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ buildscript {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.2.1'
classpath 'com.android.tools.build:gradle:3.3.0'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
classpath "com.android.tools.build.jetifier:jetifier-processor:$jetifier"

Expand Down
4 changes: 2 additions & 2 deletions gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#Fri Jun 15 10:32:19 BST 2018
#Fri Jan 18 10:05:44 GMT 2019
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-4.6-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-4.10.1-all.zip

0 comments on commit 63e4cd4

Please sign in to comment.