Skip to content
This repository was archived by the owner on Apr 2, 2025. It is now read-only.

Commit 2b33cbf

Browse files
committed
Include ./lib in @inc when running dzil build if the distro starts with Dist-Zilla
I would assume that any dzil bundle or plugin distro wants to use itself during building.
1 parent 4883730 commit 2b33cbf

File tree

2 files changed

+18
-0
lines changed

2 files changed

+18
-0
lines changed

Changes.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
## 0.1.9 2021-01-08
2+
3+
* If the distro name starts with "Dist-Zilla", then the distro's lib dir will
4+
be included in `@INC` (via `dzil -I lib`) when running `dzil build.
5+
6+
17
## 0.1.8 2021-01-08
28

39
* If a distro has a script named `dev-bin/install-xt-tools.sh` we now run this

tools/lib/T/BuildDist.pm

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,17 @@ sub run {
4848
sub _build_dzil {
4949
my $self = shift;
5050

51+
my $content = path('dist.ini')->slurp_utf8;
52+
my ($distro) = $content =~ /name\s*=\s*(\S+)/;
53+
54+
my @i;
55+
56+
# This assumes that any dzil-related module will use itself during dzil
57+
# build.
58+
if ( $distro && $distro =~ /\ADist-Zilla/ ) {
59+
@i = ( '-I', 'lib' );
60+
}
61+
5162
# The working dir might be something like '~/project` and pushd can't
5263
# handle the '~', apparently.
5364
my $dir = $self->_pushd( $self->checkout_dir );
@@ -57,6 +68,7 @@ sub _build_dzil {
5768
$self->_system(
5869
$self->_brewed_perl( $self->tools_perl ),
5970
$self->_perl_local_script( $self->tools_perl, 'dzil' ),
71+
@i,
6072
'build',
6173
);
6274
},

0 commit comments

Comments
 (0)