Skip to content

Building Project Gradle

Damien edited this page Dec 26, 2013 · 3 revisions

Annotation processor Gradle plugin

You can use the android-apt Gradle plugin to launch AndroidAnnotation processing. Here is a quick example of how to use it :

buildscript {
    repositories {
      mavenCentral()
    }
    dependencies {
        // replace with the current version of the Android plugin
        classpath 'com.android.tools.build:gradle:0.7+'
        // the latest version of the android-apt plugin
        classpath 'com.neenbedankt.gradle.plugins:android-apt:1.1'
    }
}

apply plugin: 'android'
apply plugin: 'android-apt'
def AAVersion = 'XXX'

dependencies {
    apt "org.androidannotations:androidannotations:$AAVersion"
    compile "org.androidannotations:androidannotations-api:$AAVersion"
}

apt {
    arguments {
        // you can set annotation processing options here
        logLevel TRACE
    }
}

AndroidAnnotations Gradle plugin

There is also a Gradle AndroidAnnotations Plugin to use AndroidAnnotations in Gradle project. This plugin generates output files based on annotations on compile; it also configures IDEA projects to use AndroidAnnotations.

Unfortunately this plugin seems to not be maintained anymore.

Instructions can be found in the plugin wiki.

Using AndroidAnnotations

Questions?

Enjoying AndroidAnnotations

Improving AndroidAnnotations

Clone this wiki locally