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.

DefaultProductFlavor getConfig()

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

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.

java.lang.String getName()

Returns the name of the variant.

java.io.File getOutputFile()

Returns the output file for this build variants.

Copy getProcessJavaResources()

Returns the Java resource processing task.

ProcessManifest getProcessManifest()

Returns the Manifest processing task.

ProcessAndroidResources getProcessResources()

Returns the Android Resources processing task.

RenderscriptCompile getRenderscriptCompile()

Returns the Renderscript compilation task.

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.


getConfig

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


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.


getName

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


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.


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.


getRenderscriptCompile

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


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