File Coverage

blib/lib/Dist/Zilla/App/Command/aliendeps.pm
Criterion Covered Total %
statement 12 41 29.2
branch 0 14 0.0
condition n/a
subroutine 4 7 57.1
pod 3 3 100.0
total 19 65 29.2


line stmt bran cond sub pod time code
1             package Dist::Zilla::App::Command::aliendeps;
2              
3 1     1   638 use strict;
  1         0  
  1         23  
4 1     1   3 use warnings;
  1         1  
  1         27  
5 1     1   360 use Dist::Zilla::App -command;
  1         28838  
  1         12  
6 1     1   10810 use Ref::Util qw( is_hashref );
  1         483  
  1         339  
7              
8             # ABSTRACT: (DEPRECATED) Print your alien distributions alien prerequisites
9             our $VERSION = '0.03'; # VERSION
10              
11              
12 0     0 1   sub abstract { "print your alien distributions alien prerequisites" }
13              
14 0     0 1   sub opt_spec { [ 'env', 'honor ALIEN_FORCE and ALIEN_INSTALL_TYPE environment variables' ] }
15              
16             sub execute
17             {
18 0     0 1   my ($self, $opt, $arg) = @_;
19              
20 0 0         if($opt->env)
21             {
22 0 0         if(defined $ENV{ALIEN_INSTALL_TYPE})
    0          
23             {
24 0 0         return if $ENV{ALIEN_INSTALL_TYPE} eq 'system';
25             }
26             elsif(defined $ENV{ALIEN_FORCE})
27             {
28 0 0         return if !$ENV{ALIEN_FORCE};
29             }
30             }
31            
32             # Dist::Zilla::Plugin::ModuleBuild
33             # module_build_args
34 0           $self->app->chrome->logger->mute;
35            
36 0           my $zilla = $self->zilla;
37 0           $_->before_build for @{ $zilla->plugins_with(-BeforeBuild) };
  0            
38 0           $_->gather_files for @{ $zilla->plugins_with(-FileGatherer) };
  0            
39 0           $_->set_file_encodings for @{ $zilla->plugins_with(-EncodingProvider) };
  0            
40 0           $_->prune_files for @{ $zilla->plugins_with(-FilePruner) };
  0            
41 0           $_->munge_files for @{ $zilla->plugins_with(-FileMunger) };
  0            
42 0           $_->register_prereqs for @{ $zilla->plugins_with(-PrereqSource) };
  0            
43              
44 0           my($pmb) = grep { $_->isa("Dist::Zilla::Plugin::ModuleBuild") } @{ $zilla->plugins };
  0            
  0            
45            
46 0 0         return unless $pmb;
47            
48 0           my $alien_bin_requires = $pmb->module_build_args->{alien_bin_requires};
49            
50 0 0         return unless is_hashref $alien_bin_requires;
51            
52 0           foreach my $name (sort keys %$alien_bin_requires)
53             {
54 0           print "$name\n";
55             }
56             }
57              
58             1;
59              
60             __END__
61              
62             =pod
63              
64             =encoding UTF-8
65              
66             =head1 NAME
67              
68             Dist::Zilla::App::Command::aliendeps - (DEPRECATED) Print your alien distributions alien prerequisites
69              
70             =head1 VERSION
71              
72             version 0.03
73              
74             =head1 SYNOPSIS
75              
76             % dzil aliendeps | cpanm
77              
78             =head1 DESCRIPTION
79              
80             B<NOTE>: This L<Dist::Zilla> subcommand is deprecated in favor of L<App::af>
81             which can produce useful results with L<alienfile> + L<Alien::Build> with the
82             C<af missing> command.
83              
84             L<Alien::Base> based L<Alien> distributions may have optional dependencies
85             that are required when it is determined that a build from source code is
86             necessary. This command probes your distribution for such optional requirements
87             and lists them.
88              
89             This command of course works with L<Dist::Zilla::Plugin::Alien> (and
90             L<Dist::Zilla::PluginBundle::Alien>), but will also work with any
91             L<Dist::Zilla::Plugin::ModuleBuild> based distribution that emits an
92             C<alien_bin_requires> property.
93              
94             =head1 OPTIONS
95              
96             =over 4
97              
98             =item --env
99              
100             Honor the C<ALIEN_FORCE> and C<ALIEN_INSTALL_TYPE> environment variables used by
101             L<Alien::Base::ModuleBuild> (see L<Alien::Base::ModuleBuild::API>). That is
102             do not list anything unless a source code build will be forced. This may be useful
103             when invoked from a .travis.yml file.
104              
105             =back
106              
107             =head1 AUTHOR
108              
109             Graham Ollis <plicease@cpan.org>
110              
111             =head1 COPYRIGHT AND LICENSE
112              
113             This software is copyright (c) 2016 by Graham Ollis.
114              
115             This is free software; you can redistribute it and/or modify it under
116             the same terms as the Perl 5 programming language system itself.
117              
118             =cut