com.android.builder.model
Interface Variant


public interface Variant

A build Variant. This is the combination of a Build Type and 0+ Product Flavors (exactly one for each existing Flavor Dimension). Build Types and Flavors both contribute source folders, so this Variant is the direct representation of a set of source folders (and configuration parameters) used to build something. However the output of a Variant is not a single item. First there can be several artifacts. - Main Artifact: this is the main Android output(s). The app or the library being generated. - Extra Android Artifacts: these are ancillary artifacts, most likely test app(s). - Extra Java artifacts: these are pure-Java ancillary artifacts (junit support for instance).


Method Summary
 java.lang.String getBuildType()
          Returns the build type.
 java.lang.String getDisplayName()
          Returns a display name for the variant.
 java.util.Collection<AndroidArtifact> getExtraAndroidArtifacts()
           
 java.util.Collection<JavaArtifact> getExtraJavaArtifacts()
           
 AndroidArtifact getMainArtifact()
          Returns the main artifact for this variant.
 ProductFlavor getMergedFlavor()
          The result of the merge of all the flavors and of the main default config.
 java.lang.String getName()
          Returns the name of the variant.
 java.util.List<java.lang.String> getProductFlavors()
          Returns the flavors for this variants.
 

Method Detail

getName

@NonNull
java.lang.String getName()
Returns the name of the variant. It is made up of the build type and flavors (if applicable)

Returns:
the name of the variant.

getDisplayName

@NonNull
java.lang.String getDisplayName()
Returns a display name for the variant. It is made up of the build type and flavors (if applicable)

Returns:
the name.

getMainArtifact

@NonNull
AndroidArtifact getMainArtifact()
Returns the main artifact for this variant.

Returns:
the artifact.

getExtraAndroidArtifacts

@NonNull
java.util.Collection<AndroidArtifact> getExtraAndroidArtifacts()

getExtraJavaArtifacts

@NonNull
java.util.Collection<JavaArtifact> getExtraJavaArtifacts()

getBuildType

@NonNull
java.lang.String getBuildType()
Returns the build type. All variants have a build type, so this is never null.

Returns:
the name of the build type.

getProductFlavors

@NonNull
java.util.List<java.lang.String> getProductFlavors()
Returns the flavors for this variants. This can be empty if no flavors are configured.

Returns:
a list of flavors which can be empty.

getMergedFlavor

@NonNull
ProductFlavor getMergedFlavor()
The result of the merge of all the flavors and of the main default config. If no flavors are defined then this is the same as the default config. This is directly a ProductFlavor instance of a ProductFlavorContainer since this a composite of existing ProductFlavors.

Returns:
the merged flavors.
See Also:
AndroidProject.getDefaultConfig()