diff options
author | Xavier Ducrohet <xav@android.com> | 2012-01-30 12:41:14 -0800 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2012-01-30 12:41:14 -0800 |
commit | 80f7e60b18da0cbd481a470e3a8965b61b7bf339 (patch) | |
tree | a60d7c0d01e092d9ea10ad8bcc847ec9833cf4f8 /anttasks | |
parent | 98e9214b8b17ddcb49c6e9e0f4263ed7c987d311 (diff) | |
parent | b79938741991aa6d48b28919b92c62113372d8e5 (diff) | |
download | sdk-80f7e60b18da0cbd481a470e3a8965b61b7bf339.zip sdk-80f7e60b18da0cbd481a470e3a8965b61b7bf339.tar.gz sdk-80f7e60b18da0cbd481a470e3a8965b61b7bf339.tar.bz2 |
Merge changes Ifb914125,I32b31a30
* changes:
Fix issue where updated Java files don't trigger a new apk in ant.
Automatically add annotations.jar on the classpath for API<=15
Diffstat (limited to 'anttasks')
-rw-r--r-- | anttasks/src/com/android/ant/InputPath.java | 2 | ||||
-rw-r--r-- | anttasks/src/com/android/ant/NewSetupTask.java | 18 |
2 files changed, 16 insertions, 4 deletions
diff --git a/anttasks/src/com/android/ant/InputPath.java b/anttasks/src/com/android/ant/InputPath.java index 905e7bc..2299f07 100644 --- a/anttasks/src/com/android/ant/InputPath.java +++ b/anttasks/src/com/android/ant/InputPath.java @@ -76,7 +76,7 @@ public class InputPath { */ public boolean ignores(File file) { // always ignore hidden files/folders. - return file.getName().startsWith(".") == false; + return file.getName().startsWith("."); } /** diff --git a/anttasks/src/com/android/ant/NewSetupTask.java b/anttasks/src/com/android/ant/NewSetupTask.java index 46f5b14..29caf6e 100644 --- a/anttasks/src/com/android/ant/NewSetupTask.java +++ b/anttasks/src/com/android/ant/NewSetupTask.java @@ -20,10 +20,10 @@ import com.android.io.FileWrapper; import com.android.io.FolderWrapper; import com.android.sdklib.AndroidVersion; import com.android.sdklib.IAndroidTarget; +import com.android.sdklib.IAndroidTarget.IOptionalLibrary; import com.android.sdklib.ISdkLog; import com.android.sdklib.SdkConstants; import com.android.sdklib.SdkManager; -import com.android.sdklib.IAndroidTarget.IOptionalLibrary; import com.android.sdklib.internal.project.ProjectProperties; import com.android.sdklib.internal.project.ProjectProperties.PropertyType; import com.android.sdklib.xml.AndroidManifest; @@ -282,7 +282,7 @@ public class NewSetupTask extends Task { } // look for referenced libraries. - processReferencedLibraries(antProject, androidTarget); + processReferencedLibraries(antProject, androidTarget, sdkOsPath); // always check the manifest minSdkVersion. checkManifest(antProject, androidTarget.getVersion()); @@ -436,7 +436,8 @@ public class NewSetupTask extends Task { } } - private void processReferencedLibraries(Project antProject, IAndroidTarget androidTarget) { + private void processReferencedLibraries(Project antProject, IAndroidTarget androidTarget, + String sdkLocation) { // prepare several paths for future tasks Path rootPath = new Path(antProject); Path resPath = new Path(antProject); @@ -523,6 +524,17 @@ public class NewSetupTask extends Task { System.out.println("------------------\n"); + if (androidTarget.getVersion().getApiLevel() <= 15) { + System.out.println("API<=15: Adding annotations.jar to the classpath.\n"); + + PathElement element = jarsPath.createPathElement(); + element.setPath(sdkLocation + "/" + SdkConstants.FD_TOOLS + + "/" + SdkConstants.FD_SUPPORT + + "/" + SdkConstants.FN_ANNOTATIONS_JAR); + + System.out.println("------------------\n"); + } + // even with no libraries, always setup these so that various tasks in Ant don't complain // (the task themselves can handle a ref to an empty Path) antProject.addReference(mProjectLibrariesJarsOut, jarsPath); |