Questions tagged [fileset]

A fileset in Apache Ant is a structure to combine a group of files and perform actions on them.

In Apache Ant, a FileSet is a structure to group a number of files. Many Ant tasks work on filesets, e.g. copy, delete, ...

Usually build-scripts use filesets to select a number of files that should be used for operations later on.

Similar concepts in Ant are DirSet and PatternSet.

See the documentation for details

118 questions
44
votes
2 answers

How can I print a fileset to a file, one file name per line?

I have a populated fileset and I need to print the matching filenames into a text file. I tried this:
Tomas Andrle
  • 13,132
  • 15
  • 75
  • 92
36
votes
9 answers

How to exclude a directory from ant fileset, based on directories contents

How can I create an ant fileset which excludes certain directories based on the contents of the directory? I use ant to create a distribution jar which has each localization in separate directories, some of which are incomplete and should not be…
Chadwick
  • 12,555
  • 7
  • 49
  • 66
20
votes
4 answers

Filter a fileset referenced using a refid

I have a fileset (which is returned from the Maven Ant task), and it contains all the jars I need to repack. This fileset is referenced by a refid. I only want to include our own jars, so I would like to filter that. But Ant filesets don't support…
Mauli
  • 16,863
  • 27
  • 87
  • 114
19
votes
1 answer

Converting an Ant fileset to multiple apply args

I have some files: dir/foo.txt dir/bar.txt dir/foobar.txt In an Ant apply task, I want to pass the list of files as arguments:
Jmini
  • 9,189
  • 2
  • 55
  • 77
12
votes
4 answers

How to add all files in a fileset as an argument to the exec task?

I'm trying to provide all *.cpp files in a folder to the c++ compiler through ant. But I get no further than ant giving gpp a giant string containing all the files. I tried to prove it by using a small test application: int main( int argc,…
xtofl
  • 40,723
  • 12
  • 105
  • 192
10
votes
2 answers

What's the difference between a nested path and fileset?

I have been googling for the "Differences between fileset and path" article for some time, but have found nothing useful. For example, what is the difference between the following (say, there is a someDir directory, which contains .jar files and has…
Dmitry
  • 3,028
  • 6
  • 44
  • 66
10
votes
1 answer

How to use filelist as fileset in uptodate Ant command?

I have a target of build.xml that creates a Zip file. To avoid creating the Zip if no file has been updated, I'd like to check for updates beforehand. AFAIK, uptodate is the task to use. Here is the relevant (simplified) script sections:
Eleno
  • 2,864
  • 3
  • 33
  • 39
10
votes
3 answers

How to have an Ant INCLUDE fileset take priority over an EXCLUDE

If I have a fileset like this: The exclude takes precedence over the include and I don't end up with any classes. [since for this hypothetical example,…
user41762
  • 661
  • 2
  • 8
  • 9
10
votes
1 answer

Copy content of subfolders with Ant

How can I copy content of all subfolders of given folder using Ant? i.e. I have such folder structure folder/ folder/sub1/1.txt folder/sub1/f1/1.txt folder/sub2/2.txt ... I don't know exact names of subfolders. And I need to copy content from all…
Yury Khrol
  • 395
  • 3
  • 11
8
votes
2 answers

Stranges files in my assembly since switching to unix

since I've inserted the option unix into my fileSets and files in my Maven assembly plugin configuration, strange files are placed in my tar. They look as…
user321068
7
votes
2 answers

Iterating through a directory with Ant

Let's say I have a collection of PDF files with the following paths: /some/path/pdfs/birds/duck.pdf /some/path/pdfs/birds/goose.pdf /some/path/pdfs/insects/fly.pdf /some/path/pdfs/insects/mosquito.pdf What I'd like to do is generate thumbnails for…
Shaggy Frog
  • 27,575
  • 16
  • 91
  • 128
6
votes
1 answer

How to split an fileset in Ant into multiple sets

I have a set of files that I am picking up in an ant build, which I want to split into equal sized sub sets. What is a good simple way to do this in Ant without adding custom tasks. Example: Fileset…
John Sonmez
  • 7,128
  • 5
  • 37
  • 56
6
votes
2 answers

nAnt Deleting files older than 7 days old

I would like to create a target that cleans log files older than 7 days old in a specific folder. I get an error when I try to put in a "date" element inside a fileset. How can I go about this? fileset…
user176657
  • 125
  • 1
  • 4
  • 13
5
votes
1 answer

How do I select subdirectories in ant using a FileSet?

I'm using ant 1.6.2 and am trying to set up a task that will compare a source and a target directory, identify all the subdirectories that exist in the source directory and delete liked named subdirectories in the target directory. So, say the…
Eric Rosenberg
  • 1,543
  • 9
  • 18
4
votes
3 answers

Ant unzip task and only extracting files based on another directory

I have a zip file and, separately, a directory that contains some files. From the zip file I'd like to extract only those files that exist in the directory (performing a filename transformation on the files as they are being extracted..basically,…
FanOfTamago
  • 120
  • 1
  • 6
1
2 3 4 5 6 7 8