NAME

ExtUtils::Builder::Planner - An ExtUtils::Builder Plan builder

VERSION

version 0.004

SYNOPSIS

my $planner = ExtUtils::Builder::Planner->new;
$planner->create_node(
    target       => 'foo',
    dependencies => [ 'bar' ],
    actions      => \@actions,
);
my $plan = $planner->materialize;

DESCRIPTION

METHODS

add_node($node)

This adds an ExtUtils::Builder::Node to the planner.

create_node(%args)

This creates a new node and adds it to the planner using add_node. It takes the same named arguments as ExtUtils::Builder::Node.

  • target

    The target of the node. This is mandatory.

  • dependencies

    The list of dependencies for this node.

  • actions

    The actions to perform to create or update this node.

  • phony

    A boolean to mark a target as phony. This defaults to false.

add_plan($plan)

This adds all nodes in the plan to the planner.

add_delegate($name, $sub)

This adds $sub as a helper method to this planner, with the name $name.

create_phony($target, @dependencies)

This is a helper function that calls create_node for a action-free phony target.

load_module($extension, %options)

This adds the delegate from the given module

new_scope()

This opens a new scope on the planner. It return a child planner that shared the build tree state with its parent, but any delegated added to it will not be added to the parent.

run_dsl($filename)

This runs $filename as a DSL file. This is a script file that includes Planner methods as functions. For example:

 use strict;
 use warnings;

 create_node(
     target       => 'foo',
     dependencies => [ 'bar' ],
     actions      => [
		command(qw/echo Hello World!/),
		function(module => 'Foo', function => 'bar'),
		code(code => 'print "Hello World"'),
	 ],
 );

 load_module("Foo");

 add_foo("a.foo", "a.bar");

This will also add command, function and code helper functions that correspond to ExtUtils::Builder::Action::Command, ExtUtils::Builder::Action::Function and ExtUtils::Builder::Action::Code respectively.

materialize()

This returns a new ExtUtils::Builder::Plan object based on the planner.

AUTHOR

Leon Timmermans <fawaka@gmail.com>

COPYRIGHT AND LICENSE

This software is copyright (c) 2013 by Leon Timmermans.

This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.