diff --git a/build.gradle b/build.gradle index 71d2fd6..92b8fdd 100644 --- a/build.gradle +++ b/build.gradle @@ -2,15 +2,19 @@ buildscript { repositories { + google() jcenter() } dependencies { - classpath 'com.android.tools.build:gradle:1.3.0' + classpath 'com.android.tools.build:gradle:3.5.3' + classpath 'com.github.dcendents:android-maven-gradle-plugin:2.1' + classpath 'com.google.firebase:firebase-crashlytics-gradle:2.0.0-beta01' } } allprojects { repositories { + google() jcenter() } } diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index dde03e6..796af10 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,6 @@ -#Fri May 22 19:10:15 JST 2015 +#Tue Jan 21 11:39:53 CST 2020 distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-2.2.1-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-5.4.1-all.zip diff --git a/lib/build.gradle b/lib/build.gradle index 39a8e70..af32f3e 100644 --- a/lib/build.gradle +++ b/lib/build.gradle @@ -1,26 +1,15 @@ -buildscript { - repositories { - jcenter() - } - dependencies { - classpath 'com.novoda:bintray-release:0.3.4' - } -} - apply plugin: 'com.android.library' -apply plugin: 'com.novoda.bintray-release' +apply plugin: 'com.github.dcendents.android-maven' -repositories { - maven { url 'https://maven.fabric.io/public' } -} +group='com.github.searchy2' +version = '1.0.2' android { - compileSdkVersion 21 - buildToolsVersion "21.1.2" + compileSdkVersion 28 defaultConfig { minSdkVersion 15 - targetSdkVersion 21 + targetSdkVersion 28 versionCode 1 versionName "1.0" } @@ -39,19 +28,9 @@ android { } dependencies { - compile fileTree(dir: 'libs', include: ['*.jar']) - compile 'com.jakewharton.timber:timber:4.0.0' - provided 'com.crashlytics.sdk.android:crashlytics:2.2.4' - testCompile 'junit:junit:4.12' - testCompile 'org.mockito:mockito-core:1.10.19' -} - -publish { - groupId = 'net.ypresto.timbertreeutils' - artifactId = 'timbertreeutils' - version = '1.0.0-SNAPSHOT' - licences = ['Apache-2.0'] - website = 'https://github.com/ypresto/TimberTreeUtils' - autoPublish = false - dryRun = false -} + implementation fileTree(dir: 'libs', include: ['*.jar']) + implementation 'com.jakewharton.timber:timber:4.7.1' + provided 'com.google.firebase:firebase-crashlytics:17.0.0-beta01' + testImplementation 'junit:junit:4.12' + testImplementation 'org.mockito:mockito-core:1.10.19' +} \ No newline at end of file diff --git a/lib/src/main/java/net/ypresto/timbertreeutils/CrashlyticsLogExceptionTree.java b/lib/src/main/java/net/ypresto/timbertreeutils/CrashlyticsLogExceptionTree.java index dc828e9..0b5a60f 100644 --- a/lib/src/main/java/net/ypresto/timbertreeutils/CrashlyticsLogExceptionTree.java +++ b/lib/src/main/java/net/ypresto/timbertreeutils/CrashlyticsLogExceptionTree.java @@ -17,7 +17,9 @@ import android.util.Log; -import com.crashlytics.android.Crashlytics; +import com.google.firebase.crashlytics.FirebaseCrashlytics; + +import org.jetbrains.annotations.Nullable; import timber.log.Timber; @@ -51,13 +53,13 @@ public CrashlyticsLogExceptionTree(int logPriority) { */ public CrashlyticsLogExceptionTree(int logPriority, LogExclusionStrategy logExclusionStrategy) { // Ensure crashlytics class is available, fail-fast if not available. - Crashlytics.class.getCanonicalName(); + FirebaseCrashlytics.class.getCanonicalName(); mLogPriority = logPriority; mLogExclusionStrategy = logExclusionStrategy != null ? logExclusionStrategy : NullLogExclusionStrategy.INSTANCE; } @Override - protected boolean isLoggable(int priority) { + protected boolean isLoggable(@Nullable String tag, int priority) { return priority >= mLogPriority; } @@ -68,10 +70,10 @@ protected void log(int priority, String tag, String message, Throwable t) { } if (t != null) { - Crashlytics.logException(t); + FirebaseCrashlytics.getInstance().recordException(t); } else { String formattedMessage = LogMessageHelper.format(priority, tag, message); - Crashlytics.logException(new StackTraceRecorder(formattedMessage)); + FirebaseCrashlytics.getInstance().recordException(new StackTraceRecorder(formattedMessage)); } } -} +} \ No newline at end of file diff --git a/lib/src/main/java/net/ypresto/timbertreeutils/CrashlyticsLogTree.java b/lib/src/main/java/net/ypresto/timbertreeutils/CrashlyticsLogTree.java index 7295ecb..f9e4606 100644 --- a/lib/src/main/java/net/ypresto/timbertreeutils/CrashlyticsLogTree.java +++ b/lib/src/main/java/net/ypresto/timbertreeutils/CrashlyticsLogTree.java @@ -17,7 +17,9 @@ import android.util.Log; -import com.crashlytics.android.Crashlytics; +import com.google.firebase.crashlytics.FirebaseCrashlytics; + +import org.jetbrains.annotations.Nullable; import timber.log.Timber; @@ -51,13 +53,13 @@ public CrashlyticsLogTree(int logPriority) { */ public CrashlyticsLogTree(int logPriority, LogExclusionStrategy logExclusionStrategy) { // Ensure crashlytics class is available, fail-fast if not available. - Crashlytics.class.getCanonicalName(); + FirebaseCrashlytics.class.getCanonicalName(); mLogPriority = logPriority; mLogExclusionStrategy = logExclusionStrategy != null ? logExclusionStrategy : NullLogExclusionStrategy.INSTANCE; } @Override - protected boolean isLoggable(int priority) { + protected boolean isLoggable(@Nullable String tag, int priority) { return priority >= mLogPriority; } @@ -68,6 +70,6 @@ protected void log(int priority, String tag, String message, Throwable t) { } String formattedMessage = LogMessageHelper.format(priority, tag, message); - Crashlytics.log(formattedMessage); + FirebaseCrashlytics.getInstance().log(formattedMessage); } -} +} \ No newline at end of file