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