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" />
<?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" />