ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From <Jan.Mate...@rzf.fin-nrw.de>
Subject AW: check property file exists and which properties are missing in Ant 1.8?
Date Thu, 11 Feb 2010 11:20:15 GMT
>I'm giving Ant 1.8.0 a try on a new project. I'd like to ask if there
>have been any changes for loading property files (break the build if 
>they're not found) 

should not.
But using <property file/> the specified property file doesnt have to
exist - since a long time...


> and if ant can report on the properties missing.
>Are there any related ant-contrib tasks?

<fail> with <isset> condition.


<macrodef name="requireFile">
    <attribute name="file"/>
    <sequential>
        <fail message="@{file} does not exist.">
            <condition>
                <not><available file="@{file}"/></not>
            </condition>
        </fail>
    </sequential>
</macrodef>

<macrodef name="requireProperty">
    <attribute name="property"/>
    <sequential>
        <fail message="@{property} does not exist.">
            <condition>
                <not><isset property="@{property}"/></not>
            </condition>
        </fail>
    </sequential>
</macrodef>




Jan

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


Mime
View raw message