BuildInfo

public class BuildInfo
extends Object implements IBuildInfo

java.lang.Object
   ↳ com.android.tradefed.build.BuildInfo


Generic implementation of a IBuildInfo that should be associated with a ITestDevice.

Summary

Public constructors

BuildInfo()

Creates a BuildInfo using default attribute values.

BuildInfo(String buildId, String buildTargetName)

Creates a BuildInfo

Public methods

void addAppPackageFile(File appPackageFile, String version)

void addBuildAttribute(String attributeName, String attributeValue)

void addBuildAttributes( buildAttributes)

void cleanUp()

void cleanUp( doNotClean)

IBuildInfo clone()

final void copyAllFileFrom(BuildInfo build)

Copy all the VersionedFile from a given build to this one.

boolean equals(Object obj)

static IBuildInfo fromProto(BuildInformation.BuildInfo protoBuild)

Inverse operation to toProto() to get the instance back.

getAppPackageFiles()

getBuildAttributes()

String getBuildBranch()

String getBuildFlavor()

String getBuildId()

String getBuildTargetName()

String getDeviceSerial()

File getFile(String name)

File getFile(BuildInfoKey.BuildInfoFileKey key)

getFiles()

getProperties()

getRemoteFiles()

String getTestTag()

String getVersion(BuildInfoKey.BuildInfoFileKey key)

String getVersion(String name)

VersionedFile getVersionedFile(BuildInfoKey.BuildInfoFileKey key)

final VersionedFile getVersionedFile(String name)

getVersionedFileKeys()

final getVersionedFiles(BuildInfoKey.BuildInfoFileKey key)

int hashCode()

void removeBuildAttribute(String attributeName)
void setBuildBranch(String branch)

void setBuildFlavor(String buildFlavor)

void setBuildId(String buildId)

void setDeviceSerial(String serial)

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

void setFile(BuildInfoKey.BuildInfoFileKey key, File file, String version)

void setProperties(BuildInfoProperties... properties)

void setTestTag(String testTag)

File stageRemoteFile(String fileName, File workingDir)

BuildInformation.BuildInfo toProto()

String toString()

Protected methods

void addAllBuildAttributes(BuildInfo build)

Helper method to copy build attributes, branch, and flavor from other build.

void addAllFiles(BuildInfo build)

Helper method to copy all files from the other build.

boolean applyBuildProperties(VersionedFile origFileConsidered, IBuildInfo build, IBuildInfo receiver)

Allow to apply some of the IBuildInfo.BuildInfoProperties and possibly do a different handling.

MultiMap<String, String> getAttributesMultiMap()
getVersionedFileMap()
MultiMap<String, VersionedFile> getVersionedFileMapFull()

Public constructors

BuildInfo

public BuildInfo ()

Creates a BuildInfo using default attribute values.

BuildInfo

public BuildInfo (String buildId, 
                String buildTargetName)

Creates a BuildInfo

Parameters
buildId String: the build id

buildTargetName String: the build target name

Public methods

addAppPackageFile

public void addAppPackageFile (File appPackageFile, 
                String version)

Parameters
appPackageFile File

version String

addBuildAttribute

public void addBuildAttribute (String attributeName, 
                String attributeValue)

Parameters
attributeName String

attributeValue String

addBuildAttributes

public void addBuildAttributes ( buildAttributes)

Parameters
buildAttributes

cleanUp

public void cleanUp ()

cleanUp

public void cleanUp ( doNotClean)

Parameters
doNotClean

clone

public IBuildInfo clone ()

Returns
IBuildInfo

copyAllFileFrom

public final void copyAllFileFrom (BuildInfo build)

Copy all the VersionedFile from a given build to this one.

Parameters
build BuildInfo

equals

public boolean equals (Object obj)

Parameters
obj Object

Returns
boolean

fromProto

public static IBuildInfo fromProto (BuildInformation.BuildInfo protoBuild)

Inverse operation to toProto() to get the instance back.

Parameters
protoBuild BuildInformation.BuildInfo

Returns
IBuildInfo

getAppPackageFiles

public  getAppPackageFiles ()

Returns

getBuildAttributes

public  getBuildAttributes ()

Returns

getBuildBranch

public String getBuildBranch ()

Returns
String

getBuildFlavor

public String getBuildFlavor ()

Returns
String

getBuildId

public String getBuildId ()

Returns
String

getBuildTargetName

public String getBuildTargetName ()

Returns
String

getDeviceSerial

public String getDeviceSerial ()

Returns
String

getFile

public File getFile (String name)

Parameters
name String

Returns
File

getFile

public File getFile (BuildInfoKey.BuildInfoFileKey key)

Parameters
key BuildInfoKey.BuildInfoFileKey

Returns
File

getFiles

public  getFiles ()

Returns

getProperties

public  getProperties ()

Returns

getRemoteFiles

public  getRemoteFiles ()

Returns

getTestTag

public String getTestTag ()

Returns
String

getVersion

public String getVersion (BuildInfoKey.BuildInfoFileKey key)

Parameters
key BuildInfoKey.BuildInfoFileKey

Returns
String

getVersion

public String getVersion (String name)

Parameters
name String

Returns
String

getVersionedFile

public VersionedFile getVersionedFile (BuildInfoKey.BuildInfoFileKey key)

Parameters
key BuildInfoKey.BuildInfoFileKey

Returns
VersionedFile

getVersionedFile

public final VersionedFile getVersionedFile (String name)

Parameters
name String

Returns
VersionedFile

getVersionedFileKeys

public  getVersionedFileKeys ()

Returns

getVersionedFiles

public final  getVersionedFiles (BuildInfoKey.BuildInfoFileKey key)

Parameters
key BuildInfoKey.BuildInfoFileKey

Returns

hashCode

public int hashCode ()

Returns
int

removeBuildAttribute

public void removeBuildAttribute (String attributeName)

Parameters
attributeName String

setBuildBranch

public void setBuildBranch (String branch)

Parameters
branch String

setBuildFlavor

public void setBuildFlavor (String buildFlavor)

Parameters
buildFlavor String

setBuildId

public void setBuildId (String buildId)

Parameters
buildId String

setDeviceSerial

public void setDeviceSerial (String serial)

Parameters
serial String

setFile

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

Parameters
name String

file File

version String

setFile

public void setFile (BuildInfoKey.BuildInfoFileKey key, 
                File file, 
                String version)

Parameters
key BuildInfoKey.BuildInfoFileKey

file File

version String

setProperties

public void setProperties (BuildInfoProperties... properties)

Parameters
properties BuildInfoProperties

setTestTag

public void setTestTag (String testTag)

Parameters
testTag String

stageRemoteFile

public File stageRemoteFile (String fileName, 
                File workingDir)

Parameters
fileName String

workingDir File

Returns
File

toProto

public BuildInformation.BuildInfo toProto ()

Returns
BuildInformation.BuildInfo

toString

public String toString ()

Returns
String

Protected methods

addAllBuildAttributes

protected void addAllBuildAttributes (BuildInfo build)

Helper method to copy build attributes, branch, and flavor from other build.

Parameters
build BuildInfo

addAllFiles

protected void addAllFiles (BuildInfo build)

Helper method to copy all files from the other build.

Creates new hardlinks to the files so that each build will have a unique file path to the file.

Parameters
build BuildInfo

Throws
if an exception is thrown when creating the hardlink.

applyBuildProperties

protected boolean applyBuildProperties (VersionedFile origFileConsidered, 
                IBuildInfo build, 
                IBuildInfo receiver)

Allow to apply some of the IBuildInfo.BuildInfoProperties and possibly do a different handling.

Parameters
origFileConsidered VersionedFile: The currently looked at VersionedFile.

build IBuildInfo: the original build being cloned

receiver IBuildInfo: the build receiving the information.

Returns
boolean True if we applied the properties and further handling should be skipped. False otherwise.

getAttributesMultiMap

protected MultiMap<String, String> getAttributesMultiMap ()

Returns
MultiMap<String, String>

getVersionedFileMap

protected  getVersionedFileMap ()

Returns

getVersionedFileMapFull

protected MultiMap<String, VersionedFile> getVersionedFileMapFull ()

Returns
MultiMap<String, VersionedFile>