com.android.sdklib
Class BuildToolInfo

java.lang.Object
  extended by com.android.sdklib.BuildToolInfo

public class BuildToolInfo
extends java.lang.Object

Information on a specific build-tool folder.

For unit tests, see: - sdklib/src/test/.../LocalSdkTest - sdklib/src/test/.../SdkManagerTest - sdklib/src/test/.../BuildToolInfoTest


Nested Class Summary
static class BuildToolInfo.PathId
           
 
Field Summary
static int SDK_LEVEL_FOR_MULTIDEX_NATIVE_SUPPORT
          First version with native multi-dex support.
 
Constructor Summary
BuildToolInfo(com.android.repository.Revision revision, java.io.File path)
           
BuildToolInfo(com.android.repository.Revision revision, java.io.File mainPath, java.io.File aapt, java.io.File aidl, java.io.File dx, java.io.File dxJar, java.io.File llmvRsCc, java.io.File androidRs, java.io.File androidRsClang, java.io.File bccCompat, java.io.File ldArm, java.io.File ldArm64, java.io.File ldX86, java.io.File ldMips, java.io.File zipAlign)
           
 
Method Summary
 boolean canRunOnJvm()
          Checks whether this build-tools package can run on the current JVM.
protected  com.android.repository.Revision getCurrentJvmVersion()
           
 java.io.File getLocation()
          Returns the build-tool revision-specific folder.
 java.lang.String getPath(BuildToolInfo.PathId pathId)
          Returns the path of a build-tool component.
 com.android.repository.Revision getRevision()
          Returns the revision.
 java.util.Properties getRuntimeProps()
          Parses the build-tools runtime.props file, if present.
 boolean isValid(com.android.utils.ILogger log)
          Checks whether the build-tool is valid by verifying that the expected binaries are actually present.
 java.lang.String toString()
          Returns a debug representation suitable for unit-tests.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

SDK_LEVEL_FOR_MULTIDEX_NATIVE_SUPPORT

public static final int SDK_LEVEL_FOR_MULTIDEX_NATIVE_SUPPORT
First version with native multi-dex support.

See Also:
Constant Field Values
Constructor Detail

BuildToolInfo

public BuildToolInfo(@NonNull
                     com.android.repository.Revision revision,
                     @NonNull
                     java.io.File path)

BuildToolInfo

public BuildToolInfo(@NonNull
                     com.android.repository.Revision revision,
                     @NonNull
                     java.io.File mainPath,
                     @NonNull
                     java.io.File aapt,
                     @NonNull
                     java.io.File aidl,
                     @NonNull
                     java.io.File dx,
                     @NonNull
                     java.io.File dxJar,
                     @NonNull
                     java.io.File llmvRsCc,
                     @NonNull
                     java.io.File androidRs,
                     @NonNull
                     java.io.File androidRsClang,
                     @Nullable
                     java.io.File bccCompat,
                     @Nullable
                     java.io.File ldArm,
                     @Nullable
                     java.io.File ldArm64,
                     @Nullable
                     java.io.File ldX86,
                     @Nullable
                     java.io.File ldMips,
                     @NonNull
                     java.io.File zipAlign)
Method Detail

getRevision

@NonNull
public com.android.repository.Revision getRevision()
Returns the revision.


getLocation

@NonNull
public java.io.File getLocation()
Returns the build-tool revision-specific folder.

For compatibility reasons, use getPath(PathId) if you need the path to a specific tool.


getPath

public java.lang.String getPath(BuildToolInfo.PathId pathId)
Returns the path of a build-tool component.

Parameters:
pathId - the id representing the path to return.
Returns:
The absolute path for that tool, with a / separator if it's a folder. Null if the path-id is unknown.

isValid

public boolean isValid(@Nullable
                       com.android.utils.ILogger log)
Checks whether the build-tool is valid by verifying that the expected binaries are actually present. This checks that all known paths point to a valid file or directory.

Parameters:
log - An optional logger. If non-null, errors will be printed there.
Returns:
True if the build-tool folder contains all the expected tools.

getRuntimeProps

@NonNull
public java.util.Properties getRuntimeProps()
Parses the build-tools runtime.props file, if present.

Returns:
The properties from runtime.props if present, otherwise an empty properties set.

canRunOnJvm

public boolean canRunOnJvm()
Checks whether this build-tools package can run on the current JVM.

Returns:
True if the build-tools package has a Runtime.Jvm property and it is lesser or equal to the current JVM version. False if the property is present and the requirement is not met. True if there's an error parsing either versions and the comparison cannot be made.

getCurrentJvmVersion

@Nullable
protected com.android.repository.Revision getCurrentJvmVersion()
                                                        throws java.lang.NumberFormatException
Throws:
java.lang.NumberFormatException

toString

public java.lang.String toString()
Returns a debug representation suitable for unit-tests. Note that unit-tests need to clean up the paths to avoid inconsistent results.

Overrides:
toString in class java.lang.Object