Update of /cvsroot/module-build/Module-Build/inc
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv23059/inc
Modified Files:
ModuleBuildBuilder.pm
Log Message:
Some changes to the way Module::Build itself is bundled up for
distribution: 1) it now autogenerates the listing of actions near the
top of the M::B documentation. 2) it now autogenerates a listing of
get/set accessors that wouldn't otherwise be documented at all. 3) it
now erases any trace of the ModuleBuildBuilder module that does this
stuff, since it's not necessary for people downloading from CPAN to
know anything about it.
Index: ModuleBuildBuilder.pm
===================================================================
RCS file: /cvsroot/module-build/Module-Build/inc/ModuleBuildBuilder.pm,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** ModuleBuildBuilder.pm 4 Nov 2004 01:42:38 -0000 1.1
--- ModuleBuildBuilder.pm 18 Dec 2004 20:57:04 -0000 1.2
***************
*** 10,23 ****
$self->SUPER::ACTION_distdir(@_);
! my $base = $INC{'Module/Build/Base.pm'};
! open my($fh), $base or die "Couldn't read $base: $!";
my %subs = map {$_,1} map +(/^\s*sub (\w+)/)[0], <$fh>;
my @need_doc = sort grep !$subs{$_}, $self->valid_properties;
! $self->run_perl_script(File::Spec->catfile($self->dist_dir, qw(lib Module Build.pm)),
['-pi',
'-e',
qq[s{<autogenerated_accessors>}{ join "\\n\\n", map "=item \$_()", qw(@need_doc) }e] ],
! [],
! );
}
--- 10,42 ----
$self->SUPER::ACTION_distdir(@_);
! my $build_pl = File::Spec->catfile($self->dist_dir, qw(Build.PL));
! my $build_pm = File::Spec->catfile($self->dist_dir, qw(lib Module Build.pm));
! my $base_pm = File::Spec->catfile($self->dist_dir, qw(lib Module Build Base.pm));
! my $authoring_pod = File::Spec->catfile($self->dist_dir, qw(lib Module Build Authoring.pod));
!
! open my($fh), $base_pm or die "Couldn't read $base_pm: $!";
my %subs = map {$_,1} map +(/^\s*sub (\w+)/)[0], <$fh>;
+ # Replace "<autogenerated_accessors>" with some POD lists
my @need_doc = sort grep !$subs{$_}, $self->valid_properties;
! $self->run_perl_script($authoring_pod,
['-pi',
'-e',
qq[s{<autogenerated_accessors>}{ join "\\n\\n", map "=item \$_()", qw(@need_doc) }e] ],
! []);
!
! # Replace "<action_list>" with a list of actions
! my $action_text = $self->_action_listing(scalar $self->known_actions);
! $self->run_perl_script($build_pm,
! ['-pi', '-e', qq[s{<action_list>}{$action_text}]],
! []);
!
! # Finally, sneakily rewrite the Build.PL to use a vanilla
! # Module::Build object instead of a ModuleBuildBuilder.
! $self->run_perl_script($build_pl,
! ['-pi', '-e', qq[BEGIN{\$/=undef} s{<remove_me>.*</remove_me>}{}gs]],
! []);
! $self->run_perl_script($build_pl,
! ['-pi', '-e', qq[s{ModuleBuildBuilder}{Module::Build}gs]],
! []);
}
|