ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Mark Salter <>
Subject Ant 1.7.1 - concat function no longer returns an 'empty' file if no source resources are found...
Date Tue, 14 Oct 2008 21:16:23 GMT
Hi there.

I would like to understand the expected result of a concat step that
'finds' no source files.

I believe that prior to version 1.7.1 the resultant file could include
header and footer even if the no other files went in.

With 1.7.1, class :-


checks for zero source and returns.

I would like to have a file produced if I specify a header or footer,
but I can see this might cause other people problems if they are
expecting no file at all to be produced in this situation, although this
was the result with 1.7.0.

Should I be checking that a file is produced out of concat, instead of
assuming there will be one (my next step is a copy which fails if the
cancat target is not created)?

The following patch would make it work for me, but is this a reasonable
change to suggest?

Index: src/main/org/apache/tools/ant/taskdefs/
--- src/main/org/apache/tools/ant/taskdefs/	(revision 704405)
+++ src/main/org/apache/tools/ant/taskdefs/	(working copy)
@@ -733,7 +733,7 @@
             log(destinationFile + " is up-to-date.", Project.MSG_VERBOSE);
-        if (c.size() == 0) {
+        if (c.size() == 0 && header == null && footer == null) {
         OutputStream out;


To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message