diff options
author | Tero Saarni <tero.saarni@gmail.com> | 2011-06-02 20:22:12 +0300 |
---|---|---|
committer | Tero Saarni <tero.saarni@gmail.com> | 2011-08-15 22:16:57 +0300 |
commit | 8baa0f19ccfd5ea6d1c7e377d5cbc4dc1a71f2c7 (patch) | |
tree | c45c8dc18de208800061fcdeeebba59158e0c2ff /anttasks | |
parent | e3a869ad43f272c7804ad8cacb5bf4e9f00e2328 (diff) | |
download | sdk-8baa0f19ccfd5ea6d1c7e377d5cbc4dc1a71f2c7.zip sdk-8baa0f19ccfd5ea6d1c7e377d5cbc4dc1a71f2c7.tar.gz sdk-8baa0f19ccfd5ea6d1c7e377d5cbc4dc1a71f2c7.tar.bz2 |
Expose version.name property for aapt task.
The new property makes it possible to create ant build scripts
that programmatically determine and set the versionName attribute
during build. Similar property already exists for versionCode.
Signed-off-by: Tero Saarni <tero.saarni@gmail.com>
Change-Id: Ia36632ae029785563fc7c1bc8937034963016852
Diffstat (limited to 'anttasks')
-rw-r--r-- | anttasks/src/com/android/ant/AaptExecLoopTask.java | 14 |
1 files changed, 14 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"); |