ADT #1825491: Provide default choices for <uses-library>
We currently hardcode a list in the PlatformTarget and propagate it to the UI via the AndroidTargetParser. This way we can later decide to actually get the info from some kind of manifest.
This commit is contained in:
@@ -192,6 +192,15 @@ final class AddOnTarget implements IAndroidTarget {
|
||||
return mLibraries;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the list of libraries of the underlying platform.
|
||||
*
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
public String[] getPlatformLibraries() {
|
||||
return mBasePlatform.getPlatformLibraries();
|
||||
}
|
||||
|
||||
public boolean isCompatibleBaseFor(IAndroidTarget target) {
|
||||
// basic test
|
||||
if (target == this) {
|
||||
|
||||
@@ -149,7 +149,14 @@ public interface IAndroidTarget extends Comparable<IAndroidTarget> {
|
||||
* @return an array of optional libraries or <code>null</code> if there is none.
|
||||
*/
|
||||
IOptionalLibrary[] getOptionalLibraries();
|
||||
|
||||
|
||||
/**
|
||||
* Returns the list of libraries available for a given platform.
|
||||
*
|
||||
* @return an array of libraries provided by the platform or <code>null</code> if there is none.
|
||||
*/
|
||||
String[] getPlatformLibraries();
|
||||
|
||||
/**
|
||||
* Returns whether the given target is compatible with the receiver.
|
||||
* <p/>A target is considered compatible if applications developed for the receiver can run on
|
||||
|
||||
@@ -149,15 +149,25 @@ final class PlatformTarget implements IAndroidTarget {
|
||||
return "HVGA";
|
||||
}
|
||||
|
||||
/*
|
||||
* Always returns null, as a standard platforms have no optional libraries.
|
||||
/**
|
||||
* Always returns null, as a standard platform ha no optional libraries.
|
||||
*
|
||||
* (non-Javadoc)
|
||||
* {@inheritDoc}
|
||||
* @see com.android.sdklib.IAndroidTarget#getOptionalLibraries()
|
||||
*/
|
||||
public IOptionalLibrary[] getOptionalLibraries() {
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Currently always return a fixed list with "android.test.runner" in it.
|
||||
* <p/>
|
||||
* TODO change the fixed library list to be build-dependent later.
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
public String[] getPlatformLibraries() {
|
||||
return new String[] { SdkConstants.ANDROID_TEST_RUNNER_LIB };
|
||||
}
|
||||
|
||||
public boolean isCompatibleBaseFor(IAndroidTarget target) {
|
||||
// basic test
|
||||
|
||||
@@ -167,6 +167,9 @@ public final class SdkConstants {
|
||||
/** Namespace for the resource XML, i.e. "http://schemas.android.com/apk/res/android" */
|
||||
public final static String NS_RESOURCES = "http://schemas.android.com/apk/res/android";
|
||||
|
||||
/** The name of the uses-library that provides "android.test.runner" */
|
||||
public final static String ANDROID_TEST_RUNNER_LIB = "android.test.runner";
|
||||
|
||||
/* Folder path relative to the SDK root */
|
||||
/** Path of the documentation directory relative to the sdk folder.
|
||||
* This is an OS path, ending with a separator. */
|
||||
|
||||
Reference in New Issue
Block a user