OSDN Git Service

Ant build didn't use -non-constant-id for libraries!
authorXavier Ducrohet <xav@android.com>
Fri, 7 Oct 2011 02:23:33 +0000 (19:23 -0700)
committerXavier Ducrohet <xav@android.com>
Fri, 7 Oct 2011 02:23:33 +0000 (19:23 -0700)
Change-Id: I966b8796008b87dd3e6101d8c6d09271e2621c52

anttasks/src/com/android/ant/AaptExecTask.java
files/ant/build.xml

index fc0de71..504640b 100644 (file)
@@ -92,6 +92,7 @@ public final class AaptExecTask extends BaseTask {
     private final ArrayList<NoCompress> mNoCompressList = new ArrayList<NoCompress>();
     private String mProjectLibrariesResName;
     private String mProjectLibrariesPackageName;
+    private boolean mNonConstantId;
 
     /**
      * Sets the value of the "executable" attribute.
@@ -133,6 +134,10 @@ public final class AaptExecTask extends BaseTask {
         mUseCrunchCache = nocrunch;
     }
 
+    public void setNonConstantId(boolean nonConstantId) {
+        mNonConstantId = nonConstantId;
+    }
+
     public void setVersioncode(String versionCode) {
         if (versionCode.length() > 0) {
             try {
@@ -415,6 +420,10 @@ public final class AaptExecTask extends BaseTask {
             task.createArg().setValue("--no-crunch");
         }
 
+        if (mNonConstantId) {
+            task.createArg().setValue("--non-constant-id");
+        }
+
         // force flag
         if (mForce) {
             task.createArg().setValue("-f");
index 134a0a3..9315a5e 100644 (file)
                     manifest="AndroidManifest.xml"
                     androidjar="${android.jar}"
                     rfolder="${gen.absolute.dir}"
+                    nonConstantId="${android.library}"
                     projectLibrariesResName="project.libraries.res"
                     projectLibrariesPackageName="project.libraries.package">
                 <res path="${resource.absolute.dir}" />