ExtUtils::Builder::Action(3pm)

ExtUtils::Builder::Action3pm

The extutils::builder action role

Usage

 $_->execute for @actions;
 
 open my $script, '>', 'foo.sh';
 print $script shell_quote(@{$_}) for map { $_->to_command } @actions;

Version

version 0.017

Overview

Actions are the cornerstone of the ExtUtils::Builder framework. They provide an interface between build tools (ExtUtils::MakeMaker, Module::Build) and building extensions. This allows both sides to be completely independent from each other. It is a flexible abstraction around pieces of work, this work can be a piece of perl code, an external command, a mix of those or possibly other things.

Overview

An action can be consumed in many ways. It can be "execute"d, which is often the simplest way to deal with them. It can be serialized to commands that can be passed on to system or strings that can be "eval"led. If a consumer can deal with multiple of these, the "preference" method can be used to choose between options. On composite actions, "flatten" can be called to retrieve the constituent actions, on primitive actions it's just an identity operator. This is particularly useful before calling preference, because different sub-actions are likely to have different preferences.

Methods

execute(%arguments)

Execute this action immediately. This may throw an exception on errors, but doesn't otherwise return anything. %arguments may be used by the command.

•

quiet

If true, this suppresses logging.

to_command(%options)

Convert the action into a set of platform appropriate commands. It returns a list of array-refs, each array-ref being an individual command that can be passes to "system" or equivalent. %options can influence how something is serialized in action-type specific ways, but shouldn't fundamentally affect the action that is performed. All options are optional.

perl

This contains the path to the current perl interpreter.

config

This should contain an ExtUtils::Config object, or equivalent.

to_code(%options)

This returns a list of strings that can be evalled to sub-refs. %options can influence how something is serialized in action-type specific ways, but shouldn't fundamentally affect the action that is performed.

to_code_hash(%options)

This returns a list of hashes that can be used to create Action::Code objects.

preference(@possibilities)

This action returns the favored out of @possibilities. Valid values are "execute", "code", "command", "flatten". If no arguments are given, the favorite from all valid values is given.

flatten

This action returns all actions behind this action. It may return itself, it may return a long list of actions, it may even return an empty list.

Author

Leon Timmermans <[email protected]>

From libextutils-builder-perl 0.017-1 in Debian 13 (Trixie). Parsed by carta from the page's man source.