imagine some proyect like this one that use android-annotations and for this work i have to put this in build.gradle
apt {
arguments {
resourcePackageName "com.pandaos.smartconfig"
androidManifestFile variant.outputs[0].processResources.manifestFile
}
}
where: resourcePackageName "com.pandaos.smartconfig"
its the path where code its annotated... the config for plugin android-apt
apply plugin: 'com.neenbedankt.android-apt'
I suppose, that plugin "invoke" some task to generate the code that android-annotations create under the hood, but...
Its possible define multiple "packages in the app"?
The
resourcePackageName
comes from the configuration option for AndroidAnnotations as mentioned here:There are two things to note:
The option refers to the Android package name, which does not have to be the same as your java package name.
The
R
package name can be different from the Android package name you set inAndroidManifest.xml
if you use theapplicationId
option in the Gradle build file.It's totally fine to have a different java package name in your code. AFAIK this will not influence AndroidAnnotations in any way.
The
apt
block is provided by theandroid-apt
plugin and allows you to configure any parameter to annotation processors in your project. In this case it configures the parameters that AndroidAnnotations need to do its job. Theandroid-apt
plugin serves two purposes in this case: it configures the parameters for the AndroidAnnotations processor, and it will make sure you can reference the sources that are generated by AA in Android Studio.