Permalink
Browse files

Exposes more properties and updates the javadoc.

  • Loading branch information...
1 parent 7668970 commit 3c4dd8cf1e6e23de6883b28e95c1889591fe0d45 @quiffman committed Apr 27, 2012
@@ -149,21 +149,24 @@
/**
* Update the <code>android:versionName</code> with the specified parameter. If left empty it
- * will use the version number of the project.
+ * will use the version number of the project. Exposed via the project property
+ * <code>android.manifest.versionName</code>.
*
* @parameter expression="${android.manifest.versionName}" default-value="${project.version}"
*/
protected String manifestVersionName;
/**
- * Update the <code>android:versionCode</code> attribute with the specified parameter.
+ * Update the <code>android:versionCode</code> attribute with the specified parameter. Exposed via
+ * the project property <code>android.manifest.versionCode</code>.
*
* @parameter expression="${android.manifest.versionCode}"
*/
protected Integer manifestVersionCode;
/**
- * Auto increment the <code>android:versionCode</code> attribute with each build.
+ * Auto increment the <code>android:versionCode</code> attribute with each build. The
+ * resulting value is exposed via the project property <code>android.manifest.versionCode</code>.
*
* @parameter expression="${android.manifest.versionCodeAutoIncrement}" default-value="false"
*/
@@ -173,21 +176,24 @@
* Update the <code>android:versionCode</code> attribute automatically from the project version
* e.g 3.0.1 will become version code 301. As described in this blog post
* http://www.simpligility.com/2010/11/release-version-management-for-your-android-application/
- * but done without using resource filtering.
+ * but done without using resource filtering. The resulting value is exposed via the project
+ * property <code>android.manifest.versionCode</code>.
*
* @parameter expression="${android.manifest.versionCodeUpdateFromVersion}" default-value="false"
*/
protected Boolean manifestVersionCodeUpdateFromVersion = false;
/**
- * Update the <code>android:sharedUserId</code> attribute with the specified parameter.
+ * Update the <code>android:sharedUserId</code> attribute with the specified parameter. If
+ * specified, exposes the project property <code>android.manifest.sharedUserId</code>.
*
* @parameter expression="${android.manifest.sharedUserId}"
*/
protected String manifestSharedUserId;
/**
- * Update the <code>android:debuggable</code> attribute with the specified parameter.
+ * Update the <code>android:debuggable</code> attribute with the specified parameter. Exposed via
+ * the project property <code>android.manifest.debuggable</code>.
*
* @parameter expression="${android.manifest.debuggable}"
*/
@@ -362,6 +368,15 @@ public void updateManifest(File manifestFile) throws IOException, ParserConfigur
"Please specify either versionCodeAutoIncrement, versionCodeUpdateFromVersion or versionCode!");
}
+ // Expose the version properties and other simple parsed manifest entries
+ project.getProperties().setProperty("android.manifest.versionName", parsedVersionName);
+ project.getProperties().setProperty("android.manifest.versionCodeAutoIncrement", String.valueOf(parsedVersionCodeAutoIncrement));
+ project.getProperties().setProperty("android.manifest.versionCodeUpdateFromVersion", String.valueOf(parsedVersionCodeUpdateFromVersion));
+ project.getProperties().setProperty("android.manifest.debuggable", String.valueOf(parsedDebuggable));
+ if (parsedSharedUserId != null) {
+ project.getProperties().setProperty("android.manifest.sharedUserId", parsedSharedUserId);
+ }
+
if (parsedVersionCodeAutoIncrement) {
Attr versionCode = manifestElement.getAttributeNode(ATTR_VERSION_CODE);
int currentVersionCode = 0;

0 comments on commit 3c4dd8c

Please sign in to comment.