processResources.sourceOutputDir will give you the source folder, but it's
up to you to figure out the package name. This is based exclusively on the
content of the main manifest package attribute (it's the same for all
variants). From the package name you can figure out the package folder and
get the final path to the file.



On Wed, Feb 4, 2015 at 8:53 AM, Hannes Dorfmann <[email protected]>
wrote:

> Is there a way to get the Path to the generated R.java file in gradle?
> Im writing an Annotation Processor where I would like to access the R.java
> file, so I would like to pass path to R.java file as Parameter to my
> annotation processor.
>
> It should take the R.java file of the current build type (if there a more
> variants / flavors).
>
> For instance by using android-apt plugin I would like to pass the R.java
> file as follows:
>
> apt {
>  arguments {
>     androidResourceDir variant.outputs.processResources.resDir
>     androidResourceFile ???
>  }
> }
>
>
>  --
> You received this message because you are subscribed to the Google Groups
> "adt-dev" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> For more options, visit https://groups.google.com/d/optout.
>



-- 
Xavier Ducrohet
Android SDK Tech Lead
Google Inc.
http://developer.android.com | http://tools.android.com

Please do not send me questions directly. Thanks!

-- 
You received this message because you are subscribed to the Google Groups 
"adt-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to