[Bps-public-commit] r9857 - in bpsbuilder/BPB: .

sunnavy at bestpractical.com sunnavy at bestpractical.com
Sun Dec 9 10:54:37 EST 2007


Author: sunnavy
Date: Sun Dec  9 10:54:37 2007
New Revision: 9857

Added:
   bpsbuilder/BPB/lib/BPB/Script/Build.pm
Modified:
   bpsbuilder/BPB/   (props changed)

Log:
 r25374 at sun-navys-macbook:  sunnavy | 2007-12-09 14:18:17 +0800
 added build cli


Added: bpsbuilder/BPB/lib/BPB/Script/Build.pm
==============================================================================
--- (empty file)
+++ bpsbuilder/BPB/lib/BPB/Script/Build.pm	Sun Dec  9 10:54:37 2007
@@ -0,0 +1,46 @@
+package BPB::Script::Build;
+
+use warnings;
+use strict;
+use Carp;
+
+use base qw/App::CLI::Command Class::Accessor::Fast/;
+__PACKAGE__->mk_accessors(qw/config name target/);
+
+use BPB;
+
+sub options {
+    (
+        'n|name=s'   => 'name',
+        'c|config=s' => 'config',
+        't|target=s' => 'target',
+    );
+}
+
+sub run {
+    my $self   = shift;
+    my $target = shift;
+    $self->target($target) if $target;
+    my $bpb = BPB->new( config => $self->config, name => $self->name );
+    $bpb->backend->export( target => $self->target );
+
+    # yeah, export's target is the source for build
+    $bpb->build->run( source => $self->target );
+}
+
+1;
+
+__END__
+
+=head1 AUTHOR
+
+sunnavy  C<< <sunnavy at bestpractical.com> >>
+    
+
+=head1 LICENCE AND COPYRIGHT
+
+Copyright 2007 Best Practical Solutions.
+
+This program is free software; you can redistribute it and/or modify it
+under the same terms as Perl itself.
+



More information about the Bps-public-commit mailing list