Use annotation processor for EventBus

This commit is contained in:
ByteHamster 2019-05-28 17:26:09 +02:00
parent 83a6d70387
commit ce8adc4b26
3 changed files with 20 additions and 0 deletions

View File

@ -24,6 +24,12 @@ android {
testApplicationId "de.test.antennapod" testApplicationId "de.test.antennapod"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
generatedDensities = [] generatedDensities = []
javaCompileOptions {
annotationProcessorOptions {
arguments = [ eventBusIndex : 'de.danoeh.antennapod.ApEventBusIndex' ]
}
}
} }
signingConfigs { signingConfigs {
@ -145,6 +151,7 @@ dependencies {
implementation "com.squareup.okhttp3:okhttp-urlconnection:$okhttpVersion" implementation "com.squareup.okhttp3:okhttp-urlconnection:$okhttpVersion"
implementation "com.squareup.okio:okio:$okioVersion" implementation "com.squareup.okio:okio:$okioVersion"
implementation "org.greenrobot:eventbus:$eventbusVersion" implementation "org.greenrobot:eventbus:$eventbusVersion"
annotationProcessor "org.greenrobot:eventbus-annotation-processor:$eventbusVersion"
implementation "io.reactivex.rxjava2:rxandroid:$rxAndroidVersion" implementation "io.reactivex.rxjava2:rxandroid:$rxAndroidVersion"
implementation "io.reactivex.rxjava2:rxjava:$rxJavaVersion" implementation "io.reactivex.rxjava2:rxjava:$rxJavaVersion"

View File

@ -8,9 +8,11 @@ import com.joanzapata.iconify.Iconify;
import com.joanzapata.iconify.fonts.FontAwesomeModule; import com.joanzapata.iconify.fonts.FontAwesomeModule;
import com.joanzapata.iconify.fonts.MaterialModule; import com.joanzapata.iconify.fonts.MaterialModule;
import de.danoeh.antennapod.core.ApCoreEventBusIndex;
import de.danoeh.antennapod.core.ClientConfig; import de.danoeh.antennapod.core.ClientConfig;
import de.danoeh.antennapod.core.feed.EventDistributor; import de.danoeh.antennapod.core.feed.EventDistributor;
import de.danoeh.antennapod.spa.SPAUtil; import de.danoeh.antennapod.spa.SPAUtil;
import org.greenrobot.eventbus.EventBus;
/** Main application class. */ /** Main application class. */
public class PodcastApp extends Application { public class PodcastApp extends Application {
@ -58,6 +60,10 @@ public class PodcastApp extends Application {
Iconify.with(new MaterialModule()); Iconify.with(new MaterialModule());
SPAUtil.sendSPAppsQueryFeedsIntent(this); SPAUtil.sendSPAppsQueryFeedsIntent(this);
EventBus.builder()
.addIndex(new ApEventBusIndex())
.addIndex(new ApCoreEventBusIndex())
.installDefaultEventBus();
} }
} }

View File

@ -10,6 +10,12 @@ android {
versionName "1.0" versionName "1.0"
testApplicationId "de.danoeh.antennapod.core.tests" testApplicationId "de.danoeh.antennapod.core.tests"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
javaCompileOptions {
annotationProcessorOptions {
arguments = [ eventBusIndex : 'de.danoeh.antennapod.core.ApCoreEventBusIndex' ]
}
}
} }
buildTypes { buildTypes {
release { release {
@ -59,6 +65,7 @@ dependencies {
implementation "com.squareup.okhttp3:okhttp-urlconnection:$okhttpVersion" implementation "com.squareup.okhttp3:okhttp-urlconnection:$okhttpVersion"
implementation "com.squareup.okio:okio:$okioVersion" implementation "com.squareup.okio:okio:$okioVersion"
implementation "org.greenrobot:eventbus:$eventbusVersion" implementation "org.greenrobot:eventbus:$eventbusVersion"
annotationProcessor "org.greenrobot:eventbus-annotation-processor:$eventbusVersion"
implementation "io.reactivex.rxjava2:rxandroid:$rxAndroidVersion" implementation "io.reactivex.rxjava2:rxandroid:$rxAndroidVersion"
implementation "io.reactivex.rxjava2:rxjava:$rxJavaVersion" implementation "io.reactivex.rxjava2:rxjava:$rxJavaVersion"
implementation "org.awaitility:awaitility:$awaitilityVersion" implementation "org.awaitility:awaitility:$awaitilityVersion"