[Bps-public-commit] r9859 - in bpsbuilder/BPB: .
sunnavy at bestpractical.com
sunnavy at bestpractical.com
Sun Dec 9 10:55:03 EST 2007
Author: sunnavy
Date: Sun Dec 9 10:55:02 2007
New Revision: 9859
Modified:
bpsbuilder/BPB/ (props changed)
bpsbuilder/BPB/lib/BPB/Script/Build.pm
Log:
r25376 at sun-navys-macbook: sunnavy | 2007-12-09 15:38:33 +0800
refactor build cli
Modified: bpsbuilder/BPB/lib/BPB/Script/Build.pm
==============================================================================
--- bpsbuilder/BPB/lib/BPB/Script/Build.pm (original)
+++ bpsbuilder/BPB/lib/BPB/Script/Build.pm Sun Dec 9 10:55:02 2007
@@ -5,27 +5,33 @@
use Carp;
use base qw/App::CLI::Command Class::Accessor::Fast/;
-__PACKAGE__->mk_accessors(qw/config name target/);
+__PACKAGE__->mk_accessors(
+ qw/config name install_directory build_directory skip_test/ );
use BPB;
sub options {
(
- 'n|name=s' => 'name',
- 'c|config=s' => 'config',
- 't|target=s' => 'target',
+ 'n|name=s' => 'name',
+ 'c|config=s' => 'config',
+ 'i|install_directory=s' => 'install_directory',
+ 'b|build_directory=s' => 'build_directory',
+ 'skip_test' => 'skip_test',
);
}
sub run {
- my $self = shift;
- my $target = shift;
- $self->target($target) if $target;
+ my $self = shift;
+ my $install_directory = shift;
+ $self->install_directory($install_directory) if $install_directory;
+
my $bpb = BPB->new( config => $self->config, name => $self->name );
- $bpb->backend->export( target => $self->target );
+ $bpb->backend->export( target => $self->build_directory
+ || $bpb->config->name->{build}{build_directory} );
# yeah, export's target is the source for build
- $bpb->build->run( source => $self->target );
+ $bpb->build->run( map { $_ => $self->$_ }
+ qw/build_directory install_directory skip_test/ );
}
1;
More information about the Bps-public-commit
mailing list