Add a conflict on MX::AH <= 0.21
[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 'Carp';
14 requires 'Class::MOP'       => '0.93';
15 requires 'Data::OptList'    => '0';
16 requires 'List::MoreUtils'  => '0.12';
17 requires 'Scalar::Util'     => '1.19';
18 requires 'Sub::Exporter'    => '0.980';
19 requires 'Sub::Name'        => '0';
20 requires 'Task::Weaken'     => '0';
21 requires 'Try::Tiny'        => '0.02';
22
23 test_requires 'Test::More'      => '0.88';
24 test_requires 'Test::Exception' => '0.27';
25
26 if ( -d '.svn' || -d '.git' || $ENV{IS_MAINTAINER} ) {
27     system( $^X, 'author/extract-inline-tests' );
28 }
29
30 extra_tests();
31 tests_recursive();
32
33 WriteAll();
34
35 # Use the cpan-smolder-stable script in the Moose svn root to figure
36 # out what on CPAN will break with the latest Moose, then update this
37 # before a release.
38 sub check_conflicts {
39     my %conflicts = (
40         'MooseX::AttributeHelpers'  => '0.21',
41         'MooseX::ClassAttribute'    => '0.09',
42         'MooseX::Singleton'         => '0.19',
43         'MooseX::StrictConstructor' => '0.07',
44         'MooseX::Params::Validate'  => '0.05',
45         'Fey::ORM'                  => '0.23',
46         'MooseX::Types'             => '0.19',
47     );
48
49     my $found = 0;
50     for my $mod ( sort keys %conflicts ) {
51         eval "require $mod";
52         next if $@;
53
54         my $installed = $mod->VERSION();
55         if ( $installed le $conflicts{$mod} ) {
56
57             print <<"EOF";
58
59 ***
60     This version of Moose conflicts with the version of
61     $mod ($installed) you have installed.
62
63     You will need to upgrade $mod after installing
64     this version of Moose.
65 ***
66
67 EOF
68
69             $found = 1;
70         }
71     }
72
73     return unless $found;
74
75     # More or less copied from Module::Build
76     return if  $ENV{PERL_MM_USE_DEFAULT};
77     return unless -t STDIN && (-t STDOUT || !(-f STDOUT || -c STDOUT));
78
79     sleep 4;
80 }