ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Trent Ohannessian" <toh...@gmail.com>
Subject Am I completely misunderstanding the fail/unless task?
Date Wed, 03 May 2006 19:31:41 GMT
Hey all,

I'm trying to error the build if a command line parameter isn't passed in.
This seems simple enough but it's not working as I anticipated and I still
don't get why this isn't working after reading through several docs.  Here
is the command line call:

webtest -Denv=dev -buildfile webtest.xml

And here is the first portion of the buildfile:

<project name="InstallationCheck" basedir="." default="login">

    <fail unless="${env}" >

    Missing environment parameter.

    Here is env: ${env}

    Usage:
        webtest -buildfile webtest.xml -Denv=[dev | qa | stg | prod]
    </fail>
...

I assumed that would fail only if ${env} wasn't present.  Notice how I print
out ${env} in the failure message.  Now, here is the output when this
buildfile is run with the command line call from above:

Buildfile: webtest.xml

BUILD FAILED
D:\Open Source Projects\Canoo Web Test\my_tests\webtest.xml:3: Missing
environment parameter.

        Here is env: dev

        Usage:
                webtest -buildfile webtest.xml -Denv=[dev | qa | stg | prod]

Total time: 0 seconds

How can this be failing when when env is printed out in the failure message?

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message