DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://nagoya.apache.org/bugzilla/show_bug.cgi?id=18166>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=18166

Concat enhancement





------- Additional Comments From [EMAIL PROTECTED]  2003-03-25 13:05 -------
Cool... Thanks for the feedback.
Ok i had a quick look at the list and the code.

>> * I've reverted parts of your patch that contained removal of comments
     and the addition of wildcard imports.
Cool, I had attempted a merge between my concat2 and concat, but missed
these.
>> * you completely ignore all <fileset>'s and so on if nested text is present.
I think this is the original behaviour of concat. - it throws a buildexception.

>> * encoding is ignored when reading from files.
This is a bug I introduced when fixing the multi file bug, I
can attach a new concat file, if needed.

>> * The handling of header and footer would reintroduce the bug where a newline
  incorrectly gets appended - I've sort of fixed that by using print instead
  of println.
This is true, especially since I added the file attribute. I'll check
to see what effect this has on my build scripts.

>> * I don't think TextElement#setFile should ignore that the referenced file
  doesn't exist.
This is true, I sort of put setFile in as a last-minute idea

>> * The trim attribute in TextElement should apply to nested text as well 
>> (instead
  of unconditionally trimming it.
It only looks like it unconditionally trims it.

>> * We might need the sanitizeText logic for header and footer as well.
The line (if (value.trim().length() == 0) sort of does this.

>> * What do you need trimleading for?
This is in to make the xml look nice...
The useage is like this:
        <header stripleading="true"><![CDATA[
            #include <common/unittest.h>
            #include "register_suites.h"
            void register_suites() {
        ]]></header>
I want the output to be:
#include <common/unittest.h>
#include "register_suites.h"
void register_suites() {

>> * Why do you apply filterchains to nested text but not to header and footer?
I use this task generate header and c files like this:
        <property name="suite.pat" value="^ *SUITE\(.*,\s*(.*)\s*\).*"/>
        <concat destfile="${gen.dir}/register_suites.h" overwrite="no">
            <header trimleading="true">
                #ifndef R
                #define R
            </header>
            <fileset dir="test/unit" includes="**/unit_*.cpp"/>
            <filterchain>
                <tokenfilter>
                    <containsregex 
                        pattern="${suite.pat}"
                        replace="void register_\1();"/>
                </tokenfilter>
            </filterchain>
            <footer trimleading="true">
                void register_suites();
                #endif
            </footer>
        </concat>
      
>> * changed semantics of the append attribute
I am not sure I changed the semantics. I found the original code
and explaination confusing.

Also: I dropped a public method "reset", this has been reintroduced
Will we need to modify it to to reset the new fields of concat?

Peter.

Reply via email to