aboutsummaryrefslogtreecommitdiffstats
path: root/anttasks
diff options
context:
space:
mode:
authorXavier Ducrohet <xav@android.com>2010-09-29 17:12:31 -0700
committerXavier Ducrohet <xav@android.com>2010-09-29 18:15:13 -0700
commite0df3f1e3dd9e5cfc63750748a220ef14893e9f4 (patch)
tree13974d70f9afea1cc09b39d34da5adb58f3498bb /anttasks
parenta629091f64956b2367e7041e72011b6a545a4b3a (diff)
downloadsdk-e0df3f1e3dd9e5cfc63750748a220ef14893e9f4.zip
sdk-e0df3f1e3dd9e5cfc63750748a220ef14893e9f4.tar.gz
sdk-e0df3f1e3dd9e5cfc63750748a220ef14893e9f4.tar.bz2
In some cases release build is actually a debug build.
If the manifest sets debuggable=true then this override the release build to be a debug build instead. Change-Id: Ib66bf9053cecfa7c19a02cefdbf187a20bd6da37
Diffstat (limited to 'anttasks')
-rw-r--r--anttasks/src/com/android/ant/ApkBuilderTask.java30
1 files changed, 25 insertions, 5 deletions
diff --git a/anttasks/src/com/android/ant/ApkBuilderTask.java b/anttasks/src/com/android/ant/ApkBuilderTask.java
index 0d9b8fb..3f8dec1 100644
--- a/anttasks/src/com/android/ant/ApkBuilderTask.java
+++ b/anttasks/src/com/android/ant/ApkBuilderTask.java
@@ -39,7 +39,8 @@ public class ApkBuilderTask extends Task {
private String mApkFilepath;
private String mResourceFile;
private boolean mVerbose = false;
- private boolean mDebug = false;
+ private boolean mDebugPackaging = false;
+ private boolean mDebugSigning = false;
private boolean mHasCode = true;
private String mAbiFilter = null;
@@ -89,7 +90,26 @@ public class ApkBuilderTask extends Task {
* @param debug the debug mode value.
*/
public void setDebug(boolean debug) {
- mDebug = debug;
+ System.out.println("WARNNG: Using deprecated 'debug' attribute in ApkBuilderTask." +
+ "Use 'debugpackaging' and 'debugsigning' instead.");
+ mDebugPackaging = debug;
+ mDebugSigning = debug;
+ }
+
+ /**
+ * Sets the value of the "debugpackaging" attribute.
+ * @param debug the debug mode value.
+ */
+ public void setDebugpackaging(boolean debug) {
+ mDebugPackaging = debug;
+ }
+
+ /**
+ * Sets the value of the "debugsigning" attribute.
+ * @param debug the debug mode value.
+ */
+ public void setDebugsigning(boolean debug) {
+ mDebugSigning = debug;
}
/**
@@ -216,7 +236,7 @@ public class ApkBuilderTask extends Task {
}
try {
- if (mDebug) {
+ if (mDebugSigning) {
System.out.println(String.format(
"Creating %s and signing it with a debug key...", outputFile.getName()));
} else {
@@ -228,9 +248,9 @@ public class ApkBuilderTask extends Task {
outputFile,
new File(mOutFolder, mResourceFile),
dexFile,
- mDebug ? ApkBuilder.getDebugKeystore() : null,
+ mDebugSigning ? ApkBuilder.getDebugKeystore() : null,
mVerbose ? System.out : null);
- apkBuilder.setDebugMode(mDebug);
+ apkBuilder.setDebugMode(mDebugPackaging);
// add the content of the zip files.