Not doing any test but you should use an <or> selector
and not an <and> selector (a file cannot be named "foo" and "bar").

Also for a simple selection like this one should just use:
<fileset id="files" dir="${basedir}">
 <include name="foo"/>
 <include name="bar"/>
</fileset>

or should that be
 <include name="**/foo"/>
to get any file named "foo" in any of the subdirectories of ${basedir}.

Peter

Holger Rauch wrote:

Hi!

I'm using Ant 1.6.2 on Linux and having trouble with selectors in a fileset.
In the following small build file "foo" and "bar" are NOT included in the
fileset even though these two files actually exist. Unfortunately, running
"ant -d" doesn't give me additional info and reading the Ant manual on
selectors wasn't of much help either.

Running "ant -d" only tells me the following with regard to my fileset:

fileset: Setup scanner in dir /home/hrauch/bazl/sign-test/ant-feature-tests
with patternSet{ includes: [] excludes: [] }
Setting project property: files.converted ->

Why aren't my files listed in the property files.converted?

TIA for any help!

------------------------------------------------------------------

<?xml version="1.0" encoding="iso-8859-1"?>

<project name="fileset-selector-test" default="do-test" basedir=".">

 <target name="prepare">
   <touch file="${basedir}/foo" />
   <touch file="${basedir}/bar" />
 </target>

 <target name="do-test" depends="prepare">
   <fileset id="files" dir="${basedir}">
     <and>
        <selector>
          <filename name="foo" />
        </selector>
        <selector>
          <filename name="bar" />
        </selector>
     </and>
   </fileset>
   <property name="files.converted" refid="files" />
   <echo message="property files.converted = ${files.converted}" />
 </target>

</project>

------------------------------------------------------------------

Greetings,

        Holger

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]







---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to