ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Herman, Dave" <dher...@intrado.com>
Subject <fail> if/unless?
Date Wed, 16 Jan 2002 18:21:18 GMT
Hello,

Would it be useful to add optional "if" and "unless" parameters to the
<fail> task, so that you don't have to go through the rather ugly process of
making a separate little target?

For example, you can currently find yourself in a situation like this
(unless there's a more elegant method I haven't thought of):

    <!-- run junit, generate reports, then fail if errors occurred -->
    <target name="junit">
        <junit failureProperty="junit.failed" ... />
        <junitreport ... />
        <antcall target="check-junit-failures"/>
    </target>

    <target name="check-junit-failures" if="junit.failed">
        <fail message="JUnit failed."/>
    </target>

But it might be nicer to be able to do:

    <!-- run junit, generate reports, then fail if errors occurred -->
    <target name="junit">
        <junit failureProperty="junit.failed" ... />
        <junitreport ... />
        <fail message="JUnit failed." if="junit.failed"/>
    </target>

Or does this get into the ugly arguments about conditionals?

Thanks,
Dave H

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


Mime
View raw message