More on Actions, routes and builders in general

Bram Moolenaar <[email protected]> Sat, 12 Jun 2004 18:01:20 +0200
Newsgroups gmane.comp.tools.aap.devel
Message-ID <[email protected]>
Previously I discussed whether we should add "builders" to Aap.  After
looking deeper into this issue I came to the conclusion that Aap actions
almost did what was needed.  Expanding actions to behave like a builder
is relatively simple and, perhaps more important, backwards compatible.

I have now implemented a new way to define an action, using the Python
function define_action().  This is simpler to use than action_add(),
which was previously used in tools.  And allows for more features.

Docs are available here:
	http://www.a-a-p.org/exec/ref-python.html#python-define-action

One of the new things about actions is that an action can be marked as a
"primary" action.  A primary action is the first choice for turning its
input filetypes into the supported output filetypes.  When using a
command like ":program" Aap can now search for actions that do the
required compiling and/or building.  As a result most ":route" commands
can be omitted.

Note that a tool-specific compile action should not be primary, it is
invoked indirectly from the default compile action.  The
$C_COMPILE_ACTION variable is used for this, just like before.

More explanations in the documentation.  I have already updated the
default.aap recipe to use define_action() where needed.  I also updated
the gcc tool and the libtool module.  But most other tools still need to
be done.

This was quite a big change.  Please verify that Aap still works
properly with your recipe.  Especially with C++, libtool and other
non-obvious building.

When it works, please have a look at the tools you use and if they can
profit from using define_action().  Especially for defining more
supported filetypes.  For example, if the build action supports a "def"
type, then ":program" should be able to recognize that and handle it
properly.

One decision I would like to mention: I previously thought a Builder
could consist of multiple steps.  E.g., to turn a lex file in to C and
then into an object file.  I now think it is simpler to define the
separate steps as primary actions.  Aap will be able to figure out that
two steps in sequence need to be used.  I tested this with a lex file,
but not yet with something more complicated (more than two steps).

The new version has been checked in to CVS.  Let's hear it when
something doesn't work right!

-- 
hundred-and-one symptoms of being an internet addict:
98. The Alta Vista administrators ask you what sites are missing
    in their index files.

 /// Bram Moolenaar -- [email protected] -- http://www.Moolenaar.net   \\\
///        Sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\              Project leader for A-A-P -- http://www.A-A-P.org        ///
 \\\  Buy at Amazon and help AIDS victims -- http://ICCF.nl/click1.html ///


-------------------------------------------------------
This SF.Net email is sponsored by the new InstallShield X.
From Windows to Linux, servers to mobile, InstallShield X is the
one installation-authoring solution that does it all. Learn more and
evaluate today! http://www.installshield.com/Dev2Dev/0504