aboutsummaryrefslogtreecommitdiffstats
path: root/anttasks
diff options
context:
space:
mode:
Diffstat (limited to 'anttasks')
-rw-r--r--anttasks/src/com/android/ant/AaptExecTask.java38
1 files changed, 18 insertions, 20 deletions
diff --git a/anttasks/src/com/android/ant/AaptExecTask.java b/anttasks/src/com/android/ant/AaptExecTask.java
index 2b57277..c96f7d0 100644
--- a/anttasks/src/com/android/ant/AaptExecTask.java
+++ b/anttasks/src/com/android/ant/AaptExecTask.java
@@ -97,6 +97,7 @@ public final class AaptExecTask extends SingleDependencyTask {
private String mLibraryPackagesRefid;
private boolean mNonConstantId;
private String mIgnoreAssets;
+ private String mProguardFile;
/**
* Input path that ignores the same folders/files that aapt does.
@@ -321,6 +322,10 @@ public final class AaptExecTask extends SingleDependencyTask {
mLibraryPackagesRefid = libraryPackagesRefid;
}
+ public void setProguardFile(Path proguardFile) {
+ mProguardFile = TaskHelper.checkSinglePath("proguardFile", proguardFile);
+ }
+
/**
* Returns an object representing a nested <var>nocompress</var> element.
*/
@@ -344,6 +349,11 @@ public final class AaptExecTask extends SingleDependencyTask {
return path;
}
+ @Override
+ protected String getExecTaskName() {
+ return "aapt";
+ }
+
/*
* (non-Javadoc)
*
@@ -375,24 +385,6 @@ public final class AaptExecTask extends SingleDependencyTask {
libPkgProp = libPkgProp.replace(';', ':');
}
}
- // Call aapt. If there are libraries, we'll pass a non-null string of libs.
- callAapt(libPkgProp);
- }
-
- @Override
- protected String getExecTaskName() {
- return "aapt";
- }
-
- /**
- * Calls aapt with the given parameters.
- * @param resourceFilter the resource configuration filter to pass to aapt (if configName is
- * non null)
- * @param extraPackages an optional list of colon-separated packages. Can be null
- * Ex: com.foo.one:com.foo.two:com.foo.lib
- */
- private void callAapt(String extraPackages) {
- Project taskProject = getProject();
final boolean generateRClass = mRFolder != null && new File(mRFolder).isDirectory();
@@ -538,9 +530,9 @@ public final class AaptExecTask extends SingleDependencyTask {
}
}
- if (mNonConstantId == false && extraPackages != null && extraPackages.length() > 0) {
+ if (mNonConstantId == false && libPkgProp != null && libPkgProp.length() > 0) {
task.createArg().setValue("--extra-packages");
- task.createArg().setValue(extraPackages);
+ task.createArg().setValue(libPkgProp);
}
// if the project contains libraries, force auto-add-overlay
@@ -635,6 +627,12 @@ public final class AaptExecTask extends SingleDependencyTask {
// Use dependency generation
task.createArg().setValue("--generate-dependencies");
+ // use the proguard file
+ if (mProguardFile != null && mProguardFile.length() > 0) {
+ task.createArg().setValue("-G");
+ task.createArg().setValue(mProguardFile);
+ }
+
// final setup of the task
task.setProject(taskProject);
task.setOwningTarget(getOwningTarget());