com.android.build.gradle.api
[Java] Interface BaseVariant


public interface BaseVariant

A Build variant and all its public data. This is the base class for items common to apps, test apps, and libraries


Method Summary
void addJavaSourceFoldersToModel(java.io.File... sourceFolders)

Adds new Java source folders to the model.

void addJavaSourceFoldersToModel(java.util.Collection sourceFolders)

Adds new Java source folders to the model.

AidlCompile getAidlCompile()

Returns the AIDL compilation task.

Task getAssemble()

Returns the assemble task.

java.lang.String getBaseName()

Returns the base name for the output of the variant.

DefaultBuildType getBuildType()

Returns the com.android.builder.DefaultBuildType for this build variant.

Task getCheckManifest()

Returns the check manifest task.

java.lang.String getDescription()

Returns a description for the build variant.

java.lang.String getDirName()

Returns a subfolder name for the variant.

java.lang.String getFlavorName()

Returns the flavor name of the variant.

GenerateBuildConfig getGenerateBuildConfig()

Returns the BuildConfig generation task.

JavaCompile getJavaCompile()

Returns the Java Compilation task.

MergeAssets getMergeAssets()

Returns the asset merging task.

MergeResources getMergeResources()

Returns the resource merging task.

DefaultProductFlavor getMergedFlavor()

Returns a com.android.builder.DefaultProductFlavor that represents the merging of the default config and the flavors of this build variant.

java.lang.String getName()

Returns the name of the variant.

NdkCompile getNdkCompile()

Returns the NDK Compilation task.

java.io.File getOutputFile()

Returns the output file for this build variants.

java.lang.String getPackageName()

Returns the package name of the variant.

Task getPreBuild()

Returns the pre-build anchor task

Copy getProcessJavaResources()

Returns the Java resource processing task.

ProcessManifest getProcessManifest()

Returns the Manifest processing task.

ProcessAndroidResources getProcessResources()

Returns the Android Resources processing task.

ProGuardTask getProguard()

Returns the Proguard task.

RenderscriptCompile getRenderscriptCompile()

Returns the Renderscript compilation task.

java.util.List getSourceSets()

Returns a list of sorted SourceProvider in order of ascending order, meaning, the earlier items are meant to be overridden by later items.

void registerJavaGeneratingTask(Task task, java.io.File... sourceFolders)

Adds to the variant a task that generates Java source code.

void registerJavaGeneratingTask(Task task, java.util.Collection sourceFolders)

Adds to the variant a task that generates Java source code.

void setOutputFile(java.io.File outputFile)

 

Method Detail

addJavaSourceFoldersToModel

public void addJavaSourceFoldersToModel(@NonNull java.io.File... sourceFolders)
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

public void addJavaSourceFoldersToModel(@NonNull java.util.Collection sourceFolders)
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.


getAidlCompile

@NonNull
public AidlCompile getAidlCompile()
Returns the AIDL compilation task.


getAssemble

@Nullable
public Task getAssemble()
Returns the assemble task.


getBaseName

@NonNull
public java.lang.String getBaseName()
Returns the base name for the output of the variant. Guaranteed to be unique.


getBuildType

@NonNull
public DefaultBuildType getBuildType()
Returns the com.android.builder.DefaultBuildType for this build variant.


getCheckManifest

@NonNull
public Task getCheckManifest()
Returns the check manifest task.


getDescription

@NonNull
public java.lang.String getDescription()
Returns a description for the build variant.


getDirName

@NonNull
public java.lang.String getDirName()
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"


getFlavorName

@NonNull
public java.lang.String getFlavorName()
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.


getGenerateBuildConfig

@Nullable
public GenerateBuildConfig getGenerateBuildConfig()
Returns the BuildConfig generation task.


getJavaCompile

@NonNull
public JavaCompile getJavaCompile()
Returns the Java Compilation task.


getMergeAssets

@Nullable
public MergeAssets getMergeAssets()
Returns the asset merging task.


getMergeResources

@Nullable
public MergeResources getMergeResources()
Returns the resource merging task.


getMergedFlavor

@NonNull
public DefaultProductFlavor getMergedFlavor()
Returns a com.android.builder.DefaultProductFlavor that represents the merging of the default config and the flavors of this build variant.


getName

@NonNull
public java.lang.String getName()
Returns the name of the variant. Guaranteed to be unique.


getNdkCompile

@NonNull
public NdkCompile getNdkCompile()
Returns the NDK Compilation task.


getOutputFile

@NonNull
public java.io.File getOutputFile()
Returns the output file for this build variants. Depending on the configuration, this could be an apk (regular and test project) or a bundled library (library project). If it's an apk, it could be signed, or not; zip-aligned, or not.


getPackageName

@NonNull
public java.lang.String getPackageName()
Returns the package name of the variant.


getPreBuild

@NonNull
public Task getPreBuild()
Returns the pre-build anchor task


getProcessJavaResources

@NonNull
public Copy getProcessJavaResources()
Returns the Java resource processing task.


getProcessManifest

@NonNull
public ProcessManifest getProcessManifest()
Returns the Manifest processing task.


getProcessResources

@NonNull
public ProcessAndroidResources getProcessResources()
Returns the Android Resources processing task.


getProguard

@Nullable
public ProGuardTask getProguard()
Returns the Proguard task. This can be null if proguard is not enabled.


getRenderscriptCompile

@NonNull
public RenderscriptCompile getRenderscriptCompile()
Returns the Renderscript compilation task.


getSourceSets

@NonNull
public java.util.List getSourceSets()
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


registerJavaGeneratingTask

public void registerJavaGeneratingTask(@NonNull Task task, @NonNull java.io.File... sourceFolders)
Adds to the variant a task that generates Java source code. This will make the compileJava task depend on this task and add the new source folders as compilation inputs. The new source folders are also added to the model.
Parameters:
task - the task
sourceFolders - the source folders where the generated source code is.


registerJavaGeneratingTask

public void registerJavaGeneratingTask(@NonNull Task task, @NonNull java.util.Collection sourceFolders)
Adds to the variant a task that generates Java source code. This will make the compileJava task depend on this task and add the new source folders as compilation inputs. The new source folders are also added to the model.
Parameters:
task - the task
sourceFolders - the source folders where the generated source code is.


setOutputFile

public void setOutputFile(@NonNull java.io.File outputFile)


 

Copyright (C) 2012 The Android Open Source Project