- FUNCTIONS TO BE IMPLEMENTED BY SUBCLASSES
Data::Hopen::Gen - Base class for hopen generators
The code that generates blueprints for specific build systems lives under
Data::Hopen::Gen. Data::Hopen::Phase::Gen calls modules under
Data::Hopen::Gen to create the blueprints. Those modules must implement the interface defined here.
(Required) A Path::Class::Dir instance specifying the root directory of the project.
(Required) A Path::Class::Dir instance specifying where the generated output (e.g., blueprint or other files) should be written.
A generator (
Data::Hopen::Gen subclass) is a Visitor plus some.
Note: The generator does not have access to Data::Hopen::G::Link instances. That lack of access is the primary distinction between Ops and Links.
$Generator->asset([-asset=>]$asset, [-from=>]$from[, [-how=>]$how]);
$how is specified, it will be saved in the
AssetOp for use later. Later calls with the same asset and a defined
$how will overwrite the
how value in the
AssetOp. Specify 'UNDEF' as the
$how to expressly undefine a
Add a dependency edge between two assets or goals. Any assets must have already been added using "asset". Usage:
TODO add missing assets automatically?
Runs the build tool for which this generator has created blueprint files. Runs the tool with the destination directory as the current dir.
(Required) Returns the name of the App::hopen::G::AssetOp subclass that should be used to represent assets in the
(Required) Returns the package stem of the default toolset for this generator.
When a hopen file invokes
use language "Foo", hopen will load
<stem> is the return value of this function.
As a sanity check, hopen will first try to load
Data::Hopen::T::<stem>, so make sure that is a valid package.
(Optional) Do whatever the generator wants to do to finish up. By default, no-op. Is provided the Data::Hopen::G::DAG instance as a parameter. Usage:
(Optional) Implementation of "run_build". The default does not die, but does warn().
(Optional) Do whatever the generator wants to do with a Data::Hopen::G::Goal. For example, the generator may change the goal's
outputs. By default, no-op. Usage: