Yes you can access the outputs from the script. Look at the densitySplit
sample we upload. It has a section which does this:
// map for the version code
ext.versionCodes = [all:1, mdpi:2, hdpi:3, xhdpi:4, xxhdpi:5]
android.applicationVariants.all { variant ->
// assign different version code for each output
variant.outputs.each { output ->
def key = output.densityFilter == null ? "all" : output.densityFilter
output.versionCodeOverride = project.ext.versionCodes.get(key) * 100 +
android.defaultConfig.versionCode
}
}
On Wed, Oct 1, 2014 at 11:11 PM, Tomáš Procházka <[email protected]>
wrote:
> Before plugin version 0.13 has variant directly outputFile property.
> Now every variant has several outpus and Output has outputFile.
> This is logical, because of split apks
>
> According source code of the gradle plugin I found, that since version
> 0.13 .
> Every variant has "outputs" properties which represent splited APKs
> output is defined by class *ApkVariantOutputImpl*, but it has not
> identifier which contain split type like hdpi,xhdpi.
> I found that *BaseVariantOutputImpl* which is parent of
> *ApkVariantOutputImpl* has also property called o*utputFiles* which
> return *ApkOutput* class which contain property s*plitIdentifier*. But
> why another level. And outputFiles is not accessible from the gradle
> script, so it is probably internal implementation. So where I can access s
> *plitIdentifier?*
>
> 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.