Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add --with- for build and test #541

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions lib/App/cpanminus/script.pm
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,8 @@ sub new {
pod2man => 1,
installed_dists => 0,
install_types => ['requires'],
with_build => 0,
with_test => 0,
with_develop => 0,
with_configure => 0,
showdeps => 0,
Expand Down Expand Up @@ -215,10 +217,14 @@ sub parse_options {
'configure-timeout=i' => \$self->{configure_timeout},
'build-timeout=i' => \$self->{build_timeout},
'test-timeout=i' => \$self->{test_timeout},
'with-build' => \$self->{with_build},
'without-build' => sub { $self->{with_build} = 0 },
'with-develop' => \$self->{with_develop},
'without-develop' => sub { $self->{with_develop} = 0 },
'with-configure' => \$self->{with_configure},
'without-configure' => sub { $self->{with_configure} = 0 },
'with-test' => \$self->{with_test},
'without-test' => sub { $self->{with_test} = 0 },
'with-feature=s' => sub { $self->{features}{$_[1]} = 1 },
'without-feature=s' => sub { $self->{features}{$_[1]} = 0 },
'with-all-features' => sub { $self->{features}{__all} = 1 },
Expand Down Expand Up @@ -2214,6 +2220,8 @@ sub build_stuff {
$dist->{want_phases} = $self->{notest} && !$root_target
? [qw( build runtime )] : [qw( build test runtime )];

push @{$dist->{want_phases}}, 'build' if $self->{with_build} && $depth == 0;
push @{$dist->{want_phases}}, 'test' if $self->{with_test} && $depth == 0;
push @{$dist->{want_phases}}, 'develop' if $self->{with_develop} && $depth == 0;
push @{$dist->{want_phases}}, 'configure' if $self->{with_configure} && $depth == 0;

Expand Down
9 changes: 9 additions & 0 deletions script/cpanm.PL
Original file line number Diff line number Diff line change
Expand Up @@ -346,6 +346,15 @@ C<cpanfile> when used with C<--installdeps>. Defaults to false.
B<EXPERIMENTAL>: Installs configure phase dependencies in C<cpanfile>
when used with C<--installdeps>. Defaults to false.

=item --with-build

B<EXPERIMENTAL>: Installs build phase dependencies in C<cpanfile>
when used with C<--installdeps>. Defaults to false.

=item --with-test

B<EXPERIMENTAL>: Installs test phase dependencies in C<cpanfile>
when used with C<--installdeps>. Defaults to false.
=item --with-feature, --without-feature, --with-all-features

B<EXPERIMENTAL>: Specifies the feature to enable, if a module supports
Expand Down