Makes sources generated by annotation processors visible in Android Studio.
Just apply the plugin and use provided
configuration for annotation processor dependencies.
Note that Android Lint may fail with 'InvalidPackage' for annotation processor dependencies.
You can safely ignore this failure since dependencies of provided
configuration are not packaged to APK.
Example:
buildscript {
repositories {
mavenCentral()
}
dependencies {
// replace with the current version of the Android plugin
classpath 'com.android.tools.build:gradle:0.13.3'
// use the latest version of this plugin
classpath 'com.stanfy.android:gradle-android-apt:1.0.0'
}
}
apply plugin: 'com.android.application'
apply plugin: 'com.stanfy.android.apt'
dependencies {
provided 'com.squareup.dagger:dagger-compiler:1.1.0'
compile 'com.squareup.dagger:dagger:1.1.0'
}
Plugin is very similar to Hugo Visser's android-apt
. But it
does not introduce a separate configuration and lacks processor parameters support.
Copyright 2014 Stanfy Corp.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.