Switch to M::I::TestAssemble (xaicron++)
[gitmo/Mouse.git] / Makefile.PL
CommitLineData
e8c583d3 1# for developpers:
2BEGIN{
3 if(grep{ $_ eq '--author' } @ARGV){
01f38ab1 4 print "$^X -S cpanm < author/requires.cpanm\n";
e8c583d3 5 system "$^X -S cpanm < author/requires.cpanm";
6 }
7}
8
08f7a8db 9use strict;
10use warnings;
37008311 11use inc::Module::Install 0.99;
c3398f5b 12
884bf37f 13# for co-developpers
ec7a9423 14use Module::Install::XSUtil 0.24;
d202164d 15use Module::Install::AuthorTests;
00010579 16use Module::Install::TestAssemble;
884bf37f 17
bd0fe31f 18system($^X, 'tool/generate-mouse-tiny.pl', 'lib/Mouse/Tiny.pm') == 0
3f9d4c2b 19 or warn "Cannot generate Mouse::Tiny: $!";
20
c3398f5b 21name 'Mouse';
22all_from 'lib/Mouse.pm';
23
ec53d678 24# Scalar::Util < 1.14 has a bug.
25# > Fixed looks_like_number(undef) to return false for perl >= 5.009002
26requires 'Scalar::Util' => 1.14;
272a1930 27
eb88905f 28test_requires 'Test::More' => 0.88;
da1d264b 29test_requires 'Test::Exception' => 0.29;
01f38ab1 30if ( $ENV{RELEASE_TESTING} || (grep { $_ eq '--author' } @ARGV) ) {
31 test_requires 'Test::Requires' => 0.03;
32}
f1c70cbe 33# test_requires 'Test::Output' => 0.16; # too many dependencies!
34
92ff14d0 35if($] < 5.010) {
36 recommends 'Class::C3';
37}
179ac6cc 38
3310ddf2 39my %suggests = (
cabc9331 40 'Data::Util' => 0.55,
3310ddf2 41 'MouseX::AttributeHelpers' => 0.06,
42);
43
44while(my($mod, $least) = each %suggests){
45 if(can_use($mod)){
46 if(!eval { $mod->VERSION($least) }){
47 my $ver = $mod->VERSION;
48 warn("\n",
49 "WARNING: $mod is installed, but its version ($ver) is too old (< $least).\n",
50 " Please update $mod after installation of Mouse.\n",
51 "\n"
52 );
53 }
54 }
55}
56
a1d1c5cc 57require 'lib/Mouse/Spec.pm'; # for the version
98f255c5 58
5e3cb4c0 59#if(Mouse::Spec->MouseVersion =~ /_/){ # DEVEL RELEASE
60# require Carp::Always; Carp::Always->import();
61# include_deps 'Carp::Always';
62#}
63
ec7a9423 64# cc_want deals with the '--pp' and '--xs' options
65my $use_xs = ($] >= 5.008_001 && want_xs());
0e81c55d 66
67if($use_xs){
7b92a82b 68 print "Mouse configured with XS.\n",
98f255c5 69 "NOTE: You can try --pp option to configure Mouse with Pure Perl.\n";
bb543d7f 70
0e81c55d 71 cc_warnings();
fdee07cc 72 use_ppport(3.19);
0e81c55d 73 cc_src_paths('xs-src');
0e81c55d 74}
75else{
7b92a82b 76 print "Mouse configured with Pure Perl.\n";
0e81c55d 77}
78
125dc1a8 79
80tests 't/*.t t/*/*.t';
1e2f2888 81author_tests 'xt';
82
125dc1a8 83
84repository 'git://git.moose.perl.org/Mouse.git';
85
2462603a 86clean_files 'lib/Mouse/Tiny.pm $(O_FILES) test-mydeps-*.log';
125dc1a8 87
88
00010579 89if ($Module::Install::AUTHOR) {
121acb8a 90 my $require_version = Mouse::Spec->MooseVersion;
bf9f3f91 91
64f61124 92 if (eval { require Moose; Moose->VERSION($require_version) }) {
92ff14d0 93 print "You have Moose ", Moose->VERSION, ".\n";
00010579 94 do 'tool/create-moose-compatibility-tests.pl';
95 test_assemble
96 tests => ['xt/compatibility/t/*/*.t'],
97 target => 'test',
98 alias => 'test_moose',
99 ;
314fe304 100 } else {
92ff14d0 101 print "You don't have Moose $require_version. skipping moose compatibility test\n";
314fe304 102 }
4358792d 103
104 if($use_xs){
00010579 105 test_assemble
106 env => { PERL_ONLY => 1 },
107 target => 'test',
108 alias => 'test_pp',
109 ;
4358792d 110 }
314fe304 111}
112
1e2f2888 113
eb88905f 114WriteAll check_nmake => 0;