From 2ffa42e52fced2a266712613de93de197325c1f1 Mon Sep 17 00:00:00 2001 From: Frieder Bluemle Date: Sun, 12 Feb 2017 23:23:21 +0800 Subject: [PATCH] Replace android-apt with annotationProcessor --- EventBusPerformance/build.gradle | 26 +++++++++++------------ EventBusTest/build.gradle | 36 ++++++++++++++------------------ 2 files changed, 28 insertions(+), 34 deletions(-) diff --git a/EventBusPerformance/build.gradle b/EventBusPerformance/build.gradle index 3d2ec3e2..3a5eb0a4 100644 --- a/EventBusPerformance/build.gradle +++ b/EventBusPerformance/build.gradle @@ -5,33 +5,26 @@ buildscript { dependencies { classpath 'com.android.tools.build:gradle:2.3.0' - classpath 'com.neenbedankt.gradle.plugins:android-apt:1.8' } } apply plugin: 'com.android.application' -apply plugin: 'com.neenbedankt.android-apt' repositories { jcenter() } -dependencies { - compile project(':EventBus') - apt project(':EventBusAnnotationProcessor') - compile 'com.squareup:otto:1.3.8' -} - -apt { - arguments { - eventBusIndex "org.greenrobot.eventbusperf.MyEventBusIndex" - } -} - android { buildToolsVersion '25.0.2' // When updating, don't forget to adjust .travis.yml compileSdkVersion 19 + defaultConfig { + javaCompileOptions { + annotationProcessorOptions { + arguments = [eventBusIndex: "org.greenrobot.eventbusperf.MyEventBusIndex"] + } + } + } sourceSets { main { manifest.srcFile 'AndroidManifest.xml' @@ -39,5 +32,10 @@ android { res.srcDirs = ['res'] } } +} +dependencies { + compile project(':EventBus') + annotationProcessor project(':EventBusAnnotationProcessor') + compile 'com.squareup:otto:1.3.8' } diff --git a/EventBusTest/build.gradle b/EventBusTest/build.gradle index f24d9c07..3dcd5cf6 100644 --- a/EventBusTest/build.gradle +++ b/EventBusTest/build.gradle @@ -5,29 +5,29 @@ buildscript { dependencies { classpath 'com.android.tools.build:gradle:2.3.0' - classpath 'com.neenbedankt.gradle.plugins:android-apt:1.8' } } apply plugin: 'com.android.application' -apply plugin: 'com.neenbedankt.android-apt' repositories { jcenter() } -dependencies { - androidTestApt project(':EventBusAnnotationProcessor') - androidTestCompile project(':EventBus') - compile fileTree(dir: 'libs', include: '*.jar') - androidTestCompile 'com.android.support.test:runner:0.4.1' - androidTestCompile 'com.android.support.test:rules:0.4.1' -} - android { buildToolsVersion '25.0.2' // When updating, don't forget to adjust .travis.yml compileSdkVersion 19 + defaultConfig { + testApplicationId "de.greenrobot.event.test" + testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" + javaCompileOptions { + annotationProcessorOptions { + arguments = [eventBusIndex: "org.greenrobot.eventbus.EventBusTestsIndex"] + } + } + } + sourceSets { main { manifest.srcFile 'AndroidManifest.xml' @@ -37,16 +37,12 @@ android { java.srcDirs = ['src'] } } - - defaultConfig { - testApplicationId "de.greenrobot.event.test" - testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" - } } -apt { - arguments { - eventBusIndex "org.greenrobot.eventbus.EventBusTestsIndex" - } +dependencies { + androidTestAnnotationProcessor project(':EventBusAnnotationProcessor') + androidTestCompile project(':EventBus') + compile fileTree(dir: 'libs', include: '*.jar') + androidTestCompile 'com.android.support.test:runner:0.4.1' + androidTestCompile 'com.android.support.test:rules:0.4.1' } -