user user - 4 days ago 4
Groovy Question

What is applicationVariant.outputs?

Android

build.gradle
directives often have parts like

applicationVariants.all { variant ->
variant.outputs.each { output ->
// do something to output
}
}


The
variant.outputs
is puzzling. It seems to work, but the
outputs
property is neither visible in the code nor in the plugin user guide or the gradle index.

How do I know the properties in applicationVariants of android gradle plugin? asks about
ApplicationVariant
in general, but neither the question's nor the answer's links seems to contain the
outputs
property.

Where is
outputs
specified/described?

Answer

It should be BaseVariant.getOutputs() and implement at BaseVariantImpl.

The code you check is probably at a very old version that outputs has not be added.

Comments