You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ant.apache.org by Berin Loritsch <bl...@apache.org> on 2001/08/10 23:02:57 UTC

[FER] Interactive Builds

(FER = Feature Enhancement Request)

It would be beneficial in some circumstances to have an interactive build.
On the Avalon project we use Ant to automate just about everything that can
be automated, including most parts of making a release.  We automatically
generate our email announcement text, our Jakarta news entry, and our
distribution HEADER.html files using Ant.

There are times when we want to embed information in the announcement that
would be for a particular release (such as the reasons for upgrading, etc).
It would be beneficial to have Ant ask for the user input and embed that
input into a property.  The task would look something like this:

<user-input property="datasource.name">
  <prompt>What is the name of your DataSource?</prompt>
  <check>
    <not-empty message="You must specify a name"/>
  </check>
</user-input>

<user-input property="informix.driver">
  <prompt>Please input the path to your Informix Driver?</prompt>
  <check>
    <valid-path/>
    <default value="/www/jakarta/etc"/>
  </check>
</user-input>

The <prompt/> element and the "property" attribute would always be required.
If there is a <check/> element (optional) then the input would have to match
some *simple* criteria.  Valid constraints would be:

Constraint Name        Action
---------------        ------
not-empty              Checks the user input for a string that contains more
                       than white space.  If "message" attribute is present
                       and the input fails this constraint, display message,
                       and prompt again for user input.

valid-path             Checks the user input for a valid path.  If the input
                       is empty or is not a valid path then do not define the
                       property.  (If "not-empty" is present as well, then
                       failure of this constraint constitutes an empty input).

default                Checks the user input for the same criteria as "not-empty"
                       but places the value in the mandatory "value" attribute
                       in the property if the input fails this constraint.

These constraints should be all that would be expected of a build system.  This
also allows Ant to be used as a "poor man's" installer package.

Re: [FER] Interactive Builds

Posted by Stefan Bodewig <bo...@apache.org>.
On Fri, 10 Aug 2001, Berin Loritsch <bl...@apache.org> wrote:

> (FER = Feature Enhancement Request)

I've seen RFE as an acronym for "Request For Enhancement" more often 8-)

> It would be beneficial in some circumstances to have an interactive
> build.

Yep - this is on the list of things we definitely want to do - having
some means to ask the user for input - it is even on the list of
features for Ant2.

The problem is not so much the task itself, but the changes we'd need
to make to the core - we don't want to have the prompte sent to
System.out and the answer to be read from System.in when the build
itself gets run from Antidote.

Therefore we've been kicking around ideas how to abstract the prompt
and how to implement it in the current Ant1 framework - we don't get
to a conclusion in time for Ant 1.4 though.

Stefan