1#line 1 2package Module::Install::Build; 3 4use strict; 5use Module::Install::Base; 6 7use vars qw{$VERSION $ISCORE @ISA}; 8BEGIN { 9 $VERSION = '0.67'; 10 $ISCORE = 1; 11 @ISA = qw{Module::Install::Base}; 12} 13 14sub Build { $_[0] } 15 16sub write { 17 my $self = shift; 18 die "Build->write() takes no arguments\n" if @_; 19 20 my %args; 21 my $build; 22 23 $args{dist_name} = $self->name || $self->determine_NAME($self->{args}); 24 $args{license} = $self->license; 25 $args{test_files} = $self->tests; 26 $args{dist_version} = $self->version || $self->determine_VERSION($self->{args}); 27 $args{dist_abstract} = $self->abstract; 28 $args{dist_author} = $self->author; 29 $args{sign} = $self->sign; 30 $args{no_index} = $self->no_index; 31 32 foreach my $key (qw(build_requires requires recommends conflicts)) { 33 my $val = eval "\$self->$key" or next; 34 $args{$key} = { map @$_, @$val }; 35 } 36 37 %args = map {($_, $args{$_})} grep {defined($args{$_})} keys %args; 38 39 require Module::Build; 40 $build = Module::Build->new(%args); 41 $build->add_to_cleanup(split /\s+/, $self->clean_files); 42 $build->create_build_script; 43} 44 45sub ACTION_reset { 46 my ($self) = @_; 47 die "XXX - Can't get this working yet"; 48 require File::Path; 49 warn "Removing inc\n"; 50 rmpath('inc'); 51} 52 53sub ACTION_dist { 54 my ($self) = @_; 55 die "XXX - Can't get this working yet"; 56} 57 58# <ingy> DrMath: is there an OO way to add actions to Module::Build?? 59# <DrMath> ingy: yeah 60# <DrMath> ingy: package MyBuilder; use w(Module::Build; @ISA = qw(w(Module::Build); sub ACTION_ingy 61# {...} 62# <DrMath> ingy: then my $build = new MyBuilder( ...parameters... ); 63# $build->write_build_script; 64 651; 66 67__END__ 68 69#line 180 70