public class PlatformTarget extends java.lang.Object implements IAndroidTarget
| Modifier and Type | Class and Description |
|---|---|
static class |
PlatformTarget.Library
Simple struct used by
Gson when parsing the library file. |
IAndroidTarget.OptionalLibrary| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
PLATFORM_VENDOR
Default vendor for platform targets
|
ACTIONS_ACTIVITY, ACTIONS_BROADCAST, ACTIONS_SERVICE, ANDROID_AIDL, ANDROID_JAR, ANT, ATTRIBUTES, CATEGORIES, DATA, DOCS, FONTS, LAYOUT_LIB, MANIFEST_ATTRIBUTES, RESOURCES, SAMPLES, SKINS, SOURCES, TEMPLATES, UI_AUTOMATOR_JAR, WIDGETS| Constructor and Description |
|---|
PlatformTarget(com.android.repository.api.LocalPackage p,
AndroidSdkHandler sdkHandler,
com.android.repository.io.FileOp fop,
com.android.repository.api.ProgressIndicator progress)
Construct a new
PlatformTarget based on the given package. |
| Modifier and Type | Method and Description |
|---|---|
boolean |
canRunOn(IAndroidTarget target)
Returns whether the given target is compatible with the receiver.
|
int |
compareTo(IAndroidTarget o) |
boolean |
equals(java.lang.Object obj) |
java.util.List<IAndroidTarget.OptionalLibrary> |
getAdditionalLibraries()
Returns the additional libraries for this target.
|
java.util.List<java.lang.String> |
getBootClasspath()
Returns the boot classpath for this target.
|
BuildToolInfo |
getBuildToolInfo()
Returns a BuildToolInfo for backward compatibility.
|
java.lang.String |
getClasspathName()
Returns the name to be displayed when representing all the libraries this target contains.
|
java.io.File |
getDefaultSkin()
Returns the default skin folder for this target.
|
java.lang.String |
getDescription()
Returns the description of the target.
|
java.io.File |
getFile(int pathId)
Returns the path of a platform component.
|
java.lang.String |
getFullName()
Returns the full name of the target, possibly including vendor name.
|
int |
getLayoutlibApi() |
java.lang.String |
getLocation()
Returns the target location.
|
java.lang.String |
getName()
Returns the name of the target.
|
java.util.List<IAndroidTarget.OptionalLibrary> |
getOptionalLibraries()
Returns a list of optional libraries for this target.
|
IAndroidTarget |
getParent()
Returns the parent target.
|
java.lang.String |
getPath(int pathId)
Returns the path of a platform component.
|
java.lang.String[] |
getPlatformLibraries()
Returns the list of libraries available for a given platform.
|
java.util.Map<java.lang.String,java.lang.String> |
getProperties()
Returns all the properties associated with this target.
|
java.lang.String |
getProperty(java.lang.String name)
Return the value of a given property for this target.
|
int |
getRevision()
Returns the revision number for the target.
|
java.lang.String |
getShortClasspathName()
Returns the name to be displayed when representing all the libraries this target contains.
|
java.io.File[] |
getSkins()
Returns the available skin folders for this target.
|
java.lang.String |
getVendor()
Returns the name of the vendor of the target.
|
com.android.sdklib.AndroidVersion |
getVersion()
Returns the version of the target.
|
java.lang.String |
getVersionName()
Returns the platform version as a readable string.
|
int |
hashCode() |
java.lang.String |
hashString()
Returns a string able to uniquely identify a target.
|
boolean |
hasRenderingLibrary()
Returns whether the target is able to render layouts.
|
boolean |
isPlatform()
Returns true if the target is a standard Android platform.
|
void |
setSources(java.io.File location) |
public static final java.lang.String PLATFORM_VENDOR
public PlatformTarget(@NonNull
com.android.repository.api.LocalPackage p,
@NonNull
AndroidSdkHandler sdkHandler,
@NonNull
com.android.repository.io.FileOp fop,
@NonNull
com.android.repository.api.ProgressIndicator progress)
PlatformTarget based on the given package.public void setSources(@Nullable
java.io.File location)
public java.lang.String getLocation()
IAndroidTargetgetLocation in interface IAndroidTargetpublic java.lang.String getVendor()
PLATFORM_VENDORgetVendor in interface IAndroidTargetpublic java.lang.String getName()
IAndroidTargetgetName in interface IAndroidTargetpublic java.lang.String getFullName()
IAndroidTargetgetFullName in interface IAndroidTargetpublic java.lang.String getDescription()
IAndroidTargetgetDescription in interface IAndroidTarget@NonNull public com.android.sdklib.AndroidVersion getVersion()
IAndroidTargetgetVersion in interface IAndroidTargetpublic java.lang.String getVersionName()
IAndroidTargetgetVersionName in interface IAndroidTargetpublic int getRevision()
IAndroidTargetgetRevision in interface IAndroidTargetpublic boolean isPlatform()
IAndroidTargetisPlatform in interface IAndroidTargetpublic IAndroidTarget getParent()
IAndroidTargetnull if
IAndroidTarget.isPlatform() returns falsegetParent in interface IAndroidTarget@NonNull public java.lang.String getPath(int pathId)
IAndroidTargetgetPath in interface IAndroidTargetpathId - the id representing the path to return.
Any of the constants defined in the IAndroidTarget interface can be used.@NonNull public java.io.File getFile(int pathId)
IAndroidTarget
This is like the legacy IAndroidTarget.getPath(int) method except it returns a File.
getFile in interface IAndroidTargetpathId - the id representing the path to return.
Any of the constants defined in the IAndroidTarget interface can be used.@Nullable public BuildToolInfo getBuildToolInfo()
IAndroidTargetgetBuildToolInfo in interface IAndroidTarget@NonNull public java.util.List<java.lang.String> getBootClasspath()
IAndroidTargetIAndroidTarget.getPath(int) with
IAndroidTarget.ANDROID_JAR.getBootClasspath in interface IAndroidTarget@NonNull public java.util.List<IAndroidTarget.OptionalLibrary> getOptionalLibraries()
IAndroidTargetThese libraries are not automatically added to the classpath. Using them requires adding a
uses-library entry in the manifest and calling useLibrary in the Gradle
build script. Example of such library is org.apache.http.legacy which is not on the
classpath by default since 6.0.
getOptionalLibraries in interface IAndroidTargetIAndroidTarget.OptionalLibrary.getName()@NonNull public java.util.List<IAndroidTarget.OptionalLibrary> getAdditionalLibraries()
IAndroidTargetThese libraries are automatically added to the classpath, but using them requires
adding a uses-library entry in the manifest. Example of such library is
com.google.android.maps, which is part of the Google APIs add-on.
getAdditionalLibraries in interface IAndroidTargetIAndroidTarget.OptionalLibrary.getName()public boolean hasRenderingLibrary()
IAndroidTargethasRenderingLibrary in interface IAndroidTarget@NonNull public java.io.File[] getSkins()
IAndroidTarget
To get the skin names, use File.getName().
Skins come either from:
sdk/platforms/N/skins/name)sdk/addons/name/skins/name)sdk/system-images/platform-N/tag/abi/skins/name.)getSkins in interface IAndroidTargetpublic int getLayoutlibApi()
@Nullable public java.io.File getDefaultSkin()
IAndroidTarget
To get the skin name, use File.getName().
getDefaultSkin in interface IAndroidTarget@NonNull public java.lang.String[] getPlatformLibraries()
SdkConstants.ANDROID_TEST_RUNNER_LIB.getPlatformLibraries in interface IAndroidTargetnull if there is none.@Nullable
public java.lang.String getProperty(@NonNull
java.lang.String name)
IAndroidTargetgetProperty in interface IAndroidTargetnull if it was not found.@Nullable public java.util.Map<java.lang.String,java.lang.String> getProperties()
IAndroidTargetgetProperties in interface IAndroidTarget@NonNull public java.lang.String getShortClasspathName()
IAndroidTargetgetShortClasspathName in interface IAndroidTarget@NonNull public java.lang.String getClasspathName()
IAndroidTargetgetClasspathName in interface IAndroidTargetpublic boolean canRunOn(@NonNull
IAndroidTarget target)
IAndroidTarget
This means that a project using the receiver's target can run on the given target.
Example:
CupcakeTarget.canRunOn(DonutTarget) == true.
canRunOn in interface IAndroidTargettarget - the IAndroidTarget to test.@NonNull public java.lang.String hashString()
IAndroidTarget
See AndroidTargetHash for helper methods to manipulate hash strings.
hashString in interface IAndroidTargetpublic int compareTo(@NonNull
IAndroidTarget o)
compareTo in interface java.lang.Comparable<IAndroidTarget>public boolean equals(java.lang.Object obj)
equals in class java.lang.Objectpublic int hashCode()
hashCode in class java.lang.Object