You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@beehive.apache.org by ri...@apache.org on 2004/09/28 01:33:23 UTC
svn commit: rev 47341 - incubator/beehive/trunk/controls/src/runtime/org/apache/beehive/controls/runtime/generator
Author: rich
Date: Mon Sep 27 16:33:22 2004
New Revision: 47341
Modified:
incubator/beehive/trunk/controls/src/runtime/org/apache/beehive/controls/runtime/generator/AptTask.java
Log:
Added an additional option for the <apt> ant task: processorOptions. This accepts a comma-separated list of options (keys or keys/values) that will be passed to APT using -A; for example, this value:
processorOptions="alternateWebRootDir=/temp,myCustomOption"
...will cause the following two arguments to be added to the APT call:
-AalternateWebRootDir=/temp
-AmyCustomOption
DRT: controls (WinXP)
BB: self (linux)
Modified: incubator/beehive/trunk/controls/src/runtime/org/apache/beehive/controls/runtime/generator/AptTask.java
==============================================================================
--- incubator/beehive/trunk/controls/src/runtime/org/apache/beehive/controls/runtime/generator/AptTask.java (original)
+++ incubator/beehive/trunk/controls/src/runtime/org/apache/beehive/controls/runtime/generator/AptTask.java Mon Sep 27 16:33:22 2004
@@ -62,6 +62,18 @@
while (tok.hasMoreTokens())
_srcExts.add(tok.nextToken());
}
+
+ /**
+ * The srcExtensions attribute can be set to a comma-separated list of processor options
+ * (of the form <i>option</i> or <i>option</i><code>=</code><i>value</i>) to be passed to
+ * APT.
+ */
+ public void setProcessorOptions(String processorOptions)
+ {
+ StringTokenizer tok = new StringTokenizer(processorOptions, ",");
+ while (tok.hasMoreTokens())
+ _processorOptions.add(tok.nextToken());
+ }
/**
* The gendir attribute specifies the name of the output directory for any files generated
@@ -187,6 +199,15 @@
arg.setValue("-s");
arg = createCompilerArg();
arg.setFile(_genDir);
+
+ //
+ // Add processor options.
+ //
+ for (Object i : _processorOptions)
+ {
+ Commandline.Argument optionArg = createCompilerArg();
+ optionArg.setValue("-A" + i);
+ }
checkParameters();
resetFileLists();
@@ -263,4 +284,5 @@
protected boolean _hasSourcepath;
protected File _genDir;
protected Vector/*<String>*/ _srcExts = new Vector/*<String>*/();
+ protected Vector/*<String>*/ _processorOptions = new Vector/*<String>*/();
}