aboutsummaryrefslogtreecommitdiffstats
path: root/anttasks/src
diff options
context:
space:
mode:
authorXavier Ducrohet <xav@android.com>2009-08-25 18:11:28 -0700
committerXavier Ducrohet <xav@android.com>2009-08-25 18:17:07 -0700
commita7616f45f97caeccb7b79bfc04f018d5f41963fc (patch)
tree354f62c90c07e61f006fc00153637baee8b40a3f /anttasks/src
parente5ade54ae11d7b374ffc07a4454e5676a47efd5a (diff)
downloadsdk-a7616f45f97caeccb7b79bfc04f018d5f41963fc.zip
sdk-a7616f45f97caeccb7b79bfc04f018d5f41963fc.tar.gz
sdk-a7616f45f97caeccb7b79bfc04f018d5f41963fc.tar.bz2
Make sure older rules files can find the SDK Location.
Change-Id: Idb2463f07c233015927181e79955ae71e10dcb19
Diffstat (limited to 'anttasks/src')
-rw-r--r--anttasks/src/com/android/ant/SetupTask.java7
1 files changed, 6 insertions, 1 deletions
diff --git a/anttasks/src/com/android/ant/SetupTask.java b/anttasks/src/com/android/ant/SetupTask.java
index cf85d50..ffe8314 100644
--- a/anttasks/src/com/android/ant/SetupTask.java
+++ b/anttasks/src/com/android/ant/SetupTask.java
@@ -87,6 +87,9 @@ public final class SetupTask extends ImportTask {
// check if it's valid and exists
if (sdkLocation == null || sdkLocation.length() == 0) {
+ // LEGACY support: project created with 1.6 or before may be using a different
+ // property to declare the location of the SDK. At this point, we cannot
+ // yet check which target is running so we check both always.
sdkLocation = antProject.getProperty(ProjectProperties.PROPERTY_SDK_LEGACY);
if (sdkLocation == null || sdkLocation.length() == 0) {
throw new BuildException("SDK Location is not set.");
@@ -196,10 +199,12 @@ public final class SetupTask extends ImportTask {
// find the file to import, and import it.
String templateFolder = androidTarget.getPath(IAndroidTarget.TEMPLATES);
- // legacy support
+ // LEGACY support. android_rules.xml in older platforms expects properties with
+ // older names. This sets those properties to make sure the rules will work.
if (androidTarget.getVersion().getApiLevel() <= 4) { // 1.6 and earlier
antProject.setProperty(PROPERTY_ANDROID_JAR_LEGACY, androidJar);
antProject.setProperty(PROPERTY_ANDROID_AIDL_LEGACY, androidAidl);
+ antProject.setProperty(ProjectProperties.PROPERTY_SDK_LEGACY, sdkLocation);
String appPackage = antProject.getProperty(ProjectProperties.PROPERTY_APP_PACKAGE);
if (appPackage != null && appPackage.length() > 0) {
antProject.setProperty(ProjectProperties.PROPERTY_APP_PACKAGE_LEGACY, appPackage);