Update gradle. Add Chucker.

This commit is contained in:
Kuba Szczodrzyński 2020-01-10 09:30:02 +01:00
parent 86669a491a
commit 27f9b8a04e
3 changed files with 13 additions and 1 deletions

View File

@ -152,6 +152,9 @@ dependencies {
implementation project(":nachos") implementation project(":nachos")
//implementation project(":Navigation") //implementation project(":Navigation")
implementation project(":szkolny-font") 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 { repositories {
mavenCentral() mavenCentral()

View File

@ -20,6 +20,9 @@ import android.util.Base64;
import android.util.Log; import android.util.Log;
import android.util.Pair; 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.evernote.android.job.JobManager;
import com.google.android.gms.security.ProviderInstaller; import com.google.android.gms.security.ProviderInstaller;
import com.google.firebase.FirebaseApp; 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(); http = httpBuilder.build();
httpLazy = http.newBuilder().followRedirects(false).followSslRedirects(false).build(); httpLazy = http.newBuilder().followRedirects(false).followSslRedirects(false).build();

View File

@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-5.4.1-all.zip distributionUrl=https\://services.gradle.org/distributions/gradle-6.0-rc-1-all.zip