TODO Test for bug in Moose::Exporter
[gitmo/Moose.git] / Makefile.PL
CommitLineData
db90f764 1use strict;
2use warnings;
47b19570 3use inc::Module::Install;
db90f764 4
0161e7d4 5check_conflicts();
6
db90f764 7name 'Moose';
8all_from 'lib/Moose.pm';
9license 'perl';
10
11# Scalar::Util 1.18 doesn't work on Windows
12my $win32 = !! ( $^O eq 'Win32' or $^O eq 'cygwin' );
13
14# prereqs
ecb1297a 15requires 'perl' => '5.008';
db90f764 16requires 'Scalar::Util' => $win32 ? '1.17' : '1.18';
17requires 'Carp';
53da0e2f 18requires 'Class::MOP' => '0.67';
2c9c8797 19requires 'List::MoreUtils';
c373cc5c 20requires 'Sub::Exporter' => '0.972';
25374f01 21
22# only used by oose.pm, not Moose.pm :P
23requires 'Filter::Simple' => '0';
db90f764 24
25# things the tests need
1edfdf1c 26build_requires 'Test::More' => '0.62';
db90f764 27build_requires 'Test::Exception' => '0.21';
28build_requires 'Test::LongString';
29
6fb58c0d 30tests_recursive();
29772efc 31
db90f764 32WriteAll();
33
0161e7d4 34# Use the cpan-smolder-stable script in the Moose svn root to figure
35# out what on CPAN will break with the latest Moose, then update this
36# before a release.
37sub check_conflicts {
38 my %conflicts = (
39 'MooseX::Singleton' => '0.11',
40 'MooseX::Params::Validate' => '0.05',
41 'Fey::ORM' => '0.10',
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
62EOF
63
64 $found = 1;
65 }
66 }
67
7aaa2004 68 return unless $found;
69
0161e7d4 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
7aaa2004 74 sleep 4;
0161e7d4 75}