More selector questions: They cannot be pre-defined and applied to multiple 's, can they? It doesn't appear this was taken into account though. It would have been nice if this functionality was available for 1.5, but I'm guessing thats not a possibility at this point. We can re-use across multiple 's though, so it will be confusing that selectors are locked into a single fileset. Erik ----- Original Message ----- From: "Bruce Atherton" To: "Ant Developers List" Sent: Tuesday, April 30, 2002 9:41 PM Subject: Re: Selector examples > At 07:17 PM 4/30/2002 -0400, you wrote: > >Could you provide, just briefly and quickly, some examples of the selector > >usage that you have been playing with? > > Sure thing. I'll describe each of the selectors here, and you can also look > at the build.xml file I attached to my last message to see some of them in > use. That file downloads the Ant 1.4.1 tarball and unpacks it, makes a few > changes so that the selectors have something to play with, and then runs > each of the static selectors in turn. > > Here is a description of each of the selectors so far. The selectors are > used inside or in other selectors that act as containers. The > containers are: > > - only select a file if it is selected by all the selectors in > this container > - select a file if any of the selectors in this container select it > - selected files become not selected, and vice versa. This can > contains only a single selector > - select a file if none of the contained selectors select it > - this selects a file if the majority of its contained > selectors select it. It is here to make people aware they can go beyond > boolean thinking. > > The noncontainer selectors that are provided, which I am calling static > selectors, are: > > - selects files based on name attribute, just like > include. And to emulate exclude, it has a negate attribute as well > - selects files based on directory depth, using min and > max attribute > - selects files based on their size. Attributes are size, > units (K, M, as well as Ki for 2^10), and when (less, more, equal) > - selects files based on the date of their last > modification. Attributes are millis, datetime, when (before, after, equal), > and checkdirs > - selects files based on whether they exist or not in > another directory tree. Attributes are targetdir and present (srcdir, > both). It can contain a mapper element to map the files > - selects files if they are newer than ones in another > directory tree. Attributes are targetdir and granularity. It also can > contain a mapper element > - selects files that contain a string. Attributes are > contains and casesensitive > > There is also a special selector, , with which users can > include their own selectors. It uses the element code from filters. > It has attributes for classname, classpath, and classpathref. Static > selectors can be called from extendselect unless they have their own elements. > > Here are a couple of examples. To get all the files which contain the > "" tag that are bigger than 5,000 bytes, put this fileset in your task: > > > > > > > > > To get a list of all the files which are unchanged since Ant 1.4.1, use this: > > > > > > > > > Hope that is clearer. > > > > -- > To unsubscribe, e-mail: > For additional commands, e-mail: > > -- To unsubscribe, e-mail: For additional commands, e-mail: