Stay organized with collections
Save and categorize content based on your preferences.
VariantInfo
interface VariantInfo
Information about the variant being built.
Only the Android Gradle Plugin should create instances of this interface.
Immutable, no access to tasks
Summary
Public methods
|
abstract String |
Returns the name of the build type.
|
abstract ImmutableList<String!> |
Returns a list of flavor names that make up this variant.
|
abstract String |
Returns the name of the variant.
|
abstract Boolean |
Returns true if the variant is debuggable
|
abstract Boolean |
Returns true if this is a test variant
|
Public methods
getBuildTypeName
@NonNull abstract fun getBuildTypeName(): String
Returns the name of the build type.
By convention, build-type settings should override flavor settings.
getFlavorNames
@NonNull abstract fun getFlavorNames(): ImmutableList<String!>
Returns a list of flavor names that make up this variant.
By convention settings from earlier flavors should override settings from later flavors.
Return |
ImmutableList<String!>: the ordered list of flavor names. May be empty. |
getFullVariantName
@NonNull abstract fun getFullVariantName(): String
Returns the name of the variant. This is composed of the build types and flavors
isDebuggable
abstract fun isDebuggable(): Boolean
Returns true if the variant is debuggable
isTest
abstract fun isTest(): Boolean
Returns true if this is a test variant
Content and code samples on this page are subject to the licenses described in the Content License. Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.
Last updated 2025-02-10 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-02-10 UTC."],[],[],null,["# VariantInfo\n===========\n\n```\ninterface VariantInfo\n```\n\n|------------------------------------------------|\n| [com.android.build.api.variant.VariantInfo](#) |\n\nInformation about the variant being built.\n\nOnly the Android Gradle Plugin should create instances of this interface.\n\nImmutable, no access to tasks\n\nSummary\n-------\n\n| ### Public methods ||\n|-------------------------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------|\n| abstract [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html) | [getBuildTypeName](#getBuildTypeName())`()` Returns the name of the build type. |\n| abstract ImmutableList\\\u003c[String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)!\\\u003e | [getFlavorNames](#getFlavorNames())`()` Returns a list of flavor names that make up this variant. |\n| abstract [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html) | [getFullVariantName](#getFullVariantName())`()` Returns the name of the variant. |\n| abstract [Boolean](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html) | [isDebuggable](#isDebuggable())`()` Returns true if the variant is debuggable |\n| abstract [Boolean](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html) | [isTest](#isTest())`()` Returns true if this is a test variant |\n\nPublic methods\n--------------\n\n### getBuildTypeName\n\n```\n@NonNull abstract fun getBuildTypeName(): String\n```\n\nReturns the name of the build type.\n\nBy convention, build-type settings should override flavor settings. \n\n### getFlavorNames\n\n```\n@NonNull abstract fun getFlavorNames(): ImmutableList\u003cString!\u003e\n```\n\nReturns a list of flavor names that make up this variant.\n\nBy convention settings from earlier flavors should override settings from later flavors.\n\n| Return ||\n|---|---|\n| ImmutableList\\\u003c[String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)!\\\u003e: the ordered list of flavor names. May be empty. ||\n\n### getFullVariantName\n\n```\n@NonNull abstract fun getFullVariantName(): String\n```\n\nReturns the name of the variant. This is composed of the build types and flavors \n\n### isDebuggable\n\n```\nabstract fun isDebuggable(): Boolean\n```\n\nReturns true if the variant is debuggable \n\n### isTest\n\n```\nabstract fun isTest(): Boolean\n```\n\nReturns true if this is a test variant"]]