Interface BaseVariant
-
- All Known Subinterfaces:
ApkVariant,ApplicationVariant,FeatureVariant,com.android.build.gradle.internal.core.InternalBaseVariant,LibraryVariant,TestVariant,UnitTestVariant
@Deprecated public interface BaseVariantDeprecated.A Build variant and all its public data. This is the base class for items common to apps, test apps, and libraries
-
-
Method Summary
All Methods Instance Methods Abstract Methods Deprecated Methods Modifier and Type Method Description voidaddJavaSourceFoldersToModel(java.io.File... sourceFolders)Deprecated.Adds new Java source folders to the model.voidaddJavaSourceFoldersToModel(java.util.Collection<java.io.File> sourceFolders)Deprecated.Adds new Java source folders to the model.voidbuildConfigField(java.lang.String type, java.lang.String name, java.lang.String value)Deprecated.Adds a variant-specific BuildConfig field.com.android.build.gradle.tasks.AidlCompilegetAidlCompile()Deprecated.org.gradle.api.tasks.TaskProvider<com.android.build.gradle.tasks.AidlCompile>getAidlCompileProvider()Deprecated.Returns theTaskProviderfor the AIDL compilation task.org.gradle.api.file.FileCollectiongetAllRawAndroidResources()Deprecated.Returns file collection containing all raw Android resources, including the ones from transitive dependencies.org.gradle.api.artifacts.ConfigurationgetAnnotationProcessorConfiguration()Deprecated.Returns the configuration object for the annotation processor.java.lang.StringgetApplicationId()Deprecated.Returns the applicationId of the variant.org.gradle.api.resources.TextResourcegetApplicationIdTextResource()Deprecated.useApplicationVariants#getApplicationId().org.gradle.api.TaskgetAssemble()Deprecated.org.gradle.api.tasks.TaskProvider<org.gradle.api.Task>getAssembleProvider()Deprecated.Returns theTaskProviderfor the assemble task.java.lang.StringgetBaseName()Deprecated.Returns the base name for the output of the variant.com.android.builder.model.BuildTypegetBuildType()Deprecated.Returns theBuildTypefor this build variant.org.gradle.api.TaskgetCheckManifest()Deprecated.org.gradle.api.tasks.TaskProvider<org.gradle.api.Task>getCheckManifestProvider()Deprecated.Returns theTaskProviderfor the check manifest task.org.gradle.api.file.FileCollectiongetCompileClasspath(java.lang.Object key)Deprecated.Returns the java compilation classpath.org.gradle.api.artifacts.ArtifactCollectiongetCompileClasspathArtifacts(java.lang.Object key)Deprecated.Returns the java compilation classpath as an ArtifactCollectionorg.gradle.api.artifacts.ConfigurationgetCompileConfiguration()Deprecated.Returns the configuration object for the compilationjava.lang.StringgetDescription()Deprecated.Returns a description for the build variant.java.lang.StringgetDirName()Deprecated.Returns a subfolder name for the variant.java.util.Collection<org.gradle.api.tasks.TaskProvider<com.android.build.gradle.tasks.ExternalNativeBuildTask>>getExternalNativeBuildProviders()Deprecated.Returns the tasks for building external native projects.java.util.Collection<com.android.build.gradle.tasks.ExternalNativeBuildTask>getExternalNativeBuildTasks()Deprecated.java.lang.StringgetFlavorName()Deprecated.Returns the flavor name of the variant.com.android.build.gradle.tasks.GenerateBuildConfiggetGenerateBuildConfig()Deprecated.org.gradle.api.tasks.TaskProvider<com.android.build.gradle.tasks.GenerateBuildConfig>getGenerateBuildConfigProvider()Deprecated.Returns theTaskProviderfor the BuildConfig generation task.org.gradle.api.tasks.compile.JavaCompilegetJavaCompile()Deprecated.com.android.build.gradle.api.JavaCompileOptionsgetJavaCompileOptions()Deprecated.Returns aJavaCompileOptionsthat represents the java compile settings for this build variant.org.gradle.api.tasks.TaskProvider<org.gradle.api.tasks.compile.JavaCompile>getJavaCompileProvider()Deprecated.Returns theTaskProviderfor the Java Compilation taskorg.gradle.api.TaskgetJavaCompiler()Deprecated.java.io.FilegetMappingFile()Deprecated.Please usegetMappingFileProvider()instead in order to avoid task configuration.org.gradle.api.provider.Provider<org.gradle.api.file.FileCollection>getMappingFileProvider()Deprecated.Returns the provider of a file collection that contains an obfuscation mapping file.com.android.build.gradle.tasks.MergeSourceSetFoldersgetMergeAssets()Deprecated.org.gradle.api.tasks.TaskProvider<com.android.build.gradle.tasks.MergeSourceSetFolders>getMergeAssetsProvider()Deprecated.Returns theTaskProviderfor the asset merging task.com.android.builder.model.ProductFlavorgetMergedFlavor()Deprecated.Returns aProductFlavorthat represents the merging of the default config and the flavors of this build variant.MergeResourcesgetMergeResources()Deprecated.org.gradle.api.tasks.TaskProvider<MergeResources>getMergeResourcesProvider()Deprecated.Returns theTaskProviderfor the resource merging task.java.lang.StringgetName()Deprecated.Returns the name of the variant.org.gradle.api.TaskgetObfuscation()Deprecated.This always returns nullorg.gradle.api.DomainObjectCollection<BaseVariantOutput>getOutputs()Deprecated.Returns the variant outputs.booleangetOutputsAreSigned()Deprecated.org.gradle.api.TaskgetPreBuild()Deprecated.org.gradle.api.tasks.TaskProvider<org.gradle.api.Task>getPreBuildProvider()Deprecated.Returns theTaskProviderfor the pre-build anchor task.org.gradle.api.tasks.AbstractCopyTaskgetProcessJavaResources()Deprecated.org.gradle.api.tasks.TaskProvider<org.gradle.api.tasks.AbstractCopyTask>getProcessJavaResourcesProvider()Deprecated.Returns the Java resource processing task.java.util.List<com.android.builder.model.ProductFlavor>getProductFlavors()Deprecated.Returns the list ofProductFlavorfor this build variant.com.android.build.gradle.tasks.RenderscriptCompilegetRenderscriptCompile()Deprecated.org.gradle.api.tasks.TaskProvider<com.android.build.gradle.tasks.RenderscriptCompile>getRenderscriptCompileProvider()Deprecated.Returns theTaskProviderfor the Renderscript compilation task.org.gradle.api.artifacts.ConfigurationgetRuntimeConfiguration()Deprecated.Returns the configuration object for the runtimejava.util.List<org.gradle.api.file.ConfigurableFileTree>getSourceFolders(SourceKind folderType)Deprecated.Returns a list of FileCollection representing the source folders.java.util.List<com.android.builder.model.SourceProvider>getSourceSets()Deprecated.Returns a list of sorted SourceProvider in order of ascending order, meaning, the earlier items are meant to be overridden by later items.voidmissingDimensionStrategy(java.lang.String dimension, java.lang.String requestedValue)Deprecated.Set up a new matching request for a given flavor dimension and value.voidmissingDimensionStrategy(java.lang.String dimension, java.lang.String... requestedValues)Deprecated.Set up a new matching request for a given flavor dimension and value.voidmissingDimensionStrategy(java.lang.String dimension, java.util.List<java.lang.String> requestedValues)Deprecated.Set up a new matching request for a given flavor dimension and value.voidregister(org.gradle.api.Task task)Deprecated.Registers a task to be executed before any main output tasks like the assemble or bundle tasks are invoked.voidregisterExternalAptJavaOutput(org.gradle.api.file.ConfigurableFileTree folder)Deprecated.Register the output of an external annotation processor.java.lang.ObjectregisterGeneratedBytecode(org.gradle.api.file.FileCollection fileCollection)Deprecated.voidregisterGeneratedResFolders(org.gradle.api.file.FileCollection folders)Deprecated.Adds to the variant new generated resource folders.voidregisterJavaGeneratingTask(org.gradle.api.Task task, java.io.File... sourceFolders)Deprecated.voidregisterJavaGeneratingTask(org.gradle.api.Task task, java.util.Collection<java.io.File> sourceFolders)Deprecated.Use#registerJavaGeneratingTask(TaskProvider, Collection) voidregisterJavaGeneratingTask(org.gradle.api.tasks.TaskProvider<? extends org.gradle.api.Task> taskProvider, java.io.File... sourceFolders)Deprecated.Adds to the variant a task that generates Java source code.voidregisterJavaGeneratingTask(org.gradle.api.tasks.TaskProvider<? extends org.gradle.api.Task> taskProvider, java.util.Collection<java.io.File> sourceFolders)Deprecated.Adds to the variant a task that generates Java source code.voidregisterPostJavacGeneratedBytecode(org.gradle.api.file.FileCollection fileCollection)Deprecated.Adds to the variant new generated Java byte-code.java.lang.ObjectregisterPreJavacGeneratedBytecode(org.gradle.api.file.FileCollection fileCollection)Deprecated.Adds to the variant new generated Java byte-code.voidregisterResGeneratingTask(org.gradle.api.Task task, java.io.File... resFolders)Deprecated.voidregisterResGeneratingTask(org.gradle.api.Task task, java.util.Collection<java.io.File> resFolders)Deprecated.voidresValue(java.lang.String type, java.lang.String name, java.lang.String value)Deprecated.Adds a variant-specific res value.voidsetOutputsAreSigned(boolean isSigned)Deprecated.If true, variant outputs will be considered signed.
-
-
-
Method Detail
-
getName
@NonNull java.lang.String getName()
Deprecated.Returns the name of the variant. Guaranteed to be unique.
-
getDescription
@NonNull java.lang.String getDescription()
Deprecated.Returns a description for the build variant.
-
getDirName
@NonNull java.lang.String getDirName()
Deprecated.Returns a subfolder name for the variant. Guaranteed to be unique. This is usually a mix of build type and flavor(s) (if applicable). For instance this could be: "debug" "debug/myflavor" "release/Flavor1Flavor2"
-
getBaseName
@NonNull java.lang.String getBaseName()
Deprecated.Returns the base name for the output of the variant. Guaranteed to be unique.
-
getFlavorName
@NonNull java.lang.String getFlavorName()
Deprecated.Returns the flavor name of the variant. This is a concatenation of all the applied flavors- Returns:
- the name of the flavors, or an empty string if there is not flavors.
-
getOutputs
@NonNull org.gradle.api.DomainObjectCollection<BaseVariantOutput> getOutputs()
Deprecated.Returns the variant outputs. There should always be at least one output.- Returns:
- a non-null list of variants.
-
getBuildType
@NonNull com.android.builder.model.BuildType getBuildType()
Deprecated.Returns theBuildTypefor this build variant.
-
getMergedFlavor
@NonNull com.android.builder.model.ProductFlavor getMergedFlavor()
Deprecated.Returns aProductFlavorthat represents the merging of the default config and the flavors of this build variant.
-
getJavaCompileOptions
@NonNull com.android.build.gradle.api.JavaCompileOptions getJavaCompileOptions()
Deprecated.Returns aJavaCompileOptionsthat represents the java compile settings for this build variant.
-
getProductFlavors
@NonNull java.util.List<com.android.builder.model.ProductFlavor> getProductFlavors()
Deprecated.Returns the list ofProductFlavorfor this build variant.This is always non-null but could be empty.
-
getSourceSets
@NonNull java.util.List<com.android.builder.model.SourceProvider> getSourceSets()
Deprecated.Returns a list of sorted SourceProvider in order of ascending order, meaning, the earlier items are meant to be overridden by later items.- Returns:
- a list of source provider
-
getSourceFolders
@NonNull java.util.List<org.gradle.api.file.ConfigurableFileTree> getSourceFolders(@NonNull SourceKind folderType)Deprecated.Returns a list of FileCollection representing the source folders.You can replace calls to this method by using
Component.getSources(), then use theSources.getJava()and thenSourceDirectories.getAll().- Parameters:
folderType- the type of folder to return.- Returns:
- a list of folder + dependency as file collections.
-
getCompileConfiguration
@NonNull org.gradle.api.artifacts.Configuration getCompileConfiguration()
Deprecated.Returns the configuration object for the compilation
-
getAnnotationProcessorConfiguration
@NonNull org.gradle.api.artifacts.Configuration getAnnotationProcessorConfiguration()
Deprecated.Returns the configuration object for the annotation processor.
-
getRuntimeConfiguration
@NonNull org.gradle.api.artifacts.Configuration getRuntimeConfiguration()
Deprecated.Returns the configuration object for the runtime
-
getApplicationId
@NonNull java.lang.String getApplicationId()
Deprecated.Returns the applicationId of the variant.
-
getApplicationIdTextResource
@NonNull @Deprecated org.gradle.api.resources.TextResource getApplicationIdTextResource()
Deprecated.useApplicationVariants#getApplicationId().Returns the true application Id of the variant. For feature variants, this returns the resolved application id from the application. For application variants, this is the same as getApplicationId.
-
getPreBuild
@NonNull @Deprecated org.gradle.api.Task getPreBuild()
Deprecated.Returns the pre-build anchor task
-
getPreBuildProvider
@NonNull org.gradle.api.tasks.TaskProvider<org.gradle.api.Task> getPreBuildProvider()
Deprecated.Returns theTaskProviderfor the pre-build anchor task.Prefer this to
getPreBuild()as it triggers eager configuration of the task.
-
getCheckManifest
@NonNull @Deprecated org.gradle.api.Task getCheckManifest()
Deprecated.Returns the check manifest task.
-
getCheckManifestProvider
@NonNull org.gradle.api.tasks.TaskProvider<org.gradle.api.Task> getCheckManifestProvider()
Deprecated.Returns theTaskProviderfor the check manifest task.Prefer this to
getCheckManifest()as it triggers eager configuration of the task.
-
getAidlCompile
@Nullable @Deprecated com.android.build.gradle.tasks.AidlCompile getAidlCompile()
Deprecated.Returns the AIDL compilation task.If aidl feature is disabled via
BuildFeatures.getAidl()this will throw an exception (or returnnullduring sync.)
-
getAidlCompileProvider
@Nullable org.gradle.api.tasks.TaskProvider<com.android.build.gradle.tasks.AidlCompile> getAidlCompileProvider()
Deprecated.Returns theTaskProviderfor the AIDL compilation task.If aidl feature is disabled via
BuildFeatures.getAidl()this will throw an exception (or returnnullduring sync.)Prefer this to
getAidlCompile()as it triggers eager configuration of the task.
-
getRenderscriptCompile
@Nullable @Deprecated com.android.build.gradle.tasks.RenderscriptCompile getRenderscriptCompile()
Deprecated.Returns the Renderscript compilation task.If renderscript feature is disabled via
BuildFeatures.getRenderScript()this will throw an exception (or returnnullduring sync.)
-
getRenderscriptCompileProvider
@Nullable org.gradle.api.tasks.TaskProvider<com.android.build.gradle.tasks.RenderscriptCompile> getRenderscriptCompileProvider()
Deprecated.Returns theTaskProviderfor the Renderscript compilation task.Prefer this to
getRenderscriptCompile()as it triggers eager configuration of the task.If renderscript feature is disabled via
BuildFeatures.getRenderScript()this will throw an exception (or returnnullduring sync.)
-
getMergeResources
@Nullable @Deprecated MergeResources getMergeResources()
Deprecated.Returns the resource merging task.
-
getMergeResourcesProvider
@Nullable org.gradle.api.tasks.TaskProvider<MergeResources> getMergeResourcesProvider()
Deprecated.Returns theTaskProviderfor the resource merging task.Prefer this to
getMergeResources()as it triggers eager configuration of the task.
-
getMergeAssets
@Nullable @Deprecated com.android.build.gradle.tasks.MergeSourceSetFolders getMergeAssets()
Deprecated.Returns the asset merging task.
-
getMergeAssetsProvider
@Nullable org.gradle.api.tasks.TaskProvider<com.android.build.gradle.tasks.MergeSourceSetFolders> getMergeAssetsProvider()
Deprecated.Returns theTaskProviderfor the asset merging task.Prefer this to
getMergeAssets()as it triggers eager configuration of the task.
-
getGenerateBuildConfig
@Nullable @Deprecated com.android.build.gradle.tasks.GenerateBuildConfig getGenerateBuildConfig()
Deprecated.Returns the BuildConfig generation task.
-
getGenerateBuildConfigProvider
@Nullable org.gradle.api.tasks.TaskProvider<com.android.build.gradle.tasks.GenerateBuildConfig> getGenerateBuildConfigProvider()
Deprecated.Returns theTaskProviderfor the BuildConfig generation task.Prefer this to
getGenerateBuildConfig()as it triggers eager configuration of the task.
-
getJavaCompile
@NonNull @Deprecated org.gradle.api.tasks.compile.JavaCompile getJavaCompile()
Deprecated.Returns the Java Compilation task
-
getJavaCompileProvider
@NonNull org.gradle.api.tasks.TaskProvider<org.gradle.api.tasks.compile.JavaCompile> getJavaCompileProvider()
Deprecated.Returns theTaskProviderfor the Java Compilation taskPrefer this to
getJavaCompile()as it triggers eager configuration of the task.
-
getJavaCompiler
@NonNull @Deprecated org.gradle.api.Task getJavaCompiler()
Deprecated.Returns the Java Compiler task.
-
getCompileClasspath
@NonNull org.gradle.api.file.FileCollection getCompileClasspath(@Nullable java.lang.Object key)Deprecated.Returns the java compilation classpath.The provided key allows controlling how much of the classpath is returned.
- if
null, the full classpath is returned - Otherwise the method returns the classpath up to the generated bytecode associated with the key
- Parameters:
key- the key- See Also:
registerGeneratedBytecode(FileCollection)
- if
-
getCompileClasspathArtifacts
@NonNull org.gradle.api.artifacts.ArtifactCollection getCompileClasspathArtifacts(@Nullable java.lang.Object key)Deprecated.Returns the java compilation classpath as an ArtifactCollectionThe provided key allows controlling how much of the classpath is returned.
- if
null, the full classpath is returned - Otherwise the method returns the classpath up to the generated bytecode associated with the key
- Parameters:
key- the key- See Also:
registerGeneratedBytecode(FileCollection)
- if
-
getExternalNativeBuildTasks
@NonNull @Deprecated java.util.Collection<com.android.build.gradle.tasks.ExternalNativeBuildTask> getExternalNativeBuildTasks()
Deprecated.Returns the tasks for building external native projects.
-
getExternalNativeBuildProviders
@NonNull java.util.Collection<org.gradle.api.tasks.TaskProvider<com.android.build.gradle.tasks.ExternalNativeBuildTask>> getExternalNativeBuildProviders()
Deprecated.Returns the tasks for building external native projects.Prefer this to
getExternalNativeBuildTasks()as it triggers eager configuration of the tasks.
-
getObfuscation
@Nullable @Deprecated org.gradle.api.Task getObfuscation()
Deprecated.This always returns nullReturns the obfuscation task. This can be null if obfuscation is not enabled.
-
getMappingFile
@Nullable @Deprecated java.io.File getMappingFile()
Deprecated.Please usegetMappingFileProvider()instead in order to avoid task configuration.Returns the obfuscation mapping file. This can be null if obfuscation is not enabled.
-
getMappingFileProvider
@NonNull org.gradle.api.provider.Provider<org.gradle.api.file.FileCollection> getMappingFileProvider()
Deprecated.Returns the provider of a file collection that contains an obfuscation mapping file. The file collection may be empty if obfuscation is not enabled.
-
getProcessJavaResources
@NonNull @Deprecated org.gradle.api.tasks.AbstractCopyTask getProcessJavaResources()
Deprecated.Returns the Java resource processing task.
-
getProcessJavaResourcesProvider
@NonNull org.gradle.api.tasks.TaskProvider<org.gradle.api.tasks.AbstractCopyTask> getProcessJavaResourcesProvider()
Deprecated.Returns the Java resource processing task.Prefer this to
getProcessJavaResources()as it triggers eager configuration of the task.
-
getAssemble
@Nullable @Deprecated org.gradle.api.Task getAssemble()
Deprecated.Returns the assemble task for all this variant's output
-
getAssembleProvider
@Nullable org.gradle.api.tasks.TaskProvider<org.gradle.api.Task> getAssembleProvider()
Deprecated.Returns theTaskProviderfor the assemble task.Prefer this to
getAssemble()as it triggers eager configuration of the task.
-
addJavaSourceFoldersToModel
void addJavaSourceFoldersToModel(@NonNull java.io.File... sourceFolders)Deprecated.Adds new Java source folders to the model. These source folders will not be used for the default build system, but will be passed along the default Java source folders to whoever queries the model.- Parameters:
sourceFolders- the source folders where the generated source code is.
-
addJavaSourceFoldersToModel
void addJavaSourceFoldersToModel(@NonNull java.util.Collection<java.io.File> sourceFolders)Deprecated.Adds new Java source folders to the model. These source folders will not be used for the default build system, but will be passed along the default Java source folders to whoever queries the model.- Parameters:
sourceFolders- the source folders where the generated source code is.
-
registerJavaGeneratingTask
@Deprecated void registerJavaGeneratingTask(@NonNull org.gradle.api.Task task, @NonNull java.io.File... sourceFolders)Deprecated.Adds to the variant a task that generates Java source code.This will make the generate[Variant]Sources task depend on this task and add the new source folders as compilation inputs.
The new source folders are also added to the model.
N.B. This method also supports adding generated Kotlin sources, but this behavior may change in the future. Future versions of AGP or Kotlin Gradle plugin may not support this.
- Parameters:
task- the tasksourceFolders- the source folders where the generated source code is.
-
registerJavaGeneratingTask
@Deprecated void registerJavaGeneratingTask(@NonNull org.gradle.api.Task task, @NonNull java.util.Collection<java.io.File> sourceFolders)Deprecated.Use#registerJavaGeneratingTask(TaskProvider, Collection) Adds to the variant a task that generates Java source code.This will make the generate[Variant]Sources task depend on this task and add the new source folders as compilation inputs.
The new source folders are also added to the model.
N.B. This method also supports adding generated Kotlin sources, but this behavior may change in the future. Future versions of AGP or Kotlin Gradle plugin may not support this.
- Parameters:
task- the tasksourceFolders- the source folders where the generated source code is.
-
registerJavaGeneratingTask
void registerJavaGeneratingTask(@NonNull org.gradle.api.tasks.TaskProvider<? extends org.gradle.api.Task> taskProvider, @NonNull java.io.File... sourceFolders)Deprecated.Adds to the variant a task that generates Java source code.This will make the generate[Variant]Sources task depend on this task and add the new source folders as compilation inputs.
The new source folders are also added to the model.
N.B. This method also supports adding generated Kotlin sources, but this behavior may change in the future. Future versions of AGP or Kotlin Gradle plugin may not support this.
- Parameters:
taskProvider- the task providersourceFolders- the source folders where the generated source code is.
-
registerJavaGeneratingTask
void registerJavaGeneratingTask(@NonNull org.gradle.api.tasks.TaskProvider<? extends org.gradle.api.Task> taskProvider, @NonNull java.util.Collection<java.io.File> sourceFolders)Deprecated.Adds to the variant a task that generates Java source code.This will make the generate[Variant]Sources task depend on this task and add the new source folders as compilation inputs.
The new source folders are also added to the model.
N.B. This method also supports adding generated Kotlin sources, but this behavior may change in the future. Future versions of AGP or Kotlin Gradle plugin may not support this.
- Parameters:
taskProvider- the task providersourceFolders- the source folders where the generated source code is.
-
registerExternalAptJavaOutput
void registerExternalAptJavaOutput(@NonNull org.gradle.api.file.ConfigurableFileTree folder)Deprecated.Register the output of an external annotation processor.The output is passed to the javac task, but the source generation hooks does not depend on this.
In order to properly wire up tasks, the FileTree object must include dependency information about the task that generates the content of this folders.
- Parameters:
folder- a ConfigurableFileTree that contains a single folder and the task dependency information
-
registerGeneratedResFolders
void registerGeneratedResFolders(@NonNull org.gradle.api.file.FileCollection folders)Deprecated.Adds to the variant new generated resource folders.In order to properly wire up tasks, the FileCollection object must include dependency information about the task that generates the content of this folders.
- Parameters:
folders- a FileCollection that contains the folders and the task dependency information
-
registerResGeneratingTask
@Deprecated void registerResGeneratingTask(@NonNull org.gradle.api.Task task, @NonNull java.io.File... resFolders)Deprecated.Adds to the variant a task that generates Resources. This will make the generate[Variant]Resources task depend on this task and add the new Resource folders as Resource merge inputs. The Resource folders are also added to the model.- Parameters:
task- the taskresFolders- the folders where the generated resources are.
-
registerResGeneratingTask
@Deprecated void registerResGeneratingTask(@NonNull org.gradle.api.Task task, @NonNull java.util.Collection<java.io.File> resFolders)Deprecated.Adds to the variant a task that generates Resources. This will make the generate[Variant]Resources task depend on this task and add the new Resource folders as Resource merge inputs. The Resource folders are also added to the model.- Parameters:
task- the taskresFolders- the folders where the generated resources are.
-
registerPreJavacGeneratedBytecode
java.lang.Object registerPreJavacGeneratedBytecode(@NonNull org.gradle.api.file.FileCollection fileCollection)Deprecated.Adds to the variant new generated Java byte-code.This bytecode is passed to the javac classpath. This is typically used by compilers for languages that generate bytecode ahead of javac.
The file collection can contain either a folder of class files or jars.
In order to properly wire up tasks, the FileCollection object must include dependency information about the task that generates the content of these folders. This is generally setup using
ConfigurableFileCollection.builtBy(Object...)The generated byte-code will also be added to the transform pipeline as a
QualifiedContent.Scope.PROJECTstream.The method returns a key that can be used to query for the compilation classpath. This allows each successive call to
registerPreJavacGeneratedBytecode(FileCollection)to be associated with a classpath containing everything before the added bytecode.- Parameters:
fileCollection- a FileCollection that contains the files and the task dependency information- Returns:
- a key for calls to
registerGeneratedBytecode(FileCollection)
-
registerGeneratedBytecode
@Deprecated java.lang.Object registerGeneratedBytecode(@NonNull org.gradle.api.file.FileCollection fileCollection)Deprecated.
-
registerPostJavacGeneratedBytecode
void registerPostJavacGeneratedBytecode(@NonNull org.gradle.api.file.FileCollection fileCollection)Deprecated.Adds to the variant new generated Java byte-code.This bytecode is meant to be post javac, which means javac does not have it on its classpath. It's is only added to the java compilation task's classpath and will be added to the transform pipeline as a
QualifiedContent.Scope.PROJECTstream.The file collection can contain either a folder of class files or jars.
In order to properly wire up tasks, the FileCollection object must include dependency information about the task that generates the content of these folders. This is generally setup using
ConfigurableFileCollection.builtBy(Object...)- Parameters:
fileCollection- a FileCollection that contains the files and the task dependency information
-
buildConfigField
void buildConfigField(@NonNull java.lang.String type, @NonNull java.lang.String name, @NonNull java.lang.String value)Deprecated.Adds a variant-specific BuildConfig field.- Parameters:
type- the type of the fieldname- the name of the fieldvalue- the value of the field
-
resValue
void resValue(@NonNull java.lang.String type, @NonNull java.lang.String name, @NonNull java.lang.String value)Deprecated.Adds a variant-specific res value.- Parameters:
type- the type of the fieldname- the name of the fieldvalue- the value of the field
-
missingDimensionStrategy
void missingDimensionStrategy(@NonNull java.lang.String dimension, @NonNull java.lang.String requestedValue)Deprecated.Set up a new matching request for a given flavor dimension and value.To learn more, read Select default flavors for missing dimensions.
- Parameters:
dimension- the flavor dimensionrequestedValue- the flavor name
-
missingDimensionStrategy
void missingDimensionStrategy(@NonNull java.lang.String dimension, @NonNull java.lang.String... requestedValues)Deprecated.Set up a new matching request for a given flavor dimension and value.To learn more, read Select default flavors for missing dimensions.
- Parameters:
dimension- the flavor dimensionrequestedValues- the flavor name and fallbacks
-
missingDimensionStrategy
void missingDimensionStrategy(@NonNull java.lang.String dimension, @NonNull java.util.List<java.lang.String> requestedValues)Deprecated.Set up a new matching request for a given flavor dimension and value.To learn more, read Select default flavors for missing dimensions.
- Parameters:
dimension- the flavor dimensionrequestedValues- the flavor name and fallbacks
-
setOutputsAreSigned
void setOutputsAreSigned(boolean isSigned)
Deprecated.If true, variant outputs will be considered signed. Only set if you manually set the outputs to point to signed files built by other tasks.
-
getOutputsAreSigned
boolean getOutputsAreSigned()
Deprecated.- See Also:
setOutputsAreSigned(boolean)
-
getAllRawAndroidResources
@Incubating @NonNull org.gradle.api.file.FileCollection getAllRawAndroidResources()
Deprecated.Returns file collection containing all raw Android resources, including the ones from transitive dependencies.This is an incubating API, and it can be changed or removed without notice.
-
register
@Incubating void register(org.gradle.api.Task task)
Deprecated.Registers a task to be executed before any main output tasks like the assemble or bundle tasks are invoked.The task will need to set up its dependencies on the build outputs (whether it is an intermediate output or the final one) independently of this call.
-
-