public interface

IBuildInfo

com.android.tradefed.build.IBuildInfo
Known Indirect Subclasses

Class Overview

Holds information about the build under test.

Summary

Constants
String UNKNOWN_BUILD_ID Default value when build ID is unknown.
Public Methods
abstract void addBuildAttribute(String attributeName, String attributeValue)
Add a build attribute
abstract void cleanUp()
Clean up any temporary build files
abstract IBuildInfo clone()
Clones the IBuildInfo object.
abstract Map<String, String> getBuildAttributes()
Get a set of name-value pairs of additional attributes describing the build.
abstract String getBuildBranch()
Optional method to return the source control branch that the build being tested was produced from.
abstract String getBuildFlavor()
Optional method to return the type of build being tested.
abstract String getBuildId()
Returns the unique identifier of build under test.
abstract String getBuildTargetName()
Return complete name for the build being tested.
abstract String getDeviceSerial()
abstract File getFile(String name)
Helper method to retrieve a file with given name.
abstract Collection<VersionedFile> getFiles()
Returns all VersionedFiles stored in this BuildInfo.
abstract String getTestTag()
Return a unique name for the tests being run.
abstract String getVersion(String name)
Helper method to retrieve a file version with given name.
abstract void setBuildBranch(String branch)
Set the build branch
abstract void setBuildFlavor(String buildFlavor)
Set the build flavor.
abstract void setDeviceSerial(String serial)
Set the ITestDevice serial associated with this build.
abstract void setFile(String name, File file, String version)
Stores an file with given name in this build info.

Constants

public static final String UNKNOWN_BUILD_ID

Default value when build ID is unknown.

Constant Value: "-1"

Public Methods

public abstract void addBuildAttribute (String attributeName, String attributeValue)

Add a build attribute

Parameters
attributeName the unique attribute name
attributeValue the attribute value

public abstract void cleanUp ()

Clean up any temporary build files

public abstract IBuildInfo clone ()

Clones the IBuildInfo object.

public abstract Map<String, String> getBuildAttributes ()

Get a set of name-value pairs of additional attributes describing the build.

Returns
  • a Map of build attributes. Will not be null, but may be empty.

public abstract String getBuildBranch ()

Optional method to return the source control branch that the build being tested was produced from.

Returns
  • the build branch or null if unset/not applicable

public abstract String getBuildFlavor ()

Optional method to return the type of build being tested.

A common implementation for Android platform builds is to return (build product)-(build os)-(build variant). ie generic-linux-userdebug

Returns
  • the build flavor or null if unset/not applicable

public abstract String getBuildId ()

Returns the unique identifier of build under test. Should never be null. Defaults to UNKNOWN_BUILD_ID.

public abstract String getBuildTargetName ()

Return complete name for the build being tested.

A common implementation is to construct the build target name from a combination of the build flavor and branch name. [ie (branch name)-(build flavor)]

public abstract String getDeviceSerial ()

Returns
  • the ITestDevice serial that this build was executed on. Returns null if no device is associated with this build.

public abstract File getFile (String name)

Helper method to retrieve a file with given name.

Returns
  • the image file or null if not found

public abstract Collection<VersionedFile> getFiles ()

Returns all VersionedFiles stored in this BuildInfo.

public abstract String getTestTag ()

Return a unique name for the tests being run.

public abstract String getVersion (String name)

Helper method to retrieve a file version with given name.

Returns
  • the image version or null if not found

public abstract void setBuildBranch (String branch)

Set the build branch

Parameters
branch the branch name

public abstract void setBuildFlavor (String buildFlavor)

Set the build flavor.

public abstract void setDeviceSerial (String serial)

Set the ITestDevice serial associated with this build.

Parameters
serial the serial number of the ITestDevice that this build was executed with.

public abstract void setFile (String name, File file, String version)

Stores an file with given name in this build info.

Parameters
name the unique name of the file
file the local File
version the file version