From 93eb45ede8600a9495a44a0f4009aad9e9fb572f Mon Sep 17 00:00:00 2001 From: Bedoy Date: Sat, 20 Jan 2018 00:14:53 -0600 Subject: [PATCH] Added missing kotlin docs. I think also needs to be include here, just I copy from http://greenrobot.org/eventbus/documentation/subscriber-index/#Using_kapt --- README.md | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 3eb738c6..815b6d62 100644 --- a/README.md +++ b/README.md @@ -64,7 +64,24 @@ Add EventBus to your project Via Gradle: ```gradle -compile 'org.greenrobot:eventbus:3.1.1' +implementation 'org.greenrobot:eventbus:3.1.1' +annotationProcessor 'org.greenrobot:eventbus-annotation-processor:3.1.1' +``` +If you want to use EventBus within Kotlin code, you need to use kapt instead of annotationProcessor : + +```gradle +apply plugin: 'kotlin-kapt' // ensure kapt plugin is applied + +dependencies { + compile 'org.greenrobot:eventbus:3.1.1' + kapt 'org.greenrobot:eventbus-annotation-processor:3.1.1' +} + +kapt { + arguments { + arg('eventBusIndex', 'com.example.myapp.MyEventBusIndex') + } +} ``` Via Maven: