line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
1
|
|
|
1
|
|
381310
|
use 5.010001; |
|
1
|
|
|
|
|
18
|
|
2
|
1
|
|
|
1
|
|
6
|
use strict; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
20
|
|
3
|
1
|
|
|
1
|
|
5
|
use warnings; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
49
|
|
4
|
|
|
|
|
|
|
|
5
|
|
|
|
|
|
|
package Mite::MakeMaker; |
6
|
1
|
|
|
1
|
|
441
|
use Mite::Miteception -all; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
19
|
|
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
our $AUTHORITY = 'cpan:TOBYINK'; |
9
|
|
|
|
|
|
|
our $VERSION = '0.012000'; |
10
|
|
|
|
|
|
|
|
11
|
1
|
|
|
1
|
|
9
|
use File::Find; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
76
|
|
12
|
1
|
|
|
1
|
|
21
|
use autodie; |
|
1
|
|
|
|
|
13
|
|
|
1
|
|
|
|
|
13
|
|
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
{ |
15
|
|
|
|
|
|
|
package # hide from indexer |
16
|
|
|
|
|
|
|
MY; |
17
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
sub top_targets { |
19
|
0
|
|
|
0
|
|
|
my $self = shift; |
20
|
|
|
|
|
|
|
|
21
|
0
|
|
|
|
|
|
my $make = $self->SUPER::top_targets; |
22
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
# Hacky way to run the mite target before pm_to_blib. |
24
|
0
|
|
|
|
|
|
$make =~ s{(pure_all \s* ::? .*) (pm_to_blib)}{$1 mite $2}x; |
25
|
|
|
|
|
|
|
|
26
|
0
|
|
|
|
|
|
return $make; |
27
|
|
|
|
|
|
|
} |
28
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
sub postamble { |
30
|
0
|
|
|
0
|
|
|
my $self = shift; |
31
|
|
|
|
|
|
|
|
32
|
0
|
|
0
|
|
|
|
my $mite = $ENV{MITE} || 'mite'; |
33
|
|
|
|
|
|
|
|
34
|
0
|
|
|
|
|
|
return sprintf <<'MAKE', $mite; |
35
|
|
|
|
|
|
|
MITE=%s |
36
|
|
|
|
|
|
|
|
37
|
|
|
|
|
|
|
mite :: |
38
|
|
|
|
|
|
|
- $(MITE) compile --exit-if-no-mite-dir --no-search-mite-dir |
39
|
|
|
|
|
|
|
- $(ABSPERLRUN) -MMite::MakeMaker -e 'Mite::MakeMaker->fix_pm_to_blib(@ARGV);' lib $(INST_LIB) |
40
|
|
|
|
|
|
|
|
41
|
|
|
|
|
|
|
clean :: |
42
|
|
|
|
|
|
|
- $(MITE) clean --exit-if-no-mite-dir --no-search-mite-dir |
43
|
|
|
|
|
|
|
|
44
|
|
|
|
|
|
|
MAKE |
45
|
|
|
|
|
|
|
} |
46
|
|
|
|
|
|
|
} |
47
|
|
|
|
|
|
|
|
48
|
|
|
|
|
|
|
signature_for fix_pm_to_blib => ( |
49
|
|
|
|
|
|
|
pos => [ Path, Path ], |
50
|
|
|
|
|
|
|
); |
51
|
|
|
|
|
|
|
|
52
|
|
|
|
|
|
|
sub fix_pm_to_blib { |
53
|
|
|
|
|
|
|
my ( $self, $from_dir, $to_dir ) = @_; |
54
|
|
|
|
|
|
|
|
55
|
|
|
|
|
|
|
find({ |
56
|
|
|
|
|
|
|
wanted => sub { |
57
|
|
|
|
|
|
|
# Not just the mite files, but also the mite shim. |
58
|
|
|
|
|
|
|
return if -d $_ || !m{\.pm$}; |
59
|
|
|
|
|
|
|
|
60
|
|
|
|
|
|
|
my $src = Path::Tiny::path($File::Find::name); |
61
|
|
|
|
|
|
|
my $dst = change_parent_dir($from_dir, $to_dir, $src); |
62
|
|
|
|
|
|
|
|
63
|
|
|
|
|
|
|
say "Copying $src to $dst"; |
64
|
|
|
|
|
|
|
|
65
|
|
|
|
|
|
|
$dst->parent->mkpath; |
66
|
|
|
|
|
|
|
$src->copy($dst); |
67
|
|
|
|
|
|
|
|
68
|
|
|
|
|
|
|
return; |
69
|
|
|
|
|
|
|
}, |
70
|
|
|
|
|
|
|
no_chdir => 1 |
71
|
|
|
|
|
|
|
}, $from_dir); |
72
|
|
|
|
|
|
|
|
73
|
|
|
|
|
|
|
return; |
74
|
|
|
|
|
|
|
} |
75
|
|
|
|
|
|
|
|
76
|
|
|
|
|
|
|
signature_for change_parent_dir => ( |
77
|
|
|
|
|
|
|
method => false, |
78
|
|
|
|
|
|
|
pos => [ Path, Path, Path ], |
79
|
|
|
|
|
|
|
); |
80
|
|
|
|
|
|
|
|
81
|
|
|
|
|
|
|
sub change_parent_dir { |
82
|
|
|
|
|
|
|
my ( $old_parent, $new_parent, $file ) = @_; |
83
|
|
|
|
|
|
|
|
84
|
|
|
|
|
|
|
return $new_parent->child( $file->relative($old_parent) ); |
85
|
|
|
|
|
|
|
} |
86
|
|
|
|
|
|
|
|
87
|
|
|
|
|
|
|
1; |
88
|
|
|
|
|
|
|
|
89
|
|
|
|
|
|
|
__END__ |
90
|
|
|
|
|
|
|
|
91
|
|
|
|
|
|
|
=head1 NAME |
92
|
|
|
|
|
|
|
|
93
|
|
|
|
|
|
|
Mite::MakeMaker - use in your Makefile.PL when developing with Mite |
94
|
|
|
|
|
|
|
|
95
|
|
|
|
|
|
|
=head1 SYNOPSIS |
96
|
|
|
|
|
|
|
|
97
|
|
|
|
|
|
|
# In Makefile.PL |
98
|
|
|
|
|
|
|
use ExtUtils::MakeMaker; |
99
|
|
|
|
|
|
|
eval { require Mite::MakeMaker; }; |
100
|
|
|
|
|
|
|
|
101
|
|
|
|
|
|
|
WriteMakefile( |
102
|
|
|
|
|
|
|
...as normal... |
103
|
|
|
|
|
|
|
); |
104
|
|
|
|
|
|
|
|
105
|
|
|
|
|
|
|
=head1 DESCRIPTION |
106
|
|
|
|
|
|
|
|
107
|
|
|
|
|
|
|
If your module is being developed with L<ExtUtils::MakeMaker>, this |
108
|
|
|
|
|
|
|
module makes working with L<Mite> more natural. |
109
|
|
|
|
|
|
|
|
110
|
|
|
|
|
|
|
Be sure to C<require> this in an C<eval> block so users can install |
111
|
|
|
|
|
|
|
your module without mite. |
112
|
|
|
|
|
|
|
|
113
|
|
|
|
|
|
|
=head3 C<make> |
114
|
|
|
|
|
|
|
|
115
|
|
|
|
|
|
|
When C<make> is run, mite will compile any changes. |
116
|
|
|
|
|
|
|
|
117
|
|
|
|
|
|
|
=head3 C<make clean> |
118
|
|
|
|
|
|
|
|
119
|
|
|
|
|
|
|
When C<make clean> is run, mite files will be cleaned up as well. |
120
|
|
|
|
|
|
|
|
121
|
|
|
|
|
|
|
=head3 C<make manifest> |
122
|
|
|
|
|
|
|
|
123
|
|
|
|
|
|
|
Be sure to run this after running C<make> and before running C<make |
124
|
|
|
|
|
|
|
dist> so all the mite files are picked up. |
125
|
|
|
|
|
|
|
|
126
|
|
|
|
|
|
|
=head3 F<MANIFEST.SKIP> |
127
|
|
|
|
|
|
|
|
128
|
|
|
|
|
|
|
The F<.mite> directory should not be shipped with your distribution. |
129
|
|
|
|
|
|
|
Add C<^\.mite/> to your F<MANIFEST.SKIP> file. |
130
|
|
|
|
|
|
|
|
131
|
|
|
|
|
|
|
=head1 BUGS |
132
|
|
|
|
|
|
|
|
133
|
|
|
|
|
|
|
Please report any bugs to L<https://github.com/tobyink/p5-mite/issues>. |
134
|
|
|
|
|
|
|
|
135
|
|
|
|
|
|
|
=head1 SEE ALSO |
136
|
|
|
|
|
|
|
|
137
|
|
|
|
|
|
|
L<Mite::ModuleBuild> |
138
|
|
|
|
|
|
|
|
139
|
|
|
|
|
|
|
=head1 AUTHOR |
140
|
|
|
|
|
|
|
|
141
|
|
|
|
|
|
|
Michael G Schwern E<lt>mschwern@cpan.orgE<gt>. |
142
|
|
|
|
|
|
|
|
143
|
|
|
|
|
|
|
Toby Inkster E<lt>tobyink@cpan.orgE<gt>. |
144
|
|
|
|
|
|
|
|
145
|
|
|
|
|
|
|
=head1 COPYRIGHT AND LICENCE |
146
|
|
|
|
|
|
|
|
147
|
|
|
|
|
|
|
This software is copyright (c) 2011-2014 by Michael G Schwern. |
148
|
|
|
|
|
|
|
|
149
|
|
|
|
|
|
|
This software is copyright (c) 2022 by Toby Inkster. |
150
|
|
|
|
|
|
|
|
151
|
|
|
|
|
|
|
This is free software; you can redistribute it and/or modify it under |
152
|
|
|
|
|
|
|
the same terms as the Perl 5 programming language system itself. |
153
|
|
|
|
|
|
|
|
154
|
|
|
|
|
|
|
=head1 DISCLAIMER OF WARRANTIES |
155
|
|
|
|
|
|
|
|
156
|
|
|
|
|
|
|
THIS PACKAGE IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR IMPLIED |
157
|
|
|
|
|
|
|
WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF |
158
|
|
|
|
|
|
|
MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. |
159
|
|
|
|
|
|
|
|
160
|
|
|
|
|
|
|
=cut |