NAME
Perl::Dist::WiX::Util::Machine - Generate an entire set of related distributions
DESCRIPTION
Perl::Dist::WiX::Util::Machine is a Perl::Dist multiplexor.
It provides the functionality required to generate several variations of a distribution at the same time.
SYNOPSIS
# This is what Perl::Dist::Strawberry does, as of version 2.00_02.
# Create the machine
my $machine = Perl::Dist::WiX::Util::Machine->new(
class => 'Perl::Dist::Strawberry',
common => [ forceperl => 1 ],
);
# Set the different versions
$machine->add_dimension('version');
$machine->add_option('version',
perl_version => '589',
build_number => 2,
);
$machine->add_option('version',
perl_version => '5101',
);
$machine->add_option('version',
perl_version => '5100',
portable => 1,
);
# Set the different paths
$machine->add_dimension('drive');
$machine->add_option('drive',
image_dir => 'C:\strawberry',
);
$machine->add_option('drive',
image_dir => 'D:\strawberry',
msi => 1,
zip => 0,
);
$machine->run();
# Creates 6 distributions (really 5, because you can't have
# portable => 1 and zip => 0 for the same distribution.)
INTERFACE
new
my $machine = Perl::Dist::WiX::Util::Machine->new(
class => 'Perl::Dist::WiX',
common => [ forceperl => 1, ],
output => 'C:\',
);
This method creates a new machine to generate multiple distributions, using two required parameters and one optional parameter.
class (required)
This parameter specifies the class that the machine uses to create distributions.
It must be a subclass of Perl::Dist::WiX.
common (required)
This parameter specifies the parameters that are common to all the distributions that will be created.
output (optional)
This is the directory where all the output files will be copied to.
If none is specified, it defaults to what File::HomeDir thinks is the desktop.
add_dimension
$machine->add_dimension('perl_version');
Adds a 'dimension' (a set of options for different distributions) to the machine.
The options are added by add_option calls using this dimension name.
Note that dimensions are multiplicative, so that if there are 3 dimensions defined in the machine, and they each have 3 options, 27 distributions will be generated.
add_option
Adds a 'option' (a set of parameters that can change) to a dimension.
all
my @dists = $machine->all();
Returns an array of objects that create all the possible distributions configured for this machine.
next
my $dist = $machine->next();
Returns an objects that creates the next possible distribution that is configured for this machine.
run
$machine->run();
Tries to create and execute each object that can be created by this machine.
SUPPORT
Bugs should be reported via the CPAN bug tracker at
http://rt.cpan.org/NoAuth/ReportBug.html?Queue=Perl-Dist-WiX
For other issues, contact the author.
AUTHOR
Curtis Jewell <adamk@cpan.org>
Adam Kennedy <adamk@cpan.org>
COPYRIGHT
Copyright 2009 - 2010 Curtis Jewell.
Copyright 2007 - 2009 Adam Kennedy.
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
The full text of the license can be found in the LICENSE file included with this module.