ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Nelson, Laird" <Laird.Nel...@time0.com>
Subject RE: [RFE] Default Help target on error ?
Date Tue, 25 Jul 2000 12:40:48 GMT
> -----Original Message-----
> From: Stefan Bodewig [mailto:bodewig@bost.de]
> Laird, I'm not familiar with nmake. What kind of tests does it
> perform? Could you please elaborate a little?

Actually, I'm not too familiar with it either.  Basically the idea is that
before a makefile runs, you can execute some tests in a programmatic way to
see if the platform you're about to run make on can support that makefile.
For example, suppose your makefile wants to invoke the frob command as part
of some target, but frob isn't there.  nmake can crap out somewhat
gracefully (as opposed to the usual make way of doing things which is to try
to blindly execute shell commands) with a message.  So, although I have no
idea what the syntax is for such tests, your makefile might look
(imaginarily) like this:

  if !exists "frob"
    make-error "The frob command does not seem to be present."
  endif

  sometarget : someFiles
      frob $^

So I could envision a task that would request a System.exit() somehow if a
given condition were not met.  Kind of like GNU's "configure" only a hell of
a lot less hairy--like, WAY less hairy--and included in the buildfile
itself:

  <project>
    <existence-test-of-some-kind condition="exists(somecommand)"
                                 message="somecommand doesn't exist">
    ...
  </project>

(Obviously that syntax sucks, but you get the idea.  If that task fails, ant
exits with the specified message.  Perhaps this is an overlap as well with
the "available" task (I'll have to go back and read the messages), only more
generalized?)

Also, existence is just one kind of test.  You could check ideally for any
boolean condition available to the VM.

Hope that's somewhat clearer.

Cheers,
Laird

Mime
View raw message