aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--anttasks/src/com/android/ant/AaptExecLoopTask.java14
-rw-r--r--files/ant/main_rules.xml2
2 files changed, 16 insertions, 0 deletions
diff --git a/anttasks/src/com/android/ant/AaptExecLoopTask.java b/anttasks/src/com/android/ant/AaptExecLoopTask.java
index 6c98cbd..ebefde5 100644
--- a/anttasks/src/com/android/ant/AaptExecLoopTask.java
+++ b/anttasks/src/com/android/ant/AaptExecLoopTask.java
@@ -78,6 +78,7 @@ public final class AaptExecLoopTask extends BaseTask {
private boolean mVerbose = false;
private boolean mUseCrunchCache = false;
private int mVersionCode = 0;
+ private String mVersionName;
private String mManifest;
private ArrayList<Path> mResources;
private String mAssets;
@@ -139,6 +140,14 @@ public final class AaptExecLoopTask extends BaseTask {
}
}
+ /**
+ * Sets the value of the "versionName" attribute
+ * @param versionName the value
+ */
+ public void setVersionname(String versionName) {
+ mVersionName = versionName;
+ }
+
public void setDebug(boolean value) {
mDebug = value;
}
@@ -418,6 +427,11 @@ public final class AaptExecLoopTask extends BaseTask {
task.createArg().setValue(Integer.toString(mVersionCode));
}
+ if ((mVersionName != null) && (mVersionName.length() > 0)) {
+ task.createArg().setValue("--version-name");
+ task.createArg().setValue(mVersionName);
+ }
+
// manifest location
if (mManifest != null) {
task.createArg().setValue("-M");
diff --git a/files/ant/main_rules.xml b/files/ant/main_rules.xml
index ff19add..8404eb8 100644
--- a/files/ant/main_rules.xml
+++ b/files/ant/main_rules.xml
@@ -120,6 +120,7 @@
before, then this will create them with empty values, which are then ignored
by the custom tasks receiving them. -->
<property name="version.code" value="" />
+ <property name="version.name" value="" />
<property name="aapt.resource.filter" value="" />
<property name="filter.abi" value="" />
@@ -519,6 +520,7 @@
<aapt executable="${aapt}"
command="package"
versioncode="${version.code}"
+ versionname="${version.name}"
debug="${build.packaging.debug}"
manifest="AndroidManifest.xml"
assets="${asset.absolute.dir}"