Gradle and AndroidAnnotations -
i have written build.gradle file android app. app uses androidannotations.
apply plugin: 'com.android.application' apply plugin: 'android-apt' def aaversion = '3.3.2' buildscript { repositories { jcenter() mavencentral() mavenlocal() } dependencies { classpath 'com.android.tools.build:gradle:1.1.3' classpath 'com.neenbedankt.gradle.plugins:android-apt:1.8' classpath 'org.androidannotations:androidannotations:3.3.2' } } configurations { apt } apt { arguments { androidmanifestfile variant.outputs[0].processresources.manifestfile resourcepackagename "de.xxx" } } android { compilesdkversion 'google inc.:google apis:23' buildtoolsversion "22.0.1" defaultconfig { applicationid "de.xxx" minsdkversion 11 targetsdkversion 23 } buildtypes { release { minifyenabled true proguardfiles 'proguard.cfg' } } } repositories { jcenter() mavencentral() mavenlocal() } dependencies { apt "org.androidannotations:androidannotations:$aaversion" compile "org.androidannotations:androidannotations-api:$aaversion" compile 'com.actionbarsherlock:actionbarsherlock:4.4.0@aar' compile 'com.android.support:support-v4:23.1.1' compile files('libs/acra-4.3.0.jar') }
the script apt profecessing , generates annotation_ classes. afterwards script fails compilation of import-statements , usages of classes
import com.googlecode.androidannotations.annotations.afterviews; import com.googlecode.androidannotations.annotations.efragment; import com.googlecode.androidannotations.annotations.viewbyid;
whats wrong script? know there room improvement.
use build.gradle :
apply plugin: 'com.android.application' apply plugin: 'com.neenbedankt.android-apt' def aaversion = '3.3.2' buildscript { repositories { jcenter() mavencentral() mavenlocal() } dependencies { classpath 'com.android.tools.build:gradle:1.5.0' classpath 'com.neenbedankt.gradle.plugins:android-apt:1.8' } } apt { arguments { androidmanifestfile variant.outputs[0]?.processresources?.manifestfile resourcepackagename "de.xxx" } } android { compilesdkversion 'google inc.:google apis:23' buildtoolsversion "22.0.1" defaultconfig { applicationid "de.xxx" minsdkversion 11 targetsdkversion 23 } buildtypes { release { minifyenabled true proguardfiles 'proguard.cfg' } } } repositories { jcenter() mavencentral() mavenlocal() } dependencies { apt "org.androidannotations:androidannotations:$aaversion" compile "org.androidannotations:androidannotations-api:$aaversion" compile 'com.actionbarsherlock:actionbarsherlock:4.4.0@aar' compile 'com.android.support:support-v4:23.1.1' compile files('libs/acra-4.3.0.jar') }
the example script can found in guide, or in sample project. change import statements like:
import org.androidannotations.annotations.afterviews;
Comments
Post a Comment