diff --git a/Changes.md b/Changes.md index 9670daa..bbe648d 100644 --- a/Changes.md +++ b/Changes.md @@ -1,3 +1,9 @@ +## 0.1.9 2021-01-08 + +* If the distro name starts with "Dist-Zilla", then the distro's lib dir will + be included in `@INC` (via `dzil -I lib`) when running `dzil build. + + ## 0.1.8 2021-01-08 * If a distro has a script named `dev-bin/install-xt-tools.sh` we now run this diff --git a/tools/lib/T/BuildDist.pm b/tools/lib/T/BuildDist.pm index 8e8bf1c..3e95bf7 100644 --- a/tools/lib/T/BuildDist.pm +++ b/tools/lib/T/BuildDist.pm @@ -48,6 +48,17 @@ sub run { sub _build_dzil { my $self = shift; + my $content = path('dist.ini')->slurp_utf8; + my ($distro) = $content =~ /name\s*=\s*(\S+)/; + + my @i; + + # This assumes that any dzil-related module will use itself during dzil + # build. + if ( $distro && $distro =~ /\ADist-Zilla/ ) { + @i = ( '-I', 'lib' ); + } + # The working dir might be something like '~/project` and pushd can't # handle the '~', apparently. my $dir = $self->_pushd( $self->checkout_dir ); @@ -57,6 +68,7 @@ sub _build_dzil { $self->_system( $self->_brewed_perl( $self->tools_perl ), $self->_perl_local_script( $self->tools_perl, 'dzil' ), + @i, 'build', ); },