Bug 47117 - Concat resource doesn't calculate its size
Summary: Concat resource doesn't calculate its size
Status: NEW
Alias: None
Product: Ant
Classification: Unclassified
Component: Core tasks (show other bugs)
Version: 1.8.2
Hardware: PC Windows XP
: P2 enhancement (vote)
Target Milestone: 1.8.0
Assignee: Ant Notifications List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-04-29 06:20 UTC by st_lazarov
Modified: 2010-12-27 11:13 UTC (History)
0 users



Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description st_lazarov 2009-04-29 06:20:51 UTC
Currently the following code
        <length>
            <concat>
                <fileset file="*"/>
            </concat>
        </length>
will return Resource.UNKNOWN_SIZE, i.e. print
"[length] Size unknown for concat ..."
Instead, it should return the size in bytes of the output stream resulted in concatenating the resources specified in "concat"
The current behavior is due to ConcatResource not overriding getSize() (most of the classes extending Resource do that)
The difficulty with ConcatResource compared to other Resources is that ConcatResource should effectively be executed before we are able to get its length. However, this shouldn't be an issue because we meant exactly that with the sample code provided above. 
That is, for some tasks that can be used as resources seems to be normal the tasks to be executed before they can be used as resources.
If we don't provide this enhancement, the users will be forced to workaround in a similar way: they will execute the task (in the above case - output the concatenation in a file) and then use the output of the task as a resource.