Commit | Line | Data |
db90f764 |
1 | use strict; |
2 | use warnings; |
4ff140fe |
3 | use inc::Module::Install 0.95; |
2e503ae9 |
4 | use Module::Install::AuthorRequires; |
4a8035cf |
5 | use 5.008001; |
db90f764 |
6 | |
4ff140fe |
7 | check_broken_extratests(); |
0161e7d4 |
8 | check_conflicts(); |
9 | |
db90f764 |
10 | name 'Moose'; |
4a8035cf |
11 | perl_version '5.008001'; |
db90f764 |
12 | all_from 'lib/Moose.pm'; |
13 | license 'perl'; |
14 | |
db90f764 |
15 | requires 'Carp'; |
1001b50a |
16 | requires 'Class::MOP' => '0.98'; |
6a461fc0 |
17 | requires 'Data::OptList' => '0'; |
e8d6f353 |
18 | requires 'List::MoreUtils' => '0.12'; |
6a461fc0 |
19 | requires 'Scalar::Util' => '1.19'; |
091ac4b7 |
20 | requires 'Sub::Exporter' => '0.980'; |
9f2230e9 |
21 | requires 'Sub::Name' => '0'; |
6a461fc0 |
22 | requires 'Task::Weaken' => '0'; |
6c01c148 |
23 | requires 'Try::Tiny' => '0.02'; |
25374f01 |
24 | |
87f55e33 |
25 | test_requires 'Test::More' => '0.88'; |
c0026a42 |
26 | test_requires 'Test::Exception' => '0.27'; |
db90f764 |
27 | |
2e503ae9 |
28 | author_requires 'Test::Inline'; |
29 | author_requires 'File::Find::Rule'; |
30 | author_requires 'Module::Info'; |
d68b5280 |
31 | author_requires 'Test::Spelling'; |
32 | author_requires 'Test::Pod::Coverage'; |
33 | author_requires 'Test::NoTabs'; |
2e503ae9 |
34 | |
4ff140fe |
35 | if ( is_maintainer() ) { |
c3ad9761 |
36 | system( $^X, 'author/extract-inline-tests' ); |
de341d84 |
37 | } |
38 | |
6fb58c0d |
39 | tests_recursive(); |
29772efc |
40 | |
db90f764 |
41 | WriteAll(); |
42 | |
0161e7d4 |
43 | # Use the cpan-smolder-stable script in the Moose svn root to figure |
44 | # out what on CPAN will break with the latest Moose, then update this |
45 | # before a release. |
46 | sub check_conflicts { |
47 | my %conflicts = ( |
a666d43a |
48 | 'Devel::REPL' => '1.003008', |
3e8684a5 |
49 | 'Fey::ORM' => '0.23', |
6428e28b |
50 | 'Catalyst' => '5.80017', |
3e8684a5 |
51 | 'MooseX::Aliases' => '0.07', |
52 | 'MooseX::AttributeHelpers' => '0.22', |
92056b59 |
53 | 'MooseX::Attribute::Prototype' => '0.10', |
3e8684a5 |
54 | 'MooseX::ClassAttribute' => '0.09', |
55 | 'MooseX::MethodAttributes' => '0.18', |
56 | 'MooseX::NonMoose' => '0.05', |
57 | 'MooseX::Params::Validate' => '0.05', |
58 | 'MooseX::Role::Cmd' => '0.06', |
59 | 'MooseX::Role::WithOverloading' => '0.04', |
60 | 'MooseX::Singleton' => '0.19', |
61 | 'MooseX::StrictConstructor' => '0.07', |
62 | 'MooseX::Types' => '0.19', |
63 | 'namespace::autoclean' => '0.08', |
284dc439 |
64 | 'KiokuDB' => '0.41', |
0161e7d4 |
65 | ); |
66 | |
67 | my $found = 0; |
68 | for my $mod ( sort keys %conflicts ) { |
69 | eval "require $mod"; |
70 | next if $@; |
71 | |
72 | my $installed = $mod->VERSION(); |
73 | if ( $installed le $conflicts{$mod} ) { |
74 | |
75 | print <<"EOF"; |
76 | |
77 | *** |
78 | This version of Moose conflicts with the version of |
79 | $mod ($installed) you have installed. |
80 | |
81 | You will need to upgrade $mod after installing |
82 | this version of Moose. |
83 | *** |
84 | |
85 | EOF |
86 | |
87 | $found = 1; |
88 | } |
89 | } |
90 | |
7aaa2004 |
91 | return unless $found; |
92 | |
0161e7d4 |
93 | # More or less copied from Module::Build |
94 | return if $ENV{PERL_MM_USE_DEFAULT}; |
95 | return unless -t STDIN && (-t STDOUT || !(-f STDOUT || -c STDOUT)); |
96 | |
7aaa2004 |
97 | sleep 4; |
0161e7d4 |
98 | } |
4ff140fe |
99 | |
100 | sub is_maintainer { |
101 | return $Module::Install::AUTHOR || $ENV{IS_MAINTAINER}; |
102 | } |
103 | |
104 | sub check_broken_extratests { |
105 | return unless is_maintainer(); |
106 | |
107 | if ( exists $Module::Install::ExtraTests::{VERSION} && Module::Install::ExtraTests->VERSION < 0.007 ) { |
108 | print STDERR <<'EOR'; |
109 | You have a broken version of Module::Install::ExtraTests installed. |
110 | Please upgrade to version 0.007 or newer and re-run Makefile.PL |
111 | EOR |
112 | exit 0; |
113 | } |
114 | } |