Test::AutoBuild::Runtime - Builder runtime state
use Test::AutoBuild::Runtime; my $runtime = new Test::AutoBuild::Runtime (archive_manager => $archive_manager, monitors => \%monitors, repositories => \%repositories, modules => \%modules, package_types => \%package_types, publishers => \%publishers, groups => \%groups, platforms => \%platforms, source_root => $dir, install_root => $dir, package_root => $dir, log_root => $dir, counter => $counter); my $archive = $runtime->archive; my @monitor_names = $runtime->monitors; my @repository_names = $runtime->repositories; my @module_names = $runtime->modules; my @package_types_names = $runtime->package_types; my @publisher_names = $runtime->publishers; my @group_names = $runtime->groups; my @platform_names = $runtime->platforms; my $monitor = $runtime->monitor($name); my $repository = $runtime->repository($name); my $module = $runtime->module($name); my $package_type = $runtime->package_type($name); my $publisher = $runtime->publisher($name); my $group = $runtime->group($name); my $platform = $runtime->platform($name); $runtime->attribute($key, $value); my $value = $runtime->attribute($key); my %attributes = $runtime->attributes() my $dir = $runtime->source_root(); my $dir = $runtime->install_root(); my $dir = $runtime->package_root(); my $dir = $runtime->log_root();
This module provides access to the core objects comprising the build engine, including monitors, repositories, modules, package types, publishers and groups. The runtime state object is made available to the run method of stages in the build engine.
run
Creates a new runtime state object. The archive parameter requires an instance of the Test::AutoBuild::Archive module. The monitors parameter requires an hash reference of Test::AutoBuild::Monitor objects. The monitors parameter requires an hash reference of Test::AutoBuild::Repository objects. The repositories parameter requires an hash reference of Test::AutoBuild::Module objects. The package_types parameter requires an hash reference of Test::AutoBuild::PackageType objects. The publishers parameter requires an hash reference of Test::AutoBuild::Publisher objects. The groups parameter requires an hash reference of Test::AutoBuild::Group objects. The platforms parameter requires an hash reference of Test::AutoBuild::Platform objects.
archive
monitors
repositories
package_types
publishers
groups
platforms
Regenerates the internally cached sorted list of modules, by performing a topological sort of modules against their declared build dependancies. There is generally no need to call this method.
Returns an instance of the Test::AutoBuild::ArchiveManager module to use for persisting build state across cycles.
Returns the active archive object
Returns a list of monitor names, which can be used to retrieve a Test::AutoBuild::Monitor object from the monitor method.
monitor
Retrieves the Test::AutoBuild::Monitor object corresponding to the name specified by the $name parameter.
$name
Returns a list of repository names, which can be used to retrieve a Test::AutoBuild::Repository object from the repository method.
repository
Retrieves the Test::AutoBuild::Repository object corresponding to the name specified by the $name parameter.
Returns a list of module names, which can be used to retrieve a Test::AutoBuild::Module object from the module method.
module
Returns a list of module names, sorted topologically according to their declared build dependancies. The names can be used to retrieve a Test::AutoBuild::Module object from the module method.
Retrieves the Test::AutoBuild::Module object corresponding to the name specified by the $name parameter.
Returns a list of package type names, which can be used to retrieve a Test::AutoBuild::PackageType object from the package_type method.
package_type
Retrieves the Test::AutoBuild::PackageType object corresponding to the name specified by the $name parameter.
Returns a list of publisher names, which can be used to retrieve a Test::AutoBuild::Publisher object from the publisher method.
publisher
Retrieves the Test::AutoBuild::Publisher object corresponding to the name specified by the $name parameter.
Returns a list of group names, which can be used to retrieve a Test::AutoBuild::Group object from the group method.
group
Retrieves the Test::AutoBuild::Group object corresponding to the name specified by the $name parameter.
Returns a list of platform names, which can be used to retrieve a Test::AutoBuild::Platform object from the platform method.
platform
Retrieves the Test::AutoBuild::Platform object corresponding to the name specified by the $name parameter.
Retrieves the attribute value corresponding to the key given in the $name parameter. If the optional $value parameter is supplied, then the attribute value is set.
$value
Returns the names of the runtime attributes passed between stages
Returns the unique counter for this cycle of the builder
Returns the time to which the source repositories are synchronized
Notify all monitors about the event specified by the $event_name parameter. The following @args are event dependant and passed through to monitors unchanged.
$event_name
@args
Retrieve the directory in which modules' sources are checked out from the repositories
Retrieve the directory into which modules install built files.
Retrieve the directory in which binary packages are placed.
Retrieve the directory in which log files are placed.
Takes a snapshot of all packages on disk for each package type. The keys in the returned hash ref will be the fully qualified filenames of the packages, while the values will be instances of Test::AutoBuild::Package class.
Replaces macros of the form %key in the string provided in the $value argument. A macro can expand to multiple values, so the single input, can turn into multiple outputs, hence the return from this method is an array of strings. A macro which usually expands to multiple values can be restricted to a single value by specifying the value in the optional %restrictions parameter.
%restrictions
The macros which will be expanded are:
List of modules, or the 'module' entry in the %restrictions parameter
List of package types, or the 'package_type' entry in the %restrictions parameter
List of groups, or the 'group' entry in the %restrictions parameter
List of repositories, or the 'reposiry' entry in the %restrictions parameter
Hostname of the builder
Build cycle counter
Returns a hash containing the set of shell environment variables to set when running the commands for the module $module. The following environment variables are set
$module
Legacy variable for compatability with Test-AutoBuild 1.0.x. Use $AUTOBUILD_INSTALL_ROOT instead.
Legacy variable for compatability with Test-AutoBuild 1.0.x. Use $AUTOBUILD_COUNTER instead.
The location into which a module will install its files, typically used as value for --prefix argument to configure scripts. This is based on the value return by the install_root method.
install_root
The location into which a module will create binary packages. For example, $AUTOBUILD_PACKAGE_ROOT/rpm would be used to set %_topdir when building RPMs. This is based on the value return by the package_root method.
package_root
The location into which the module was checked out. This is based on the value return by the install_root method.
The name of the module being built. This can be used in conjunction with the $AUTOBUILD_SOURCE_ROOT to determine the top level directory of the module's source.
The build counter value, based on the value return by the build_counter method. This counter is not guarenteed to be different on each build cycle
build_counter
The build counter value, based on the value return by the build_counter method. This counter will uniquely refer to a particular checkout of the source code.
The returned hash will also include module specific environment entries from the env method.
env
Daniel P. Berrange <dan@berrange.com>
Copyright (C) 2005 Daniel Berrange <dan@berrange.com>
perl(1), Test::AutoBuild::Stage, Test::AutoBuild::Module, Test::AutoBuild::Repository, Test::AutoBuild::PackageType, Test::AutoBuild::Monitor, Test::AutoBuild::Group, Test::AutoBuild::Publisher
perl(1)
To install Test::AutoBuild, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Test::AutoBuild
CPAN shell
perl -MCPAN -e shell install Test::AutoBuild
For more information on module installation, please visit the detailed CPAN module installation guide.