forked from androidannotations/androidannotations
-
Notifications
You must be signed in to change notification settings - Fork 0
Building Project Gradle
Heath Borders edited this page Jan 31, 2014
·
6 revisions
You can use the android-apt Gradle plugin to launch AndroidAnnotation processing. A quick example of how to use it is included below. A full example project with a library project that also uses Android Annotations exists as well.
buildscript {
repositories {
mavenCentral()
}
dependencies {
// replace with the current version of the Android plugin
classpath 'com.android.tools.build:gradle:0.7.3+'
// the latest version of the android-apt plugin
classpath 'com.neenbedankt.gradle.plugins:android-apt:1.2+'
}
}
apply plugin: 'android'
apply plugin: 'android-apt'
repositories {
mavenCentral()
}
android {
compileSdkVersion 19
buildToolsVersion "19.0.1"
defaultConfig {
minSdkVersion 15
targetSdkVersion 19
versionCode 1
versionName "1.0"
}
buildTypes {
release {
runProguard false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
}
}
}
apt {
arguments {
androidManifestFile variant.processResources.manifestFile
// If you're using Android NBS flavors you should use the following line instead of hard-coded packageName
//resourcePackageName android.defaultConfig.packageName
resourcePackageName "com.example.your.package.name"
// You can set optional annotation processing options here, like these commented options:
// logLevel 'INFO'
// logFile '/var/log/aa.log'
}
}
dependencies {
apt "org.androidannotations:androidannotations:3.0+"
compile "org.androidannotations:androidannotations-api:3.0+"
}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.
AndroidAnnotations was created by Pierre-Yves Ricau and is sponsored by eBusinessInformations.
04/03/2013 The 2.7.1 release is out
- Get started!
- Download
- Cookbook, full of recipes
- Customize annotation processing
- List of all available annotations
- Release Notes
- Examples
- Read the FAQ
- Join the Mailing list
- Create an issue
- Tag on Stack Overflow