Skip to content

Commit bad4227

Browse files
committed
Add --html_links=0, greatly speeding up tests.
1 parent 11b063a commit bad4227

File tree

4 files changed

+25
-10
lines changed

4 files changed

+25
-10
lines changed

Changes

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,10 @@ Revision history for Perl extension Module::Build.
1616
- Added an 'extra_manify_args' parameter to facilitate man pages
1717
containing Unicode. [Joenio Costa]
1818

19+
- Added an '--html_links 0' argument for the 'html' action, which
20+
can hugely speed things up. The main effect is speeding up the
21+
M::B tests themselves.
22+
1923
0.4005 - Thu Apr 25 15:10:14 CEST 2013
2024

2125
[ENHANCEMENTS]

lib/Module/Build.pm

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -362,6 +362,12 @@ C<Config.pm>. You can also supply or override install paths on the
362362
command line by specifying C<install_path> values for the C<binhtml>
363363
and/or C<libhtml> installation targets.
364364
365+
With an optional C<html_links> argument set to a false value, you can
366+
skip the search for other documentation to link to, because that can
367+
waste a lot of time if there aren't any links to generate anyway:
368+
369+
./Build html --html_links 0
370+
365371
=item install
366372
367373
[version 0.01]

lib/Module/Build/Base.pm

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3373,15 +3373,18 @@ sub htmlify_pods {
33733373
: $self->original_prefix('core');
33743374

33753375
my $htmlroot = $self->install_sets('core')->{libhtml};
3376-
my @podpath = ( (map { File::Spec->abs2rel($_ ,$podroot) } grep { -d }
3377-
( $self->install_sets('core', 'lib'), # lib
3378-
$self->install_sets('core', 'bin'), # bin
3379-
$self->install_sets('site', 'lib'), # site/lib
3380-
) ), File::Spec->rel2abs($self->blib) );
3376+
my $podpath;
3377+
unless (defined $self->args('html_links') and !$self->args('html_links')) {
3378+
my @podpath = ( (map { File::Spec->abs2rel($_ ,$podroot) } grep { -d }
3379+
( $self->install_sets('core', 'lib'), # lib
3380+
$self->install_sets('core', 'bin'), # bin
3381+
$self->install_sets('site', 'lib'), # site/lib
3382+
) ), File::Spec->rel2abs($self->blib) );
33813383

3382-
my $podpath = $ENV{PERL_CORE}
3383-
? File::Spec->catdir($podroot, 'lib')
3384-
: join(":", map { tr,:\\,|/,; $_ } @podpath);
3384+
$podpath = $ENV{PERL_CORE}
3385+
? File::Spec->catdir($podroot, 'lib')
3386+
: join(":", map { tr,:\\,|/,; $_ } @podpath);
3387+
}
33853388

33863389
my $blibdir = join('/', File::Spec->splitdir(
33873390
(File::Spec->splitpath(File::Spec->rel2abs($htmldir),1))[1]),''
@@ -3431,7 +3434,7 @@ sub htmlify_pods {
34313434
my $depth = @rootdirs + @dirs;
34323435
my %opts = ( infile => $infile,
34333436
outfile => $tmpfile,
3434-
podpath => $podpath,
3437+
( defined($podpath) ? (podpath => $podpath) : ()),
34353438
podroot => $podroot,
34363439
index => 1,
34373440
depth => $depth,
@@ -3451,7 +3454,7 @@ sub htmlify_pods {
34513454

34523455
my @opts = (
34533456
"--title=$title",
3454-
"--podpath=$podpath",
3457+
( defined($podpath) ? "--podpath=$podpath" : ()),
34553458
"--infile=$infile",
34563459
"--outfile=$tmpfile",
34573460
"--podroot=$podroot",

t/ppm.t

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,7 @@ my $mb = Module::Build->new_from_context(
8383
( installsitehtml1dir => catdir($tmp, 'site', 'html'),
8484
installsitehtml3dir => catdir($tmp, 'site', 'html') ) : () ),
8585
},
86+
html_links => 0,
8687
);
8788

8889

@@ -163,6 +164,7 @@ SKIP: {
163164
installsiteman1dir => catdir($tmp, 'site', 'man', 'man1'),
164165
installsiteman3dir => catdir($tmp, 'site', 'man', 'man3'),
165166
},
167+
html_links => 0,
166168
);
167169

168170
$mb->dispatch('ppmdist');

0 commit comments

Comments
 (0)