How to display the contents of a file set in Nant?

tried to do something like this:

<copy>  
        <fileset id="mySet">
        <include name="*.sql" />
    </fileset>
</copy>
<echo message="Copied files: ${mySet} to directory: ${Folder}." />

But I get the following error:

'id' is an invalid attribute for a tag. Data types can be declared at the project level or target level. Thanks

+3
source share
1 answer

You can do this by going through the files in the set.

<fileset id="mySet">
  <include name="*.sql" />
</fileset>
<copy>  
  <fileset refid="mySet" />
</copy>
<foreach item="File" property="filename">
  <in>
    <items refid="mySet" />
  </in>
  <do>
    <echo message="Copied files: ${filename} to directory: ${Folder}." />
  </do>
</foreach>

But depending on the level of detail, the result of the copy is still repeated.

+8
source

Source: https://habr.com/ru/post/1725308/


All Articles