perltidy
[gitmo/Moose.git] / Makefile.PL
1 use strict;
2 use warnings;
3 use inc::Module::Install;
4 use 5.008001;
5
6 check_conflicts();
7
8 name 'Moose';
9 perl_version '5.008001';
10 all_from 'lib/Moose.pm';
11 license 'perl';
12
13 requires 'Scalar::Util'     => '1.19';
14 requires 'Carp';
15 requires 'Class::MOP'       => '0.81';
16 requires 'List::MoreUtils'  => '0.12';
17 requires 'Sub::Exporter'    => '0.972';
18 requires 'Task::Weaken'     => '0';
19 requires 'Data::OptList'    => '0';
20
21 test_requires 'Test::More'      => '0.77';
22 test_requires 'Test::Exception' => '0.21';
23
24 if ( -d '.svn' || -d '.git' || $ENV{IS_MAINTAINER} ) {
25     system( $^X, 'author/extract-inline-tests' );
26 }
27
28 tests_recursive();
29
30 WriteAll();
31
32 # Use the cpan-smolder-stable script in the Moose svn root to figure
33 # out what on CPAN will break with the latest Moose, then update this
34 # before a release.
35 sub check_conflicts {
36     my %conflicts = (
37         'MooseX::ClassAttribute'    => '0.07',
38         'MooseX::Singleton'         => '0.14',
39         'MooseX::StrictConstructor' => '0.07',
40         'MooseX::Params::Validate'  => '0.05',
41         'Fey::ORM'                  => '0.22',
42     );
43
44     my $found = 0;
45     for my $mod ( sort keys %conflicts ) {
46         eval "require $mod";
47         next if $@;
48
49         my $installed = $mod->VERSION();
50         if ( $installed le $conflicts{$mod} ) {
51
52             print <<"EOF";
53
54 ***
55     This version of Moose conflicts with the version of
56     $mod ($installed) you have installed.
57
58     You will need to upgrade $mod after installing
59     this version of Moose.
60 ***
61
62 EOF
63
64             $found = 1;
65         }
66     }
67
68     return unless $found;
69
70     # More or less copied from Module::Build
71     return if  $ENV{PERL_MM_USE_DEFAULT};
72     return unless -t STDIN && (-t STDOUT || !(-f STDOUT || -c STDOUT));
73
74     sleep 4;
75 }