fileset

How do I apply targets to a sublist of projects in Ant?

I have a bunch of sub projects in various directories. I want to specify them as a list, then for a given target I want to go through each one, one-by-one and call subant. I've got something like: <target name="run"> <subant target="run" failonerror="true" verbose="true"> <fileset dir="${projectA}" includes="build.xml"/> ...

Ant commands to print fileset into a file, one match per line

I have a populated fileset and I need to print the matching filenames into a text file. I tried this: <fileset id="myfileset" dir="../sounds"> <include name="*.wav" /> <include name="*.ogg" /> </fileset> <property name="sounds" refid="myfileset" /> <echo file="sounds.txt">${sounds}</echo> which prints all the files on a sing...

How to make nant complain when a file is missing from a fileset

I have a fileset element in a build file that is defined as: <fileset id="fileset" basedir="."> <include name="test.txt"/> <include name="missing.txt"/> </fileset> When this runs (as part of a copy task), it does not complain if any of the files are missing. Whilst I can use failonempty="true" in the fileset element, this only...

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? <delete> fileset basedir="${StageIISRoot}/MySite/App_Data/ErrorLog"> <date datetime="${datetime::now() - timespan::from-days(7)}" when=...

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 source directory has sub directories sub1, sub2, and sub3 in it and the target directory has s...

Converting a ant fileset to a multiple arg

I have some files : dir/foo.txt dir/bar.txt dir/foobar.txt During a apply task, I want to pass the list of file as arguments: <target name="atask"> <apply executable="${cmd}" parallel="false" verbose="true"> <arg value="-in"/> <srcfile/> <arg value="dir/foo.txt"/> <arg value="dir/bar.txt"/> ...

ANT task to move and rename, files and folders, recursively

I have have a folder structure like so: /PROJECT/PROJECT.html /PROJECT/PROJECT_readme.txt /PROJECT/PROJECT.css /PROJECT/PROJECT.js /PROJECT/abc_PROJECT_def.txt /PROJECT/something.js /PROJECT/other.txt /PROJECT/somefolder/PROJECT_other.txt I want to use ANT to copy the complete directory and also change the PROJECT string in the...

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 released. I would like to add something to the directory (for example a file named incomple...

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 contains TestOne.java TestTwo.java TestThree.java TestFour.java TestFive.java TestSix.java I would like 3 filesets Fileset1 TestOn...

Ant fileset confusion

Let's say I have this in one of my targets: <path id="files"> <fileset dir="${env.DIRECTORY}" casesensitive="false"> <include name="**/*.html"/> <exclude name="**/*ant*"/> </fileset> </path> I'd like to group all the html files, except the ones containing the string ant. The way I wrote it above, it does not work. I a...

Problems with FileSet in Ant script?

Hi, I am using Ant script to generate javadoc and I just only wnt Ant to look for some classes based on a certain pattern, so I wrote: <javadoc access="public" source="1.6" sourcepath="src" destdir="dest" > <fileset dir="src" casesensitive="yes" defaultexcludes="yes"> <filename name="**/ABC*.java"/> </fileset> </javadoc> ...

File Enumeration with ANT

I feel like I'm missing something obvious at the moment. I want to collect a set of dirs / files together in ANT. I know I can do it using a fileset with an optional patternset inside it, but that involves searching for files based a specific criterior - filetype, name etc. I already know the paths to the files I want to collect. I have...

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 each PDF that respect the relative path structure, and output to another location, i.e.:...

ANT - How can i echo a filename twice with FileSet & PathConvert

Hey, So i have this simple ant task that lists all png files in a folder. <target name="listimages"> <!-- Assume files a A and B --> <fileset id="dist.contents" dir="${basedir}"> <include name="**/*.png"/> </fileset> <pathconvert pathsep="${line.separator}" property="prop.dist.contents" refid="dist.contents"> ...

Stranges files in my assembly since switching to <lineEnding>unix</lineEnding>

Hi, since I've inserted the option <lineEnding>unix</lineEnding> into my fileSets and files in my Maven assembly plugin configuration, strange files are placed in my tar. They look as following: ignore.me.1499711160.filtered.903528596.formatted run.sh.2124782621.filtered.1130667884.formatted Do you know why this occurrs? ...

FIlter directories based on timestamp

Hello everyone, My ultimate goal is the following : delete all content from a directory that is older than a given date. What I'm willing to achieve is removing all backup directories that are more than 7 days old compared to today's date. I could check the directories based on their OS timestamp (Windows 2003) or the directory name wh...

How to exclude a directory which is already included in an Ant FileSet?

I am using the jar task in ant and wish to exclude a certain directory. The structure of the directories is something like: food |_ fruits |_ apples |_ bananas (having been made generic and simplified a little) And I have an ant task like this: <jar destfile="Dest.jar"> ... <fileset dir="food"> <excl...

Ant: Concatenate properties from a fileset

Hi everyone, I am trying to do the following in ANT but I am stuck. Read which projects are installed in my project workspace. workspace buildtools build.xml project1 build.xml project.name = "project1" IP = "44.55.66.77" SERVER_NAME = "project1.local" DOCUMEN...

Ant Fileset Expansion doesn't work

Hello everyone, I get a very confusing reaction from my ant build-file and I'm wondering whether I'm just not clever enough or this might actually be a bug. I've got the following property set globally in my project: <property name="lib.dir" location="lib"/> Then I'll try to add some files out of this directory into a jar file via f...

Compiler warnings plugin: Fileset excludes

We are using Hudson as our build machine and I am trying to configure the excludes fileset for the Compilier Warnings plugin. Hudson parses the build log to determine warnings/errors and our Clover scripts output duplicates of real warnings. As documented by Hudson you can configure an ANT fileset to exclude certain warnings: Warnin...