summaryrefslogtreecommitdiffstats
path: root/src/java/com/sun/gluegen/ant/GlueGenTask.java
diff options
context:
space:
mode:
authorSven Gothel <[email protected]>2010-11-04 20:32:58 +0100
committerSven Gothel <[email protected]>2010-11-04 20:32:58 +0100
commitc4f4ec8b7be3c73b0d416ea82030b3fb8aa99efa (patch)
treefe863b668d4e33728b2e74c332a44e11699afd9f /src/java/com/sun/gluegen/ant/GlueGenTask.java
parent12168e5bced1eaaaf4fc340cd67cdcbc8112d6d7 (diff)
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.
Diffstat (limited to 'src/java/com/sun/gluegen/ant/GlueGenTask.java')
-rw-r--r--src/java/com/sun/gluegen/ant/GlueGenTask.java24
1 files changed, 23 insertions, 1 deletions
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]" /&gt;
+ config="[configuration file]"
+ debug="[optional boolean]" /&gt;
* </pre>
*
* @author Rob Grzywinski <a href="mailto:[email protected]">[email protected]</a>
@@ -94,6 +95,11 @@ public class GlueGenTask extends Task
// =========================================================================
/**
+ * <p>The optional debug flag.</p>
+ */
+ private boolean debug=false;
+
+ /**
* <p>The optional output root dir.</p>
*/
private String outputRootDir;
@@ -160,6 +166,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>
*
* @param outputRootDir the optional output root dir
@@ -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);