Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I check if file exists, and if not kill the build?

Tags:

ant

How can I stop a build, and notify the user if a file does not exist? I know I can use the available task to set a property if a file exists, but I'm not sure how I would stop a build and echo something.

I would like to stick with core tasks if possible.

like image 781
Steve Avatar asked Oct 28 '09 15:10

Steve


1 Answers

You can use the fail task for all your failing needs. The last example on that page is actually pretty much what you need

<fail message="Files are missing.">
    <condition>
        <not>
            <resourcecount count="2">
                <fileset id="fs" dir="." includes="one.txt,two.txt"/>
            </resourcecount>
        </not>
    </condition>
</fail>
like image 155
stimms Avatar answered Oct 14 '22 10:10

stimms