SF.net SVN: ant-contrib: [146] cpptasks/trunk/src/main/java/net/sf/ antcontrib/cpptasks/compiler/CommandLineCompiler.java

[email protected] Sat, 22 Sep 2007 11:17:59 -0700
Newsgroups gmane.comp.java.ant-contrib.devel
Message-ID <[email protected]>
Revision: 146
          http://ant-contrib.svn.sourceforge.net/ant-contrib/?rev=146&view=rev
Author:   darius42
Date:     2007-09-22 11:17:58 -0700 (Sat, 22 Sep 2007)

Log Message:
-----------
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.

Modified Paths:
--------------
    cpptasks/trunk/src/main/java/net/sf/antcontrib/cpptasks/compiler/CommandLineCompiler.java

Modified: cpptasks/trunk/src/main/java/net/sf/antcontrib/cpptasks/compiler/CommandLineCompiler.java
===================================================================
--- cpptasks/trunk/src/main/java/net/sf/antcontrib/cpptasks/compiler/CommandLineCompiler.java	2007-09-21 17:57:00 UTC (rev 145)
+++ cpptasks/trunk/src/main/java/net/sf/antcontrib/cpptasks/compiler/CommandLineCompiler.java	2007-09-22 18:17:58 UTC (rev 146)
@@ -285,6 +285,32 @@
         //    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 @@
         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);


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/