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