diff options
author | Xavier Ducrohet <xav@android.com> | 2012-02-14 14:16:33 -0800 |
---|---|---|
committer | Xavier Ducrohet <xav@android.com> | 2012-02-14 14:16:33 -0800 |
commit | 1dd5c94cbf810129c74213f5ba857265410d736d (patch) | |
tree | 83d54f116f3f5016e2a314b71ca138859a07c42c | |
parent | 90e5a71934ae349aca32845f50909310ae6ec484 (diff) | |
download | sdk-1dd5c94cbf810129c74213f5ba857265410d736d.zip sdk-1dd5c94cbf810129c74213f5ba857265410d736d.tar.gz sdk-1dd5c94cbf810129c74213f5ba857265410d736d.tar.bz2 |
Fix ant issue where annotations.jar causes problems.
Change-Id: Id08c9d187c75ff0e8e6998ef85204f28cf1ed252
-rw-r--r-- | anttasks/src/com/android/ant/AaptExecTask.java | 8 | ||||
-rw-r--r-- | anttasks/src/com/android/ant/NewSetupTask.java | 4 |
2 files changed, 7 insertions, 5 deletions
diff --git a/anttasks/src/com/android/ant/AaptExecTask.java b/anttasks/src/com/android/ant/AaptExecTask.java index 610ce0f..e3bb0a2 100644 --- a/anttasks/src/com/android/ant/AaptExecTask.java +++ b/anttasks/src/com/android/ant/AaptExecTask.java @@ -487,7 +487,7 @@ public final class AaptExecTask extends SingleDependencyTask { } // filters if needed - if (mResourceFilter != null) { + if (mResourceFilter != null && mResourceFilter.length() > 0) { task.createArg().setValue("-c"); task.createArg().setValue(mResourceFilter); } @@ -511,7 +511,7 @@ public final class AaptExecTask extends SingleDependencyTask { } } - if (extraPackages != null) { + if (extraPackages != null && extraPackages.length() > 0) { task.createArg().setValue("--extra-packages"); task.createArg().setValue(extraPackages); } @@ -526,13 +526,13 @@ public final class AaptExecTask extends SingleDependencyTask { task.createArg().setValue(Integer.toString(mVersionCode)); } - if ((mVersionName != null) && (mVersionName.length() > 0)) { + if (mVersionName != null && mVersionName.length() > 0) { task.createArg().setValue("--version-name"); task.createArg().setValue(mVersionName); } // manifest location - if (mManifest != null) { + if (mManifest != null && mManifest.length() > 0) { task.createArg().setValue("-M"); task.createArg().setValue(mManifest); } diff --git a/anttasks/src/com/android/ant/NewSetupTask.java b/anttasks/src/com/android/ant/NewSetupTask.java index b8765da..f3fd9aa 100644 --- a/anttasks/src/com/android/ant/NewSetupTask.java +++ b/anttasks/src/com/android/ant/NewSetupTask.java @@ -528,6 +528,8 @@ public class NewSetupTask extends Task { System.out.println("------------------\n"); + boolean hasLibraries = jarsPath.list().length > 0; + if (androidTarget.getVersion().getApiLevel() <= 15) { System.out.println("API<=15: Adding annotations.jar to the classpath.\n"); @@ -545,7 +547,7 @@ public class NewSetupTask extends Task { antProject.addReference(mProjectLibrariesLibsOut, libsPath); // the rest is done only if there's a library. - if (jarsPath.list().length > 0) { + if (hasLibraries) { antProject.addReference(mProjectLibrariesRootOut, rootPath); antProject.addReference(mProjectLibrariesResOut, resPath); antProject.setProperty(mProjectLibrariesPackageOut, packageStrBuilder.toString()); |