diff --git a/app/build.gradle b/app/build.gradle index 44171f13..cf198a62 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -8,11 +8,9 @@ apply from: '../jacoco.gradle' buildscript { //for crashlytics repositories { - } dependencies { - } } @@ -40,11 +38,14 @@ android { defaultConfig { applicationId "com.github.fo2rist.mclaren" + targetSdkVersion project.TARGET_SDK_VERSION minSdkVersion project.MIN_SDK_VERSION versionCode project.APP_VERSION_CODE versionName project.APP_VERSION_NAME + vectorDrawables.useSupportLibrary = true + testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" } @@ -137,6 +138,7 @@ dependencies { // event bus implementation 'org.greenrobot:eventbus:3.2.0' + kapt 'org.greenrobot:eventbus-annotation-processor:3.2.0' // for compile time discovery // joda time implementation 'joda-time:joda-time:2.10.3' @@ -178,6 +180,12 @@ dependencies { androidTestImplementation 'com.nhaarman.mockitokotlin2:mockito-kotlin:2.2.0' } +kapt { + arguments { + arg('eventBusIndex', 'com.github.fo2rist.mclaren.AutogeneratedEventBusIndex') + } +} + /** * Load bunc of properties from file. * @return {@link Properties} diff --git a/app/src/main/java/com/github/fo2rist/mclaren/repository/RepositoryEventBusImpl.kt b/app/src/main/java/com/github/fo2rist/mclaren/repository/RepositoryEventBusImpl.kt index cfeb65de..b9f6875a 100644 --- a/app/src/main/java/com/github/fo2rist/mclaren/repository/RepositoryEventBusImpl.kt +++ b/app/src/main/java/com/github/fo2rist/mclaren/repository/RepositoryEventBusImpl.kt @@ -13,6 +13,12 @@ import javax.inject.Singleton @Singleton class RepositoryEventBusImpl @Inject constructor() : FeedRepositoryEventBus, TransmissionRepositoryEventBus { + init { + EventBus.builder() + .addIndex(com.github.fo2rist.mclaren.AutogeneratedEventBusIndex()) + .build() + } + override fun subscribe(subscriber: Any) = EventBus.getDefault().register(subscriber) override fun unsubscribe(subscriber: Any) = EventBus.getDefault().unregister(subscriber)