diff options
author | Android (Google) Code Review <android-gerrit@google.com> | 2009-08-25 16:52:21 -0700 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2009-08-25 16:52:21 -0700 |
commit | f31831e6af48a7508d1b5f7e2169ef80237404f0 (patch) | |
tree | 7b9c0ad4c1f76bd701524b13f717070a2f295ff1 | |
parent | 7dc0ad6f4afc48e2407b94008eb03db9a3219ed6 (diff) | |
parent | 889ecf9fe2b0f0987febf43e2ce9991705efa8b2 (diff) | |
download | sdk-f31831e6af48a7508d1b5f7e2169ef80237404f0.zip sdk-f31831e6af48a7508d1b5f7e2169ef80237404f0.tar.gz sdk-f31831e6af48a7508d1b5f7e2169ef80237404f0.tar.bz2 |
Merge change 22676 into eclair
* changes:
Ant properties names legacy support
-rw-r--r-- | anttasks/src/com/android/ant/SetupTask.java | 24 | ||||
-rw-r--r-- | sdkmanager/libs/sdklib/src/com/android/sdklib/internal/project/ProjectProperties.java | 8 |
2 files changed, 27 insertions, 5 deletions
diff --git a/anttasks/src/com/android/ant/SetupTask.java b/anttasks/src/com/android/ant/SetupTask.java index e25d584..cf85d50 100644 --- a/anttasks/src/com/android/ant/SetupTask.java +++ b/anttasks/src/com/android/ant/SetupTask.java @@ -61,8 +61,12 @@ public final class SetupTask extends ImportTask { // ant property with the path to the android.jar private final static String PROPERTY_ANDROID_JAR = "android.jar"; + // LEGACY - compatibility with 1.6 and before + private final static String PROPERTY_ANDROID_JAR_LEGACY = "android-jar"; // ant property with the path to the framework.jar private final static String PROPERTY_ANDROID_AIDL = "android.aidl"; + // LEGACY - compatibility with 1.6 and before + private final static String PROPERTY_ANDROID_AIDL_LEGACY = "android-aidl"; // ant property with the path to the aapt tool private final static String PROPERTY_AAPT = "aapt"; // ant property with the path to the aidl tool @@ -83,7 +87,10 @@ public final class SetupTask extends ImportTask { // check if it's valid and exists if (sdkLocation == null || sdkLocation.length() == 0) { - throw new BuildException("SDK Location is not set."); + sdkLocation = antProject.getProperty(ProjectProperties.PROPERTY_SDK_LEGACY); + if (sdkLocation == null || sdkLocation.length() == 0) { + throw new BuildException("SDK Location is not set."); + } } File sdk = new File(sdkLocation); @@ -152,8 +159,9 @@ public final class SetupTask extends ImportTask { String androidJar = androidTarget.getPath(IAndroidTarget.ANDROID_JAR); antProject.setProperty(PROPERTY_ANDROID_JAR, androidJar); - antProject.setProperty(PROPERTY_ANDROID_AIDL, - androidTarget.getPath(IAndroidTarget.ANDROID_AIDL)); + String androidAidl = androidTarget.getPath(IAndroidTarget.ANDROID_AIDL); + antProject.setProperty(PROPERTY_ANDROID_AIDL, androidAidl); + antProject.setProperty(PROPERTY_AAPT, androidTarget.getPath(IAndroidTarget.AAPT)); antProject.setProperty(PROPERTY_AIDL, androidTarget.getPath(IAndroidTarget.AIDL)); antProject.setProperty(PROPERTY_DX, androidTarget.getPath(IAndroidTarget.DX)); @@ -188,6 +196,16 @@ public final class SetupTask extends ImportTask { // find the file to import, and import it. String templateFolder = androidTarget.getPath(IAndroidTarget.TEMPLATES); + // legacy support + if (androidTarget.getVersion().getApiLevel() <= 4) { // 1.6 and earlier + antProject.setProperty(PROPERTY_ANDROID_JAR_LEGACY, androidJar); + antProject.setProperty(PROPERTY_ANDROID_AIDL_LEGACY, androidAidl); + String appPackage = antProject.getProperty(ProjectProperties.PROPERTY_APP_PACKAGE); + if (appPackage != null && appPackage.length() > 0) { + antProject.setProperty(ProjectProperties.PROPERTY_APP_PACKAGE_LEGACY, appPackage); + } + } + // Now the import section. This is only executed if the task actually has to import a file. if (mDoImport) { // make sure the file exists. diff --git a/sdkmanager/libs/sdklib/src/com/android/sdklib/internal/project/ProjectProperties.java b/sdkmanager/libs/sdklib/src/com/android/sdklib/internal/project/ProjectProperties.java index 8ab7fcb..b3c172b 100644 --- a/sdkmanager/libs/sdklib/src/com/android/sdklib/internal/project/ProjectProperties.java +++ b/sdkmanager/libs/sdklib/src/com/android/sdklib/internal/project/ProjectProperties.java @@ -37,7 +37,11 @@ public final class ProjectProperties { public final static String PROPERTY_TARGET = "target"; public final static String PROPERTY_APK_CONFIGS = "apk.configurations"; public final static String PROPERTY_SDK = "sdk.dir"; + // LEGACY - compatibility with 1.6 and before + public final static String PROPERTY_SDK_LEGACY = "sdk-location"; public final static String PROPERTY_APP_PACKAGE = "application.package"; + // LEGACY - compatibility with 1.6 and before + public final static String PROPERTY_APP_PACKAGE_LEGACY = "application-package"; public static enum PropertyType { BUILD("build.properties", BUILD_HEADER), @@ -88,8 +92,8 @@ public final class ProjectProperties { "# This file is only used by the Ant script.\n" + "\n" + "# You can use this to override default values such as\n" + - "# 'source-folder' for the location of your java source folder and\n" + - "# 'out-folder' for the location of your output folder.\n" + + "# 'source.dir' for the location of your java source folder and\n" + + "# 'out.dir' for the location of your output folder.\n" + "\n" + "# You can also use it define how the release builds are signed by declaring\n" + "# the following properties:\n" + |