update BestPractices to emphasize namespace::autoclean. add link to
[gitmo/Moose.git] / Makefile.PL
CommitLineData
db90f764 1use strict;
2use warnings;
47b19570 3use inc::Module::Install;
4a8035cf 4use 5.008001;
db90f764 5
0161e7d4 6check_conflicts();
7
db90f764 8name 'Moose';
4a8035cf 9perl_version '5.008001';
db90f764 10all_from 'lib/Moose.pm';
11license 'perl';
12
db90f764 13requires 'Carp';
28036bc4 14requires 'Class::MOP' => '0.94';
6a461fc0 15requires 'Data::OptList' => '0';
e8d6f353 16requires 'List::MoreUtils' => '0.12';
6a461fc0 17requires 'Scalar::Util' => '1.19';
091ac4b7 18requires 'Sub::Exporter' => '0.980';
9f2230e9 19requires 'Sub::Name' => '0';
6a461fc0 20requires 'Task::Weaken' => '0';
6c01c148 21requires 'Try::Tiny' => '0.02';
25374f01 22
87f55e33 23test_requires 'Test::More' => '0.88';
c0026a42 24test_requires 'Test::Exception' => '0.27';
db90f764 25
de341d84 26if ( -d '.svn' || -d '.git' || $ENV{IS_MAINTAINER} ) {
c3ad9761 27 system( $^X, 'author/extract-inline-tests' );
de341d84 28}
29
c93fa627 30extra_tests();
6fb58c0d 31tests_recursive();
29772efc 32
db90f764 33WriteAll();
34
0161e7d4 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.
38sub check_conflicts {
39 my %conflicts = (
dd8b5451 40 'Fey::ORM' => '0.23',
c5d71e53 41 'MooseX::AttributeHelpers' => '0.21',
e7e33216 42 'MooseX::ClassAttribute' => '0.09',
dd8b5451 43 'MooseX::MethodAttributes' => '0.15',
fb1eea22 44 'MooseX::NonMoose' => '0.05',
dd8b5451 45 'MooseX::Params::Validate' => '0.05',
60dcd0cf 46 'MooseX::Singleton' => '0.19',
22161b6c 47 'MooseX::StrictConstructor' => '0.07',
82e3badf 48 'MooseX::Types' => '0.19',
dd8b5451 49 'namespace::autoclean' => '0.08',
0161e7d4 50 );
51
52 my $found = 0;
53 for my $mod ( sort keys %conflicts ) {
54 eval "require $mod";
55 next if $@;
56
57 my $installed = $mod->VERSION();
58 if ( $installed le $conflicts{$mod} ) {
59
60 print <<"EOF";
61
62***
63 This version of Moose conflicts with the version of
64 $mod ($installed) you have installed.
65
66 You will need to upgrade $mod after installing
67 this version of Moose.
68***
69
70EOF
71
72 $found = 1;
73 }
74 }
75
7aaa2004 76 return unless $found;
77
0161e7d4 78 # More or less copied from Module::Build
79 return if $ENV{PERL_MM_USE_DEFAULT};
80 return unless -t STDIN && (-t STDOUT || !(-f STDOUT || -c STDOUT));
81
7aaa2004 82 sleep 4;
0161e7d4 83}