line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
# vim: ts=4 sts=4 sw=4 et: syntax=perl |
2
|
|
|
|
|
|
|
# |
3
|
|
|
|
|
|
|
# Copyright (c) 2020-2023 Sven Kirmess |
4
|
|
|
|
|
|
|
# |
5
|
|
|
|
|
|
|
# Permission to use, copy, modify, and distribute this software for any |
6
|
|
|
|
|
|
|
# purpose with or without fee is hereby granted, provided that the above |
7
|
|
|
|
|
|
|
# copyright notice and this permission notice appear in all copies. |
8
|
|
|
|
|
|
|
# |
9
|
|
|
|
|
|
|
# THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES |
10
|
|
|
|
|
|
|
# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF |
11
|
|
|
|
|
|
|
# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR |
12
|
|
|
|
|
|
|
# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES |
13
|
|
|
|
|
|
|
# WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN |
14
|
|
|
|
|
|
|
# ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF |
15
|
|
|
|
|
|
|
# OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. |
16
|
|
|
|
|
|
|
|
17
|
3
|
|
|
3
|
|
3340
|
use 5.006; |
|
3
|
|
|
|
|
14
|
|
18
|
3
|
|
|
3
|
|
19
|
use strict; |
|
3
|
|
|
|
|
6
|
|
|
3
|
|
|
|
|
113
|
|
19
|
3
|
|
|
3
|
|
16
|
use warnings; |
|
3
|
|
|
|
|
14
|
|
|
3
|
|
|
|
|
183
|
|
20
|
|
|
|
|
|
|
|
21
|
|
|
|
|
|
|
package Dist::Zilla::Plugin::Code::BeforeBuild; |
22
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
our $VERSION = '0.008'; |
24
|
|
|
|
|
|
|
|
25
|
3
|
|
|
3
|
|
576
|
use Moose; |
|
3
|
|
|
|
|
444456
|
|
|
3
|
|
|
|
|
25
|
|
26
|
3
|
|
|
3
|
|
20750
|
use namespace::autoclean; |
|
3
|
|
|
|
|
8
|
|
|
3
|
|
|
|
|
24
|
|
27
|
|
|
|
|
|
|
|
28
|
|
|
|
|
|
|
with 'Dist::Zilla::Role::BeforeBuild'; |
29
|
|
|
|
|
|
|
|
30
|
3
|
|
|
3
|
|
872
|
use Config::MVP 2.200012 (); # https://github.com/rjbs/Config-MVP/issues/13 |
|
3
|
|
|
|
|
241
|
|
|
3
|
|
|
|
|
84
|
|
31
|
3
|
|
|
3
|
|
463
|
use MooseX::Types::Moose qw(CodeRef); |
|
3
|
|
|
|
|
55709
|
|
|
3
|
|
|
|
|
24
|
|
32
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
has before_build => ( |
34
|
|
|
|
|
|
|
is => 'ro', |
35
|
|
|
|
|
|
|
isa => 'CodeRef', |
36
|
|
|
|
|
|
|
reader => '_before_build', |
37
|
|
|
|
|
|
|
required => 1, |
38
|
|
|
|
|
|
|
); |
39
|
|
|
|
|
|
|
|
40
|
|
|
|
|
|
|
sub before_build { |
41
|
4
|
|
|
4
|
0
|
137327
|
my $self = shift; |
42
|
|
|
|
|
|
|
|
43
|
4
|
|
|
|
|
180
|
my $code_ref = $self->_before_build; |
44
|
4
|
|
|
|
|
23
|
return $self->$code_ref(@_); |
45
|
|
|
|
|
|
|
} |
46
|
|
|
|
|
|
|
|
47
|
|
|
|
|
|
|
__PACKAGE__->meta->make_immutable; |
48
|
|
|
|
|
|
|
|
49
|
|
|
|
|
|
|
1; |
50
|
|
|
|
|
|
|
|
51
|
|
|
|
|
|
|
__END__ |
52
|
|
|
|
|
|
|
|
53
|
|
|
|
|
|
|
=pod |
54
|
|
|
|
|
|
|
|
55
|
|
|
|
|
|
|
=encoding UTF-8 |
56
|
|
|
|
|
|
|
|
57
|
|
|
|
|
|
|
=head1 NAME |
58
|
|
|
|
|
|
|
|
59
|
|
|
|
|
|
|
Dist::Zilla::Plugin::Code::BeforeBuild - something that runs before building really begins |
60
|
|
|
|
|
|
|
|
61
|
|
|
|
|
|
|
=head1 VERSION |
62
|
|
|
|
|
|
|
|
63
|
|
|
|
|
|
|
Version 0.008 |
64
|
|
|
|
|
|
|
|
65
|
|
|
|
|
|
|
=head1 SYNOPSIS |
66
|
|
|
|
|
|
|
|
67
|
|
|
|
|
|
|
=head2 Dist::Zilla::Role::PluginBundle |
68
|
|
|
|
|
|
|
|
69
|
|
|
|
|
|
|
package Dist::Zilla::PluginBundle::MyBundle; |
70
|
|
|
|
|
|
|
|
71
|
|
|
|
|
|
|
use Moose; |
72
|
|
|
|
|
|
|
with 'Dist::Zilla::Role::PluginBundle'; |
73
|
|
|
|
|
|
|
|
74
|
|
|
|
|
|
|
sub bundle_config { |
75
|
|
|
|
|
|
|
my ( $class, $section ) = @_; |
76
|
|
|
|
|
|
|
|
77
|
|
|
|
|
|
|
my @plugins; |
78
|
|
|
|
|
|
|
push @plugins, [ |
79
|
|
|
|
|
|
|
'SomeUniqueName', |
80
|
|
|
|
|
|
|
'Dist::Zilla::Plugin::Code::BeforeBuild', |
81
|
|
|
|
|
|
|
{ |
82
|
|
|
|
|
|
|
before_build => sub { |
83
|
|
|
|
|
|
|
my ($self) = @_; |
84
|
|
|
|
|
|
|
$self->log('Hello world'); |
85
|
|
|
|
|
|
|
}, |
86
|
|
|
|
|
|
|
}, |
87
|
|
|
|
|
|
|
]; |
88
|
|
|
|
|
|
|
|
89
|
|
|
|
|
|
|
return @plugins; |
90
|
|
|
|
|
|
|
} |
91
|
|
|
|
|
|
|
|
92
|
|
|
|
|
|
|
=head2 Dist::Zilla::Role::PluginBundle::Easy |
93
|
|
|
|
|
|
|
|
94
|
|
|
|
|
|
|
package Dist::Zilla::PluginBundle::MyBundle; |
95
|
|
|
|
|
|
|
|
96
|
|
|
|
|
|
|
use Moose; |
97
|
|
|
|
|
|
|
with 'Dist::Zilla::Role::PluginBundle::Easy'; |
98
|
|
|
|
|
|
|
|
99
|
|
|
|
|
|
|
sub configure { |
100
|
|
|
|
|
|
|
my ( $self ) = @_; |
101
|
|
|
|
|
|
|
|
102
|
|
|
|
|
|
|
$self->add_plugins([ |
103
|
|
|
|
|
|
|
'Code::BeforeBuild', |
104
|
|
|
|
|
|
|
{ |
105
|
|
|
|
|
|
|
before_build => sub { |
106
|
|
|
|
|
|
|
my ($self) = @_; |
107
|
|
|
|
|
|
|
$self->log('Hello world'); |
108
|
|
|
|
|
|
|
}, |
109
|
|
|
|
|
|
|
}, |
110
|
|
|
|
|
|
|
]); |
111
|
|
|
|
|
|
|
|
112
|
|
|
|
|
|
|
return; |
113
|
|
|
|
|
|
|
} |
114
|
|
|
|
|
|
|
|
115
|
|
|
|
|
|
|
=head1 DESCRIPTION |
116
|
|
|
|
|
|
|
|
117
|
|
|
|
|
|
|
This plugin implements the L<Dist::Zilla::Role::BeforeBuild> role. |
118
|
|
|
|
|
|
|
|
119
|
|
|
|
|
|
|
=head1 SUPPORT |
120
|
|
|
|
|
|
|
|
121
|
|
|
|
|
|
|
=head2 Bugs / Feature Requests |
122
|
|
|
|
|
|
|
|
123
|
|
|
|
|
|
|
Please report any bugs or feature requests through the issue tracker |
124
|
|
|
|
|
|
|
at L<https://github.com/skirmess/Dist-Zilla-Plugin-Code/issues>. |
125
|
|
|
|
|
|
|
You will be notified automatically of any progress on your issue. |
126
|
|
|
|
|
|
|
|
127
|
|
|
|
|
|
|
=head2 Source Code |
128
|
|
|
|
|
|
|
|
129
|
|
|
|
|
|
|
This is open source software. The code repository is available for |
130
|
|
|
|
|
|
|
public review and contribution under the terms of the license. |
131
|
|
|
|
|
|
|
|
132
|
|
|
|
|
|
|
L<https://github.com/skirmess/Dist-Zilla-Plugin-Code> |
133
|
|
|
|
|
|
|
|
134
|
|
|
|
|
|
|
git clone https://github.com/skirmess/Dist-Zilla-Plugin-Code.git |
135
|
|
|
|
|
|
|
|
136
|
|
|
|
|
|
|
=head1 AUTHOR |
137
|
|
|
|
|
|
|
|
138
|
|
|
|
|
|
|
Sven Kirmess <sven.kirmess@kzone.ch> |
139
|
|
|
|
|
|
|
|
140
|
|
|
|
|
|
|
=head1 SEE ALSO |
141
|
|
|
|
|
|
|
|
142
|
|
|
|
|
|
|
L<Dist::Zilla>, L<Dist::Zilla::Role::BeforeBuild> |
143
|
|
|
|
|
|
|
|
144
|
|
|
|
|
|
|
=cut |