Skip to content
This repository has been archived by the owner on Aug 19, 2023. It is now read-only.

Commit

Permalink
Dependency updates.
Browse files Browse the repository at this point in the history
  • Loading branch information
d4rken committed Oct 18, 2020
1 parent 5d52463 commit 4ec1fc8
Show file tree
Hide file tree
Showing 11 changed files with 97 additions and 100 deletions.
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,6 @@
.idea
*.iml
.gradle
local.properties
local.properties
/fastlane/report.xml
*.apk
78 changes: 39 additions & 39 deletions app/build.gradle
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
apply plugin: 'com.android.application'
apply plugin: "kotlin-kapt"
apply plugin: "com.bugsnag.android.gradle"
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions'
apply plugin: 'com.bugsnag.android.gradle'
apply plugin: "kotlin-kapt"

def gitSha = 'git rev-parse --short HEAD'.execute([], project.rootDir).text.trim()
def buildTime = new Date().format("yyyy-MM-dd'T'HH:mm:ss'Z'", TimeZone.getTimeZone("GMT+1"))

bugsnag {
overwrite true
overwrite = true
}

android {
Expand All @@ -32,7 +32,10 @@ android {

Properties bugsnagProps = new Properties()
def bugsnagPropsFile = new File(System.properties['user.home'], ".appconfig/${packageName}/bugsnag.properties")
if (bugsnagPropsFile.canRead()) bugsnagProps.load(new FileInputStream(bugsnagPropsFile))
if (bugsnagPropsFile.canRead()) {
println("Reading $bugsnagPropsFile")
bugsnagProps.load(new FileInputStream(bugsnagPropsFile))
}

defaultConfig {
applicationId "${packageName}"
Expand All @@ -48,7 +51,7 @@ android {

testInstrumentationRunner "${packageName}.ExampleTestRunner"

manifestPlaceholders = [apikey_bugsnag: ""]
manifestPlaceholders = [apikey_bugsnag: bugsnagProps.getProperty("bugsnag.apikey", "")]

vectorDrawables.useSupportLibrary = true
}
Expand All @@ -58,13 +61,15 @@ android {
}
buildTypes {
debug {

ext.enableBugsnag = false
}
release {
if (signingConfigs.hasProperty('release')) signingConfig signingConfigs.release
minifyEnabled false

ext.enableBugsnag = true

proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
manifestPlaceholders = [apikey_bugsnag: bugsnagProps.getProperty("bugsnag.apikey", "")]
}
applicationVariants.all { variant ->
if (variant.buildType.name == "debug") {
Expand All @@ -83,26 +88,21 @@ android {
}
}

android {
configurations.all {
resolutionStrategy.force 'com.google.code.findbugs:jsr305:3.0.2'
resolutionStrategy.force "com.android.support:animated-vector-drawable:${versions.supportLibrary}"
resolutionStrategy.force "com.android.support:preference-v7:${versions.supportLibrary}"
}
}
dependencies {
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$versions.kotlin"
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:1.4.0"

// Support libs
implementation 'androidx.annotation:annotation:1.0.2'
implementation 'androidx.appcompat:appcompat:1.0.2'
implementation 'androidx.preference:preference:1.0.0'
implementation 'com.google.android.material:material:1.0.0'
implementation 'androidx.browser:browser:1.0.0'
implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
implementation 'androidx.annotation:annotation:1.1.0'
implementation 'androidx.appcompat:appcompat:1.2.0'
implementation 'androidx.preference:preference:1.1.1'
implementation 'com.google.android.material:material:1.2.1'
implementation 'androidx.browser:browser:1.2.0'
implementation 'androidx.constraintlayout:constraintlayout:2.0.2'

// Crashtracking
implementation 'com.bugsnag:bugsnag-android:4.10.0'
implementation ('com.bugsnag:bugsnag-android:5.2.1') {
exclude group: 'com.bugsnag', module: 'bugsnag-plugin-android-ndk'
}

// IAPs
implementation 'com.android.billingclient:billing:1.2.2'
Expand All @@ -111,40 +111,40 @@ dependencies {
implementation 'eu.darken.mvpbakery:library:0.7.1'

// RX
implementation "io.reactivex.rxjava2:rxjava:${versions.rxjava}"
implementation "io.reactivex.rxjava2:rxandroid:${versions.rxandroid}"
implementation "io.reactivex.rxjava2:rxjava:2.2.17"
implementation "io.reactivex.rxjava2:rxandroid:2.1.1"

//Dagger
kapt "com.google.dagger:dagger-compiler:${versions.dagger}"
implementation "com.google.dagger:dagger:${versions.dagger}"
implementation "com.google.dagger:dagger-android:${versions.dagger}"
implementation "com.google.dagger:dagger-android-support:${versions.dagger}"
kapt "com.google.dagger:dagger-compiler:2.22.1"
implementation "com.google.dagger:dagger:2.22.1"
implementation "com.google.dagger:dagger-android:2.22.1"
implementation "com.google.dagger:dagger-android-support:2.22.1"

//Butterknife
implementation "com.jakewharton:butterknife:${versions.butterknife}"
kapt "com.jakewharton:butterknife-compiler:${versions.butterknife}"
implementation "com.jakewharton:butterknife:10.2.1"
kapt "com.jakewharton:butterknife-compiler:10.2.1"

//Timber
implementation "com.jakewharton.timber:timber:4.7.1"

implementation 'com.github.tbruyelle:rxpermissions:0.10.2'

// Testing
testImplementation "junit:junit:4.12"
testImplementation "org.mockito:mockito-core:2.24.5"
testImplementation "junit:junit:4.13"
testImplementation "org.mockito:mockito-core:3.0.0"
testImplementation 'com.nhaarman.mockitokotlin2:mockito-kotlin:2.1.0'
testImplementation 'com.github.tmurakami:dexopener:1.0.2'

androidTestImplementation "org.mockito:mockito-core:2.24.5"
androidTestImplementation "org.mockito:mockito-core:3.0.0"
androidTestImplementation 'org.mockito:mockito-android:2.23.0'
androidTestImplementation 'com.github.tmurakami:dexopener:1.0.2'

androidTestImplementation 'androidx.test:runner:1.1.1'
androidTestImplementation 'androidx.test:rules:1.1.1'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.1.1'
androidTestImplementation 'androidx.test.espresso:espresso-contrib:3.1.1'
androidTestImplementation 'androidx.test.espresso:espresso-intents:3.1.1'
androidTestImplementation 'androidx.test.espresso.idling:idling-concurrent:3.1.1'
androidTestImplementation 'androidx.test:runner:1.2.0'
androidTestImplementation 'androidx.test:rules:1.2.0'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
androidTestImplementation 'androidx.test.espresso:espresso-contrib:3.2.0'
androidTestImplementation 'androidx.test.espresso:espresso-intents:3.2.0'
androidTestImplementation 'androidx.test.espresso.idling:idling-concurrent:3.2.0'
}

kotlin {
Expand Down
17 changes: 13 additions & 4 deletions app/src/main/java/eu/thedarken/wldonate/App.kt
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import android.content.BroadcastReceiver
import android.content.Intent
import androidx.appcompat.app.AppCompatDelegate
import com.bugsnag.android.Bugsnag
import com.bugsnag.android.Configuration
import eu.darken.mvpbakery.injection.ComponentSource
import eu.darken.mvpbakery.injection.ManualInjector
import eu.darken.mvpbakery.injection.activity.HasManualActivityInjector
Expand All @@ -29,9 +30,11 @@ open class App : Application(), HasManualActivityInjector, HasManualBroadcastRec
@Inject lateinit var appComponent: AppComponent
@Inject lateinit var receiverInjector: ComponentSource<BroadcastReceiver>
@Inject lateinit var serviceInjector: ComponentSource<Service>

// No touchy! Needs to be initialized such that they sub to the lock-controller.
@Suppress("unused")
@Inject lateinit var serviceController: ServiceController

@Suppress("unused")
@Inject lateinit var widgetController: WidgetController

Expand All @@ -51,10 +54,16 @@ open class App : Application(), HasManualActivityInjector, HasManualBroadcastRec
.build()
.injectMembers(this)

val bugsnagClient = Bugsnag.init(this)
bugsnagClient.setUserId(uuidToken.id())
bugsnagClient.beforeNotify(BugsnagErrorHandler(settings, bugsnagTree))
Timber.i("Bugsnag setup done!")
Configuration.load(this)
.apply {
setUser(uuidToken.id(), null, null)
autoTrackSessions = true
addOnError(BugsnagErrorHandler(settings, bugsnagTree))
}
.also {
Bugsnag.start(this, it)
Timber.i("Bugsnag setup done!")
}

val originalHandler = Thread.getDefaultUncaughtExceptionHandler()
Thread.setDefaultUncaughtExceptionHandler { thread, error ->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ abstract class SmartFragment : androidx.fragment.app.Fragment() {
unbinders.add(unbinder)
}

override fun onAttach(context: Context?) {
override fun onAttach(context: Context) {
Timber.tag(tag).v("onAttach(context=$context)")
super.onAttach(context)
}
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
package eu.thedarken.wldonate.common.timber

import com.bugsnag.android.Event
import com.bugsnag.android.OnErrorCallback
import eu.thedarken.wldonate.BuildConfig
import eu.thedarken.wldonate.main.core.GeneralSettings

class BugsnagErrorHandler(
private val settings: GeneralSettings,
private val bugsnagTree: BugsnagTree
) : OnErrorCallback {

override fun onError(event: Event): Boolean {
if (!settings.isBugTrackingEnabled()) return false
bugsnagTree.injectLog(event)
event.addMetadata(TAB_APP, "gitSha", BuildConfig.GITSHA)
event.addMetadata(TAB_APP, "buildTime", BuildConfig.BUILDTIME)
return !BuildConfig.DEBUG
}

companion object {
private const val TAB_APP = "app"

}

}
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package eu.thedarken.wldonate.common.timber

import android.util.Log
import com.bugsnag.android.Event
import timber.log.Timber
import java.util.*

Expand All @@ -21,11 +22,11 @@ class BugsnagTree : Timber.Tree() {
}
}

fun update(error: com.bugsnag.android.Error) {
fun injectLog(event: Event) {
synchronized(buffer) {
var i = 1
for (message in buffer) error.addToTab("Log", String.format(Locale.US, "%03d", i++), message)
error.addToTab("Log", String.format(Locale.US, "%03d", i), Log.getStackTraceString(error.exception))
for (message in buffer) event.addMetadata("Log", String.format(Locale.US, "%03d", i++), message)
event.addMetadata("Log", String.format(Locale.US, "%03d", i), Log.getStackTraceString(event.originalError))
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ class Navigator @Inject constructor(
Timber.d("Fragment already added: %s", fragmentClazz)
return
}
val newFragment = androidx.fragment.app.Fragment.instantiate(mainActivity, fragmentClazz.name)
val newFragment = androidx.fragment.app.Fragment.instantiate(mainActivity!!, fragmentClazz.name)
val trans = fm.beginTransaction()
trans.replace(R.id.content_frame, newFragment)
if (backstack) trans.addToBackStack(null)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ class SettingsFragment : PreferenceFragmentCompat(), SettingsFragmentPresenter.V
super.onActivityCreated(savedInstanceState)
rxPermissions = RxPermissions(this)

(findPreference("core.autostart.call") as CheckBoxPreference).onPreferenceChangeListener = Preference.OnPreferenceChangeListener { pref: Preference?, newValue: Any? ->
(findPreference<CheckBoxPreference>("core.autostart.call") as CheckBoxPreference).onPreferenceChangeListener = Preference.OnPreferenceChangeListener { pref: Preference?, newValue: Any? ->
rxPermissions
.request(Manifest.permission.READ_PHONE_STATE)
.subscribe { granted ->
Expand All @@ -48,6 +48,6 @@ class SettingsFragment : PreferenceFragmentCompat(), SettingsFragmentPresenter.V
}

override fun updateVersion(version: String) {
findPreference("core.version").summary = version
findPreference<Preference>("core.version")?.summary = version
}
}
23 changes: 6 additions & 17 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
buildscript {
ext.buildConfig = [
'compileSdk': 28,
'compileSdk': 30,
'minSdk' : 16,
'targetSdk' : 28,
'buildtools': '28.0.3',
'targetSdk' : 30,

'version' : [
'major': 3,
'minor': 2,
'minor': 3,
'patch': 0,
'build': 0,
],
Expand All @@ -17,24 +16,14 @@ buildscript {
ext.buildConfig.version['fullName'] = "${buildConfig.version.name}.${buildConfig.version.build}"
ext.buildConfig.version['code'] = buildConfig.version.major * 1000000 + buildConfig.version.minor * 10000 + buildConfig.version.patch * 100 + buildConfig.version.build

ext.versions = [
'kotlin' : '1.3.31',
'kotlinCoroutines' : '1.1.1',
'kotlinSerialization': '0.10.0',
'dagger' : '2.22.1',
'butterknife' : '10.1.0',
'rxjava' : '2.2.6',
'rxandroid' : '2.1.0',
]

repositories {
google()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.4.1'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$versions.kotlin"
classpath 'com.bugsnag:bugsnag-android-gradle-plugin:3.6.0'
classpath 'com.android.tools.build:gradle:4.1.0'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:1.4.0"
classpath 'com.bugsnag:bugsnag-android-gradle-plugin:5.3.0'
}
}

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 @@
#Sat May 18 23:07:23 CEST 2019
#Sat Oct 17 23:56:52 CEST 2020
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-5.1.1-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-6.5-all.zip

0 comments on commit 4ec1fc8

Please sign in to comment.