summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authordarius42 <[email protected]>2007-09-22 18:17:58 +0000
committerdarius42 <[email protected]>2007-09-22 18:17:58 +0000
commit62752574bace0402a20f94e2e6297333b673eac0 (patch)
tree41a84d689170dc52a33745b4ae97dc3657ef53f1 /src
parent669990903206d83b4f2c11974cc29dce576a5789 (diff)
Fix for bug 1794857 - The history.xml file wasn't capturing all of the
compilerargs in the processor signature. In particular, if they had a location of mid or end, they weren't included. Re-ordered the inclusion of arguments so that they will all be captured in the signature. git-svn-id: file:///home/sven/projects/JOGL/temp/ant-contrib/svn/ant-contrib-code/cpptasks/trunk@146 32d7a393-a5a9-423c-abd3-5d954feb1f2f
Diffstat (limited to 'src')
-rw-r--r--src/main/java/net/sf/antcontrib/cpptasks/compiler/CommandLineCompiler.java57
1 files changed, 30 insertions, 27 deletions
diff --git a/src/main/java/net/sf/antcontrib/cpptasks/compiler/CommandLineCompiler.java b/src/main/java/net/sf/antcontrib/cpptasks/compiler/CommandLineCompiler.java
index a8b7691..58c5a6c 100644
--- a/src/main/java/net/sf/antcontrib/cpptasks/compiler/CommandLineCompiler.java
+++ b/src/main/java/net/sf/antcontrib/cpptasks/compiler/CommandLineCompiler.java
@@ -285,6 +285,32 @@ public abstract class CommandLineCompiler extends AbstractCompiler {
// add all appropriate defines and undefines
//
buildDefineArguments(defaultProviders, args);
+ int warnings = specificDef.getWarnings(defaultProviders, 0);
+ addWarningSwitch(args, warnings);
+ Enumeration argEnum = cmdArgs.elements();
+ int endCount = 0;
+ while (argEnum.hasMoreElements()) {
+ CommandLineArgument arg = (CommandLineArgument) argEnum
+ .nextElement();
+ switch (arg.getLocation()) {
+ case 1 :
+ args.addElement(arg.getValue());
+ break;
+ case 2 :
+ endCount++;
+ break;
+ }
+ }
+ String[] endArgs = new String[endCount];
+ argEnum = cmdArgs.elements();
+ int index = 0;
+ while (argEnum.hasMoreElements()) {
+ CommandLineArgument arg = (CommandLineArgument) argEnum
+ .nextElement();
+ if (arg.getLocation() == 2) {
+ endArgs[index++] = arg.getValue();
+ }
+ }
//
// Want to have distinct set of arguments with relative
// path names for includes that are used to build
@@ -327,37 +353,14 @@ public abstract class CommandLineCompiler extends AbstractCompiler {
addIncludes(baseDirPath, sysIncPath, args, null, null);
StringBuffer buf = new StringBuffer(getIdentifier());
for (int i = 0; i < relativeArgs.size(); i++) {
+ buf.append(' ');
buf.append(relativeArgs.elementAt(i));
+ }
+ for (int i = 0; i < endArgs.length; i++) {
buf.append(' ');
+ buf.append(endArgs[i]);
}
- buf.setLength(buf.length() - 1);
String configId = buf.toString();
- int warnings = specificDef.getWarnings(defaultProviders, 0);
- addWarningSwitch(args, warnings);
- Enumeration argEnum = cmdArgs.elements();
- int endCount = 0;
- while (argEnum.hasMoreElements()) {
- CommandLineArgument arg = (CommandLineArgument) argEnum
- .nextElement();
- switch (arg.getLocation()) {
- case 1 :
- args.addElement(arg.getValue());
- break;
- case 2 :
- endCount++;
- break;
- }
- }
- String[] endArgs = new String[endCount];
- argEnum = cmdArgs.elements();
- int index = 0;
- while (argEnum.hasMoreElements()) {
- CommandLineArgument arg = (CommandLineArgument) argEnum
- .nextElement();
- if (arg.getLocation() == 2) {
- endArgs[index++] = arg.getValue();
- }
- }
String[] argArray = new String[args.size()];
args.copyInto(argArray);
boolean rebuild = specificDef.getRebuild(baseDefs, 0);