From 27f9b8a04e0fe5f1621f08e0cbb383adc84a10cb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kuba=20Szczodrzy=C5=84ski?= Date: Fri, 10 Jan 2020 09:30:02 +0100 Subject: [PATCH] Update gradle. Add Chucker. --- app/build.gradle | 3 +++ app/src/main/java/pl/szczodrzynski/edziennik/App.java | 9 +++++++++ gradle/wrapper/gradle-wrapper.properties | 2 +- 3 files changed, 13 insertions(+), 1 deletion(-) diff --git a/app/build.gradle b/app/build.gradle index 012144f0..24e0fd88 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -152,6 +152,9 @@ dependencies { implementation project(":nachos") //implementation project(":Navigation") implementation project(":szkolny-font") + + debugImplementation "com.github.ChuckerTeam.Chucker:library:3.0.1" + releaseImplementation "com.github.ChuckerTeam.Chucker:library-no-op:3.0.1" } repositories { mavenCentral() diff --git a/app/src/main/java/pl/szczodrzynski/edziennik/App.java b/app/src/main/java/pl/szczodrzynski/edziennik/App.java index afb44fda..bb9952a0 100644 --- a/app/src/main/java/pl/szczodrzynski/edziennik/App.java +++ b/app/src/main/java/pl/szczodrzynski/edziennik/App.java @@ -20,6 +20,9 @@ import android.util.Base64; import android.util.Log; import android.util.Pair; +import com.chuckerteam.chucker.api.ChuckerCollector; +import com.chuckerteam.chucker.api.ChuckerInterceptor; +import com.chuckerteam.chucker.api.RetentionManager; import com.evernote.android.job.JobManager; import com.google.android.gms.security.ProviderInstaller; import com.google.firebase.FirebaseApp; @@ -254,6 +257,12 @@ public class App extends androidx.multidex.MultiDexApplication { } } + if (App.devMode || BuildConfig.DEBUG) { + ChuckerCollector chuckerCollector = new ChuckerCollector(this, true, RetentionManager.Period.ONE_HOUR); + ChuckerInterceptor chuckerInterceptor = new ChuckerInterceptor(this, chuckerCollector); + httpBuilder.addInterceptor(chuckerInterceptor); + } + http = httpBuilder.build(); httpLazy = http.newBuilder().followRedirects(false).followSslRedirects(false).build(); diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 7ddd4838..be8ba4d1 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-5.4.1-all.zip \ No newline at end of file +distributionUrl=https\://services.gradle.org/distributions/gradle-6.0-rc-1-all.zip \ No newline at end of file