Login
Always put parens on method calls.
[gknop/Perl-Critic.git] / Build.PL
1 #######################################################################
2 #      $URL$
3 #     $Date$
4 #   $Author$
5 # $Revision$
6 ########################################################################
7
8 use 5.006001;
9
10 use strict;
11 use warnings;
12
13 use lib 'inc';
14 use lib 't/tlib';
15
16 use Module::Build;
17
18 use Perl::Critic::BuildUtilities qw<
19     recommended_module_versions
20     test_wrappers_to_generate
21     get_PL_files
22     dump_unlisted_or_optional_module_versions
23     emit_tar_warning_if_necessary
24 >;
25
26 emit_tar_warning_if_necessary();
27
28
29 my $class = Module::Build->subclass( code => <<'END_SUBCLASS' );
30
31     sub ACTION_test {
32         my ($self) = @_;
33
34         $self->depends_on('manifest');
35
36         return $self->SUPER::ACTION_test();
37     }
38
39     sub ACTION_authortest {
40         my ($self) = @_;
41
42         $self->depends_on('build');
43         $self->depends_on('manifest');
44         $self->depends_on('distmeta');
45
46         $self->test_files( qw< t xt/author > );
47         $self->recursive_test_files(1);
48
49         $self->depends_on('test');
50
51         return;
52     }
53
54     sub ACTION_distdir {
55         my ($self) = @_;
56
57         $self->depends_on('authortest');
58
59         return $self->SUPER::ACTION_distdir();
60     }
61
62 END_SUBCLASS
63
64 my $builder = $class->new(
65     module_name     => 'Perl::Critic',
66     dist_author     => 'Jeffrey Thalhammer <thaljef@cpan.org>',
67     dist_abstract   => 'Critique Perl source code for best-practices.',
68     license         => 'perl',
69     dynamic_config  => 1,
70     create_readme   => 1,
71     create_packlist => 1,
72     sign            => 0,
73
74     requires        => {
75         'B::Keywords'               => 1.05,
76         'Carp'                      => 0,
77         'Config::Tiny'              => 2,
78         'English'                   => 0,
79         'Exception::Class'          => 1.23,
80         'Exporter'                  => 0,
81         'File::Basename'            => 0,
82         'File::Find'                => 0,
83         'File::Path'                => 0,
84         'File::Spec'                => 0,
85         'File::Spec::Unix'          => 0,
86         'File::Temp'                => 0,
87         'Getopt::Long'              => 0,
88         'IO::String'                => 0,
89         'List::MoreUtils'           => 0,
90         'List::Util'                => 0,
91         'Module::Pluggable'         => 3.1,
92         'PPI'                       => 1.203,
93         'PPI::Document'             => 1.203,
94         'PPI::Document::File'       => 1.203,
95         'PPI::Node'                 => 1.203,
96         'PPI::Token::Quote::Single' => 1.203,
97         'PPI::Token::Whitespace'    => 1.203,
98         'Pod::PlainText'            => 0,
99         'Pod::Select'               => 0,
100         'Pod::Usage'                => 0,
101         'Readonly'                  => 1.03,
102         'Scalar::Util'              => 0,
103         'String::Format'            => 1.13,
104         'base'                      => 0,
105         'charnames'                 => 0,
106         'overload'                  => 0,
107         'strict'                    => 0,
108         'version'                   => 0,
109         'warnings'                  => 0,
110         'overload'                  => 0,
111         'strict'                    => 0,
112         'version'                   => 0,
113         'warnings'                  => 0,
114     },
115
116     recommends      => { recommended_module_versions() },
117
118     build_requires  => {
119         'lib'                       => 0,
120         'Test::More'                => 0,
121     },
122
123     PL_files        => get_PL_files(),
124
125     script_files    => ['bin/perlcritic'],
126
127     meta_merge      => {
128         resources   => {
129             homepage    => 'http://perlcritic.com',
130             license     => 'http://dev.perl.org/licenses/',
131             Repository  => 'http://guest@perlcritic.tigris.org/svn/perlcritic/trunk/Perl-Critic/',
132             MailingList => 'http://perlcritic.tigris.org/servlets/SummarizeList?listName=users',
133         },
134         no_index    => {
135             file        => [
136                 qw<
137                     TODO.pod
138                     lib/Perl/Critic/PolicySummary.pod.PL
139                 >
140             ],
141             directory   => [
142                 qw<
143                     doc
144                     xt
145                 >
146             ],
147         },
148     },
149
150     add_to_cleanup => [
151         qw<
152             Debian_CPANTS.txt
153             Makefile
154             Makefile.old
155             MANIFEST
156             MANIFEST.bak
157             META.yml
158             pm_to_blib
159             README
160         >,
161         values %{ get_PL_files() },
162         test_wrappers_to_generate(),
163     ],
164 );
165
166 $builder->create_build_script();
167
168 dump_unlisted_or_optional_module_versions();
169
170 ##############################################################################
171 # Local Variables:
172 #   mode: cperl
173 #   cperl-indent-level: 4
174 #   fill-column: 78
175 #   indent-tabs-mode: nil
176 #   c-indentation-style: bsd
177 # End:
178 # ex: set ts=8 sts=4 sw=4 tw=78 ft=perl expandtab shiftround :