Conflict with MX::Singleton 0.22
[gitmo/Moose.git] / Makefile.PL
1 use strict;
2 use warnings;
3 use inc::Module::Install 0.98;
4 use Module::Install::AuthorRequires;
5 use 5.008003;
6
7 check_broken_extratests();
8 check_conflicts();
9
10 name 'Moose';
11 perl_version '5.008003';
12 all_from 'lib/Moose.pm';
13 license 'perl';
14
15 requires 'Carp';
16 requires 'Class::MOP'                  => '1.02';
17 requires 'Data::OptList'               => '0';
18 requires 'List::MoreUtils'             => '0.12';
19 requires 'Package::DeprecationManager' => '0.04';
20 requires 'Scalar::Util'                => '1.19';
21 requires 'Sub::Exporter'               => '0.980';
22 requires 'Sub::Name'                   => '0';
23 requires 'Task::Weaken'                => '0';
24 requires 'Try::Tiny'                   => '0.02';
25
26 test_requires 'Test::More'      => '0.88';
27 test_requires 'Test::Exception' => '0.27';
28
29 author_requires 'File::Find::Rule';
30 author_requires 'Module::Info';
31 author_requires 'Test::Inline';
32 author_requires 'Test::NoTabs';
33 author_requires 'Test::Output';
34 author_requires 'Test::Pod::Coverage';
35 author_requires 'Test::Spelling';
36
37 if ( is_maintainer() ) {
38     system( $^X, 'author/extract-inline-tests' );
39 }
40
41 tests_recursive();
42
43 repository 'git://git.moose.perl.org/Moose.git';
44 add_metadata(x_authority => 'cpan:STEVAN');
45
46 WriteAll();
47
48 # Use the xt/author/test-my-dependents.t test to figure
49 # out what on CPAN will break with the latest Moose, then update this
50 # before a release.
51 sub check_conflicts {
52     my %conflicts = (
53         'Catalyst'                       => '5.80017',
54         'Devel::REPL'                    => '1.003008',
55         'Fey::ORM'                       => '0.23',
56         'File::ChangeNotify'             => '0.15',
57         'KiokuDB'                        => '0.41',
58         'MooseX::Aliases'                => '0.07',
59         'MooseX::AttributeHelpers'       => '0.22',
60         'MooseX::Attribute::Prototype'   => '0.10',
61         'MooseX::ClassAttribute'         => '0.13',
62         'MooseX::FollowPBP'              => '0.02',
63         'MooseX::LazyRequire'            => '0.05',
64         'MooseX::MethodAttributes'       => '0.22',
65         'MooseX::NonMoose'               => '0.07',
66         'MooseX::Params::Validate'       => '0.05',
67         'MooseX::Role::Cmd'              => '0.06',
68         'MooseX::Role::WithOverloading'  => '0.06',
69         'MooseX::SemiAffordanceAccessor' => '0.05',
70         'MooseX::Singleton'              => '0.22',
71         'MooseX::StrictConstructor'      => '0.08',
72         'MooseX::Types'                  => '0.19',
73         'namespace::autoclean'           => '0.08',
74         'Pod::Elemental'                 => '0.093280',
75     );
76
77     my $found = 0;
78     for my $mod ( sort keys %conflicts ) {
79         eval "require $mod";
80         next if $@;
81
82         my $installed = $mod->VERSION();
83         if ( $installed le $conflicts{$mod} ) {
84
85             print <<"EOF";
86
87 ***
88     This version of Moose conflicts with the version of
89     $mod ($installed) you have installed.
90
91     You will need to upgrade $mod after installing
92     this version of Moose.
93 ***
94
95 EOF
96
97             $found = 1;
98         }
99     }
100
101     return unless $found;
102
103     # More or less copied from Module::Build
104     return if  $ENV{PERL_MM_USE_DEFAULT};
105     return unless -t STDIN && (-t STDOUT || !(-f STDOUT || -c STDOUT));
106
107     sleep 4;
108 }
109
110 sub is_maintainer {
111     return $Module::Install::AUTHOR || $ENV{IS_MAINTAINER};
112 }
113
114 sub check_broken_extratests {
115     return unless is_maintainer();
116
117     if ( exists $Module::Install::ExtraTests::{VERSION} && Module::Install::ExtraTests->VERSION < 0.007 ) {
118         print STDERR <<'EOR';
119 You have a broken version of Module::Install::ExtraTests installed.
120 Please upgrade to version 0.007 or newer and re-run Makefile.PL
121 EOR
122         exit 0;
123     }
124 }