OSDN Git Service

Fix target loading when sdk.properties is not present.
authorXavier Ducrohet <xav@android.com>
Fri, 24 Sep 2010 14:41:30 +0000 (07:41 -0700)
committerXavier Ducrohet <xav@android.com>
Fri, 24 Sep 2010 14:41:30 +0000 (07:41 -0700)
Older (obsolete) targets would fail to load if
sdk.properties was not present. Since the content
is optional anyway, it's ok to load the target.

Change-Id: I6539be1450e72096de7b651e1c9137b41060e315

sdkmanager/libs/sdklib/src/com/android/sdklib/SdkManager.java

index ad9e390..32c5838 100644 (file)
@@ -335,8 +335,10 @@ public final class SdkManager {
 
                 // Ant properties
                 FileWrapper sdkPropFile = new FileWrapper(platformFolder, SdkConstants.FN_SDK_PROP);
-                Map<String, String> antProp = ProjectProperties.parsePropertyFile(
-                        sdkPropFile, log);
+                Map<String, String> antProp = null;
+                if (sdkPropFile.isFile()) { // obsolete platforms don't have this.
+                    antProp = ProjectProperties.parsePropertyFile(sdkPropFile, log);
+                }
 
                 if (antProp != null) {
                     map.putAll(antProp);