That's a fair use case. I filed
https://code.google.com/p/android/issues/detail?id=69746
As a workaround you could loop on the variants instead and access the task
there:
android.applicationVariants.all { variant ->
task processRes = variant.processResources
}
On Fri, May 16, 2014 at 3:43 PM, Jan Lorenz Soliman <[email protected]>wrote:
> I'd like to change the source output directory of ProcressAndroidResources
> tasks to a path based on its variant name.
>
> Something like:
>
> project.tasks.withType(ProcessAndroidResources) {
> it.sourceOutputDir = file("sources/r/${it.variant.name}")
> }
>
>
> On Friday, May 16, 2014 11:28:58 AM UTC-7, Xavier Ducrohet wrote:
>
>> No, why do you need this?
>>
>> Note that the variant object that you had access to was an internal
>> object and not the same one that's available through
>> android.applicationVariants. Relying on this internal API is a good way to
>> be broken when you move to a new plugin.
>>
>> Also note that you are looking at the old repo that we haven't touched
>> for months. The new one is https://android.googlesource.com/platform/
>> tools/base/+/master
>>
>>
>> On Thu, May 15, 2014 at 11:03 PM, Jan Lorenz Soliman <[email protected]>wrote:
>>
>>> It looks like the variant property was removed from the BaseTask class
>>> in Gradle plugin 0.10.0.
>>>
>>> Sources:
>>> http://repo1.maven.org/maven2/com/android/tools/build/
>>> gradle/0.10.0/gradle-0.10.0-sources.jar
>>>
>>> In version 0.9.0 I could do this:
>>>
>>> project.tasks.withType(ProcessAndroidResources) {
>>> println it.variant.name
>>> }
>>>
>>> However variant is not longer exists as a property of BaseTask in
>>> 0.10.0. I looked at the source in master, but it does not look like it has
>>> the changes from 0.10.0.
>>>
>>> https://android.googlesource.com/platform/tools/build/+/
>>> master/gradle/src/main/groovy/com/android/build/gradle/
>>> internal/tasks/BaseTask.groovy
>>>
>>> Is there another way to access the variant from a given task?
>>>
>>>
>>>
>>>
>>> --
>>> 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.
>
--
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.