Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Searching directories with wildcards

Status
Not open for further replies.

pimp1911

MIS
Aug 20, 2007
4
I am noob so bear with me. I am creating a build.xml file and in it I have a target that initializes the environment. Before ant runs it searches a directory called source to see if a certain file type is available(via a condition). If the condition fails a message appears. I need help looking for certain files vs hard coding each filename that is suppose to appear in the directory. See below.

<?xml version="1.0" ?>
<project default="main">
<property name="message" value="Building the .jar file."/>
<property name="src" location="source"/>
<property name="output" location="bin"/>

<target name="main" depends="init,compile, compress" description="Main Target">
<echo>
${message}
</echo>
</target>
<target name="init" description="Initalize Environment Target">
<mkdir dir="${output}"/>
<condition property="check.source">
<and>
<available file="${src}/*.java"/>
</and>
</condition>
<fail message="No source files located in source directory." unless="check.source" />
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top