aboutsummaryrefslogtreecommitdiffstats
path: root/sdkmanager/app/src
diff options
context:
space:
mode:
authorRaphael <raphael@google.com>2011-09-07 11:32:31 -0700
committerRaphael <raphael@google.com>2011-09-08 09:18:52 -0700
commitf481ad78b0039368eeee4bda63c6c645ceb4837e (patch)
tree2e1ea25e32d3286233aac4cbbf03e2983a74a97b /sdkmanager/app/src
parent02db530a055a7656cc5f3b453638c9558cbc22df (diff)
downloadsdk-f481ad78b0039368eeee4bda63c6c645ceb4837e.zip
sdk-f481ad78b0039368eeee4bda63c6c645ceb4837e.tar.gz
sdk-f481ad78b0039368eeee4bda63c6c645ceb4837e.tar.bz2
Load standalone system images in the SdkManager.
This revamps the way system images are handled in the internal SdkManager class. Before, a given IAndroidTarget could provide a list of ABI strings it new about, discovered by parsing the SDK/platform/images/xyz or SDK/addon/images/xyz folder. This introduces the notion of System Image to an IAndroidTarget. A system image combines an ABI with a location strategy (legacy images folder, images sub-folder or standalone sdk/system-images folder) and an actual location path. Change-Id: If5b748aa9aef6788bc3c814818381c7918b40bca
Diffstat (limited to 'sdkmanager/app/src')
-rw-r--r--sdkmanager/app/src/com/android/sdkmanager/Main.java21
1 files changed, 12 insertions, 9 deletions
diff --git a/sdkmanager/app/src/com/android/sdkmanager/Main.java b/sdkmanager/app/src/com/android/sdkmanager/Main.java
index 192e0a4..f699773 100644
--- a/sdkmanager/app/src/com/android/sdkmanager/Main.java
+++ b/sdkmanager/app/src/com/android/sdkmanager/Main.java
@@ -23,6 +23,7 @@ import com.android.prefs.AndroidLocation;
import com.android.prefs.AndroidLocation.AndroidLocationException;
import com.android.sdklib.IAndroidTarget;
import com.android.sdklib.ISdkLog;
+import com.android.sdklib.ISystemImage;
import com.android.sdklib.SdkConstants;
import com.android.sdklib.SdkManager;
import com.android.sdklib.IAndroidTarget.IOptionalLibrary;
@@ -775,6 +776,7 @@ public class Main {
int index = 1;
for (IAndroidTarget target : mSdkManager.getTargets()) {
+ mSdkLog.printf("----------\n");
mSdkLog.printf("id: %1$d or \"%2$s\"\n", index, target.hashString());
mSdkLog.printf(" Name: %s\n", target.getName());
if (target.isPlatform()) {
@@ -803,8 +805,9 @@ public class Main {
}
}
- // get the target skins
+ // get the target skins & ABIs
displaySkinList(target, " Skins: ");
+ displayAbiList (target, " ABIs : ");
if (target.getUsbVendorId() != IAndroidTarget.NO_USB_ID) {
mSdkLog.printf(" Adds USB support for devices (Vendor: 0x%04X)\n",
@@ -846,17 +849,17 @@ public class Main {
* Displays the ABIs valid for the given target.
*/
private void displayAbiList(IAndroidTarget target, String message) {
- String[] abis = target.getAbiList();
+ ISystemImage[] systemImages = target.getSystemImages();
mSdkLog.printf(message);
- if (abis != null) {
+ if (systemImages.length > 0) {
boolean first = true;
- for (String skin : abis) {
+ for (ISystemImage si : systemImages) {
if (first == false) {
mSdkLog.printf(", ");
} else {
first = false;
}
- mSdkLog.printf(skin);
+ mSdkLog.printf(si.getAbiType());
}
mSdkLog.printf("\n");
} else {
@@ -906,6 +909,7 @@ public class Main {
mSdkLog.printf(" Based on Android %s (API level %s)\n",
target.getVersionName(), target.getVersion().getApiString());
}
+ mSdkLog.printf(" ABI: %s\n", info.getAbiType());
// display some extra values.
Map<String, String> properties = info.getProperties();
@@ -1069,16 +1073,15 @@ public class Main {
String abiType = mSdkCommandLine.getParamAbi();
if (target != null && (abiType == null || abiType.length() == 0)) {
- String[] abis = target.getAbiList();
- if (abis != null && abis.length == 1) {
+ ISystemImage[] systemImages = target.getSystemImages();
+ if (systemImages != null && systemImages.length == 1) {
// Auto-select the single ABI available
- abiType = abis[0];
+ abiType = systemImages[0].getAbiType();
mSdkLog.printf("Auto-selecting single ABI %1$s", abiType);
} else {
displayAbiList(target, "Valid ABIs: ");
errorAndExit("This platform has more than one ABI. Please specify one using --%1$s.",
SdkCommandLine.KEY_ABI);
-
}
}