Package com.android.sdklib
Class BuildToolInfo
- java.lang.Object
-
- com.android.sdklib.BuildToolInfo
-
public class BuildToolInfo extends java.lang.ObjectInformation 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
Nested Classes Modifier and Type Class Description static classBuildToolInfo.PathId
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static BuildToolInfofromLocalPackage(com.android.repository.api.LocalPackage localPackage)Creates aBuildToolInfofrom aLocalPackage.static BuildToolInfofromStandardDirectoryLayout(com.android.repository.Revision revision, java.nio.file.Path path)Creates aBuildToolInfofrom a directory which follows the standard layout convention.java.nio.file.PathgetLocation()Returns the build-tool revision-specific folder.java.lang.StringgetPath(BuildToolInfo.PathId pathId)Returns the path of a build-tool component.com.android.repository.RevisiongetRevision()Returns the revision.booleanisValid(com.android.utils.ILogger log)Checks whether the build-tool is valid by verifying that the expected binaries are actually present.static BuildToolInfomodifiedLayout(com.android.repository.Revision revision, java.nio.file.Path mainPath, java.nio.file.Path aapt, java.nio.file.Path aidl, java.nio.file.Path llmvRsCc, java.nio.file.Path androidRs, java.nio.file.Path androidRsClang, java.nio.file.Path bccCompat, java.nio.file.Path ldArm, java.nio.file.Path ldArm64, java.nio.file.Path ldX86, java.nio.file.Path ldX86_64, java.nio.file.Path ldMips, java.nio.file.Path lld, java.nio.file.Path zipAlign, java.nio.file.Path aapt2)Creates a fullBuildToolInfofrom the specified paths.static BuildToolInfopartial(com.android.repository.Revision revision, java.nio.file.Path location, java.util.Map<BuildToolInfo.PathId,java.nio.file.Path> paths)Creates a newBuildToolInfowhere only some tools are present.java.lang.StringtoString()Returns a debug representation suitable for unit-tests.
-
-
-
Method Detail
-
fromStandardDirectoryLayout
@NonNull public static BuildToolInfo fromStandardDirectoryLayout(@NonNull com.android.repository.Revision revision, @NonNull java.nio.file.Path path)
Creates aBuildToolInfofrom a directory which follows the standard layout convention.
-
fromLocalPackage
@NonNull public static BuildToolInfo fromLocalPackage(@NonNull com.android.repository.api.LocalPackage localPackage)
Creates aBuildToolInfofrom aLocalPackage.
-
modifiedLayout
@NonNull public static BuildToolInfo modifiedLayout(@NonNull com.android.repository.Revision revision, @NonNull java.nio.file.Path mainPath, @NonNull java.nio.file.Path aapt, @NonNull java.nio.file.Path aidl, @NonNull java.nio.file.Path llmvRsCc, @NonNull java.nio.file.Path androidRs, @NonNull java.nio.file.Path androidRsClang, @Nullable java.nio.file.Path bccCompat, @Nullable java.nio.file.Path ldArm, @Nullable java.nio.file.Path ldArm64, @Nullable java.nio.file.Path ldX86, @Nullable java.nio.file.Path ldX86_64, @Nullable java.nio.file.Path ldMips, @Nullable java.nio.file.Path lld, @NonNull java.nio.file.Path zipAlign, @Nullable java.nio.file.Path aapt2)
Creates a fullBuildToolInfofrom the specified paths.The
Nullablepaths can only be null if corresponding tools were not present in the specified version of build tools.
-
partial
@NonNull public static BuildToolInfo partial(@NonNull com.android.repository.Revision revision, @NonNull java.nio.file.Path location, @NonNull java.util.Map<BuildToolInfo.PathId,java.nio.file.Path> paths)
Creates a newBuildToolInfowhere only some tools are present.This may be the case when paths are managed by an external build system.
-
getRevision
@NonNull public com.android.repository.Revision getRevision()
Returns the revision.
-
getLocation
@NonNull public java.nio.file.Path 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.
-
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:
toStringin classjava.lang.Object
-
-