Commit | Line | Data |
e8c583d3 |
1 | # for developpers: |
2 | BEGIN{ |
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 |
9 | use strict; |
10 | use warnings; |
37008311 |
11 | use inc::Module::Install 0.99; |
c3398f5b |
12 | |
884bf37f |
13 | # for co-developpers |
ec7a9423 |
14 | use Module::Install::XSUtil 0.24; |
d202164d |
15 | use Module::Install::AuthorTests; |
884bf37f |
16 | |
bd0fe31f |
17 | system($^X, 'tool/generate-mouse-tiny.pl', 'lib/Mouse/Tiny.pm') == 0 |
3f9d4c2b |
18 | or warn "Cannot generate Mouse::Tiny: $!"; |
19 | |
c3398f5b |
20 | name 'Mouse'; |
21 | all_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 |
25 | requires 'Scalar::Util' => 1.14; |
272a1930 |
26 | |
eb88905f |
27 | test_requires 'Test::More' => 0.88; |
179ac6cc |
28 | |
3310ddf2 |
29 | my %suggests = ( |
af1c2a64 |
30 | 'Any::Moose' => 0.10, |
cabc9331 |
31 | 'Data::Util' => 0.55, |
3310ddf2 |
32 | 'MouseX::AttributeHelpers' => 0.06, |
33 | ); |
34 | |
35 | while(my($mod, $least) = each %suggests){ |
36 | if(can_use($mod)){ |
37 | if(!eval { $mod->VERSION($least) }){ |
38 | my $ver = $mod->VERSION; |
39 | warn("\n", |
40 | "WARNING: $mod is installed, but its version ($ver) is too old (< $least).\n", |
41 | " Please update $mod after installation of Mouse.\n", |
42 | "\n" |
43 | ); |
44 | } |
45 | } |
46 | } |
47 | |
ec7a9423 |
48 | # cc_want deals with the '--pp' and '--xs' options |
49 | my $use_xs = ($] >= 5.008_001 && want_xs()); |
0e81c55d |
50 | |
51 | if($use_xs){ |
7b92a82b |
52 | print "Mouse configured with XS.\n", |
98f255c5 |
53 | "NOTE: You can try --pp option to configure Mouse with Pure Perl.\n"; |
bb543d7f |
54 | |
0e81c55d |
55 | cc_warnings(); |
fdee07cc |
56 | use_ppport(3.19); |
0e81c55d |
57 | cc_src_paths('xs-src'); |
0e81c55d |
58 | } |
59 | else{ |
7b92a82b |
60 | print "Mouse configured with Pure Perl.\n"; |
0e81c55d |
61 | } |
62 | |
125dc1a8 |
63 | |
64 | tests 't/*.t t/*/*.t'; |
1e2f2888 |
65 | author_tests 'xt'; |
66 | |
125dc1a8 |
67 | repository 'git://git.moose.perl.org/Mouse.git'; |
68 | |
af1c2a64 |
69 | if ($Module::Install::AUTHOR) { |
70 | require 'lib/Mouse/Spec.pm'; # for the version |
121acb8a |
71 | my $require_version = Mouse::Spec->MooseVersion; |
bf9f3f91 |
72 | |
64f61124 |
73 | if (eval { require Moose; Moose->VERSION($require_version) }) { |
92ff14d0 |
74 | print "You have Moose ", Moose->VERSION, ".\n"; |
f47ebad0 |
75 | if (eval { require Module::Install::AuthorTests }) { |
76 | do 'tool/create-moose-compatibility-tests.pl'; |
77 | # repeat testing |
78 | # see also ExtUtils::MM_Any::test_via_harness() |
79 | my $t_moose = q{$(FULLPERLRUN) -MExtUtils::Command::MM -e} |
80 | .q{ "test_harness($(TEST_VERBOSE), '$(INST_LIB)', '$(INST_ARCHLIB)')"} |
81 | .q{ xt/compatibility/t/*/*.t } . "\n"; |
82 | |
83 | postamble qq{test_dynamic :: test_moose\n\n} |
84 | . qq{test_moose :: pure_all\n} |
85 | . qq{\t} . $t_moose; |
86 | } else { |
87 | print "You don't have a M::I::AuthorTests.\n"; |
88 | } |
314fe304 |
89 | } else { |
92ff14d0 |
90 | print "You don't have Moose $require_version. skipping moose compatibility test\n"; |
314fe304 |
91 | } |
4358792d |
92 | |
93 | if($use_xs){ |
f47ebad0 |
94 | # repeat testing |
95 | # see also ExtUtils::MM_Any::test_via_harness() |
96 | my $t_pp = q{$(FULLPERLRUN) -MExtUtils::Command::MM -e} |
97 | .q{ "do 'tool/force-pp.pl'; test_harness($(TEST_VERBOSE), '$(INST_LIB)', '$(INST_ARCHLIB)')"} |
98 | .q{ $(TEST_FILES)} . "\n"; |
99 | |
100 | postamble qq{test_dynamic :: test_pp\n\n} |
101 | . qq{test_pp :: pure_all\n} |
102 | . qq{\t} . $t_pp; |
4358792d |
103 | } |
314fe304 |
104 | } |
105 | |
af1c2a64 |
106 | clean_files q{ |
107 | lib/Mouse/Tiny.pm $(O_FILES) test-mydeps-*.log |
108 | *.out |
109 | cover_db xs-src/*.gc{v,no,da} |
110 | }; |
1e2f2888 |
111 | |
eb88905f |
112 | WriteAll check_nmake => 0; |