From e0df3f1e3dd9e5cfc63750748a220ef14893e9f4 Mon Sep 17 00:00:00 2001 From: Xavier Ducrohet Date: Wed, 29 Sep 2010 17:12:31 -0700 Subject: 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 --- anttasks/src/com/android/ant/ApkBuilderTask.java | 30 ++++++++++++++++++++---- 1 file changed, 25 insertions(+), 5 deletions(-) (limited to 'anttasks') 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. -- cgit v1.1