From c4f4ec8b7be3c73b0d416ea82030b3fb8aa99efa Mon Sep 17 00:00:00 2001 From: Sven Gothel <sgothel@jausoft.com> Date: Thu, 4 Nov 2010 20:32:58 +0100 Subject: Fix PCPP 'elif' case; Adding PCPP #error/#warning; Adding debug mode. Fix PCPP 'elif' case ---------------------- Use the evaluated expression after the 'elif' statement as well. This was always true for 'if'. Otherwise the file obviously won't get parsed correctly, ie it was always assuming 'true'. Adding PCPP #error/#warning ---------------------------- LOG all occurence of #error and #warning CPP directives Adding debug mode. ---------------------- Add '--debug' commandline flag and 'debug' property for ant task, which enables debug mode of PCPP. --- src/java/com/sun/gluegen/ant/GlueGenTask.java | 24 +++++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) (limited to 'src/java/com/sun/gluegen/ant/GlueGenTask.java') diff --git a/src/java/com/sun/gluegen/ant/GlueGenTask.java b/src/java/com/sun/gluegen/ant/GlueGenTask.java index af42392..cc66c64 100644 --- a/src/java/com/sun/gluegen/ant/GlueGenTask.java +++ b/src/java/com/sun/gluegen/ant/GlueGenTask.java @@ -71,7 +71,8 @@ import org.apache.tools.ant.util.JavaEnvUtils; includeRefid="[optional FileSet or DirSet for include files]" literalInclude="[optional hack to get around FileSet / DirSet issues with different drives]" emitter="[emitter class name]" - config="[configuration file]" /> + config="[configuration file]" + debug="[optional boolean]" /> * </pre> * * @author Rob Grzywinski <a href="mailto:rgrzywinski@realityinteractive.com">rgrzywinski@yahoo.com</a> @@ -93,6 +94,11 @@ public class GlueGenTask extends Task private CommandlineJava gluegenCommandline; // ========================================================================= + /** + * <p>The optional debug flag.</p> + */ + private boolean debug=false; + /** * <p>The optional output root dir.</p> */ @@ -159,6 +165,17 @@ public class GlueGenTask extends Task // ========================================================================= // ANT getters and setters + /** + * <p>Set the debug flag (optional). This is called by ANT.</p> + * + * @param outputRootDir the optional output root dir + */ + public void setDebug(boolean debug) + { + log( ("Setting debug flag: " + debug), Project.MSG_VERBOSE); + this.debug=debug; + } + /** * <p>Set the output root dir (optional). This is called by ANT.</p> * @@ -418,6 +435,11 @@ public class GlueGenTask extends Task // NOTE: GlueGen uses concatenated flag / value rather than two // separate arguments + // add the debug flag if enabled + if(debug) { + gluegenCommandline.createArgument().setValue("--debug"); + } + // add the output root dir if(null!=outputRootDir && outputRootDir.trim().length()>0) { gluegenCommandline.createArgument().setValue("-O" + outputRootDir); -- cgit v1.2.3