|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.android.sdklib.SdkManager
public class SdkManager
The SDK manager parses the SDK folder and gives access to the content.
PlatformTarget,
AddOnTarget| Nested Class Summary | |
|---|---|
static class |
SdkManager.LayoutlibVersion
|
| Field Summary | |
|---|---|
static java.lang.String |
ADDON_API
|
static java.lang.String |
ADDON_DEFAULT_SKIN
|
static java.lang.String |
ADDON_DESCRIPTION
|
static java.lang.String |
ADDON_LIBRARIES
|
static java.lang.String |
ADDON_NAME
|
static java.lang.String |
ADDON_REVISION
|
static java.lang.String |
ADDON_REVISION_OLD
|
static java.lang.String |
ADDON_USB_VENDOR
|
static java.lang.String |
ADDON_VENDOR
|
static java.lang.String |
PROP_VERSION_CODENAME
|
static java.lang.String |
PROP_VERSION_RELEASE
|
static java.lang.String |
PROP_VERSION_SDK
|
| Constructor Summary | |
|---|---|
protected |
SdkManager(java.lang.String osSdkPath)
Create a new SdkManager instance. |
| Method Summary | |
|---|---|
static SdkManager |
createManager(java.lang.String osSdkPath,
com.android.utils.ILogger log)
Creates an SdkManager for a given sdk location. |
BuildToolInfo |
getBuildTool(FullRevision revision)
Returns the BuildToolInfo for the given revision. |
java.util.Set<FullRevision> |
getBuildTools()
Returns an unmodifiable set of known build-tools revisions. |
java.util.Map<java.io.File,java.lang.String> |
getExtraSamples()
Returns a map of the root samples directories located in the SDK/extras packages. |
java.util.Map<java.lang.String,java.lang.Integer> |
getExtrasVersions()
Returns a map of all the extras found in the local SDK with their major revision. |
BuildToolInfo |
getLatestBuildTool()
Returns the highest build-tool revision known. |
java.lang.String |
getLocation()
Returns the location of the SDK. |
SdkManager.LayoutlibVersion |
getMaxLayoutlibVersion()
Deprecated. This does NOT solve the right problem and will be changed later. |
java.lang.String |
getPlatformToolsVersion()
Returns the platform tools version if installed, null otherwise. |
IAndroidTarget |
getTargetFromHashString(java.lang.String hash)
Returns a target from a hash that was generated by IAndroidTarget.hashString(). |
IAndroidTarget[] |
getTargets()
Returns the targets that are available in the SDK. |
boolean |
hasChanged()
Checks whether any of the SDK platforms/add-ons/build-tools have changed on-disk since we last loaded the SDK. |
boolean |
hasChanged(com.android.utils.ILogger log)
Checks whether any of the SDK platforms/add-ons/build-tools have changed on-disk since we last loaded the SDK. |
static com.android.utils.Pair<java.util.Map<java.lang.String,java.lang.String>,java.lang.String> |
parseAddonProperties(java.io.File addonDir,
IAndroidTarget[] targetList,
com.android.utils.ILogger log)
Parses the add-on properties and decodes any error that occurs when loading an addon. |
void |
reloadSdk(com.android.utils.ILogger log)
Reloads the content of the SDK. |
protected void |
setTargets(IAndroidTarget[] targets)
Sets the targets that are available in the SDK. |
void |
updateAdb()
Updates adb with the USB devices declared in the SDK add-ons. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final java.lang.String PROP_VERSION_SDK
public static final java.lang.String PROP_VERSION_CODENAME
public static final java.lang.String PROP_VERSION_RELEASE
public static final java.lang.String ADDON_NAME
public static final java.lang.String ADDON_VENDOR
public static final java.lang.String ADDON_API
public static final java.lang.String ADDON_DESCRIPTION
public static final java.lang.String ADDON_LIBRARIES
public static final java.lang.String ADDON_DEFAULT_SKIN
public static final java.lang.String ADDON_USB_VENDOR
public static final java.lang.String ADDON_REVISION
public static final java.lang.String ADDON_REVISION_OLD
| Constructor Detail |
|---|
protected SdkManager(@NonNull
java.lang.String osSdkPath)
SdkManager instance.
External users should use createManager(String, ILogger).
osSdkPath - the location of the SDK.| Method Detail |
|---|
@Nullable
public static SdkManager createManager(@NonNull
java.lang.String osSdkPath,
@NonNull
com.android.utils.ILogger log)
SdkManager for a given sdk location.
osSdkPath - the location of the SDK.log - the ILogger object receiving warning/error from the parsing.
SdkManager or null if the location is not valid.
public void reloadSdk(@NonNull
com.android.utils.ILogger log)
log - the ILogger object receiving warning/error from the parsing.public boolean hasChanged()
public boolean hasChanged(@Nullable
com.android.utils.ILogger log)
log - An optional logger used to print verbose info on what changed. Can be null.
@NonNull public java.lang.String getLocation()
@NonNull public IAndroidTarget[] getTargets()
protected void setTargets(@NonNull
IAndroidTarget[] targets)
@NonNull public java.util.Set<FullRevision> getBuildTools()
@Nullable public BuildToolInfo getLatestBuildTool()
@Nullable
public BuildToolInfo getBuildTool(@Nullable
FullRevision revision)
BuildToolInfo for the given revision.
revision - The requested revision.
BuildToolInfo. Can be null if revision is null or is
not part of the known set returned by getBuildTools().
@Nullable
public IAndroidTarget getTargetFromHashString(@Nullable
java.lang.String hash)
IAndroidTarget.hashString().
hash - the IAndroidTarget hash string.
IAndroidTarget or null.
public void updateAdb()
throws com.android.prefs.AndroidLocation.AndroidLocationException,
java.io.IOException
com.android.prefs.AndroidLocation.AndroidLocationException
java.io.IOException@Deprecated @Nullable public SdkManager.LayoutlibVersion getMaxLayoutlibVersion()
SdkManager.LayoutlibVersion found amongst all platform
targets currently loaded in the SDK.
We only started recording Layoutlib Versions recently in the platform meta data
so it's possible to have an SDK with many platforms loaded but no layoutlib
version defined.
SdkManager.LayoutlibVersion or null if none is found.@NonNull public java.util.Map<java.io.File,java.lang.String> getExtraSamples()
@NonNull public java.util.Map<java.lang.String,java.lang.Integer> getExtrasVersions()
@Nullable public java.lang.String getPlatformToolsVersion()
@NonNull
public static com.android.utils.Pair<java.util.Map<java.lang.String,java.lang.String>,java.lang.String> parseAddonProperties(@NonNull
java.io.File addonDir,
@NonNull
IAndroidTarget[] targetList,
@NonNull
com.android.utils.ILogger log)
addonDir - the location of the addon directory.targetList - The list of Android target that were already loaded from the SDK.log - the ILogger object receiving warning/error from the parsing.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||