line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
2
|
|
|
2
|
|
31475
|
use 5.006; # our |
|
2
|
|
|
|
|
7
|
|
2
|
2
|
|
|
2
|
|
12
|
use strict; |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
54
|
|
3
|
2
|
|
|
2
|
|
17
|
use warnings; |
|
2
|
|
|
|
|
7
|
|
|
2
|
|
|
|
|
164
|
|
4
|
|
|
|
|
|
|
|
5
|
|
|
|
|
|
|
package Dist::Zilla::App::Command::regenerate; |
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
our $VERSION = '0.001001'; |
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
# ABSTRACT: Write content into your source tree from your release staging |
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
our $AUTHORITY = 'cpan:KENTNL'; # AUTHORITY |
12
|
|
|
|
|
|
|
|
13
|
2
|
|
|
2
|
|
417
|
use Dist::Zilla::App '-command'; |
|
2
|
|
|
|
|
34536
|
|
|
2
|
|
|
|
|
23
|
|
14
|
2
|
|
|
2
|
|
15479
|
use Carp qw( croak ); |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
150
|
|
15
|
2
|
|
|
2
|
|
1241
|
use namespace::clean; |
|
2
|
|
|
|
|
20780
|
|
|
2
|
|
|
|
|
16
|
|
16
|
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
## no critic (ProhibitAmbiguousNames) |
18
|
0
|
|
|
0
|
1
|
0
|
sub abstract { 'write release staging contents into source tree' } |
19
|
|
|
|
|
|
|
|
20
|
|
|
|
1
|
1
|
|
sub opt_spec { } |
21
|
|
|
|
|
|
|
|
22
|
|
|
|
|
|
|
sub execute { |
23
|
1
|
|
|
1
|
1
|
224
|
my ( $self, ) = @_; |
24
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
# TODO: Maybe add room for additional early steps |
26
|
|
|
|
|
|
|
# in the build cycle? |
27
|
1
|
|
|
|
|
7
|
my ( $target, ) = $self->zilla->ensure_built_in_tmpdir; |
28
|
|
|
|
|
|
|
croak('No -Regenerator plugins to regenerate with') |
29
|
1
|
50
|
|
|
|
37509
|
unless my @regens = @{ $self->zilla->plugins_with('-Regenerator') }; |
|
1
|
|
|
|
|
12
|
|
30
|
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
# TODO: Pass through args? Maybe regenerate specific files? |
32
|
1
|
|
|
|
|
370
|
for my $regen (@regens) { |
33
|
1
|
|
|
|
|
4
|
$regen->regenerate( |
34
|
|
|
|
|
|
|
{ |
35
|
|
|
|
|
|
|
build_root => "$target", |
36
|
|
|
|
|
|
|
root => $self->zilla->root . q{}, |
37
|
|
|
|
|
|
|
}, |
38
|
|
|
|
|
|
|
); |
39
|
|
|
|
|
|
|
} |
40
|
|
|
|
|
|
|
} |
41
|
|
|
|
|
|
|
|
42
|
|
|
|
|
|
|
1; |
43
|
|
|
|
|
|
|
|
44
|
|
|
|
|
|
|
__END__ |
45
|
|
|
|
|
|
|
|
46
|
|
|
|
|
|
|
=pod |
47
|
|
|
|
|
|
|
|
48
|
|
|
|
|
|
|
=encoding UTF-8 |
49
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
=head1 NAME |
51
|
|
|
|
|
|
|
|
52
|
|
|
|
|
|
|
Dist::Zilla::App::Command::regenerate - Write content into your source tree from your release staging |
53
|
|
|
|
|
|
|
|
54
|
|
|
|
|
|
|
=head1 VERSION |
55
|
|
|
|
|
|
|
|
56
|
|
|
|
|
|
|
version 0.001001 |
57
|
|
|
|
|
|
|
|
58
|
|
|
|
|
|
|
=head1 SYNOPSIS |
59
|
|
|
|
|
|
|
|
60
|
|
|
|
|
|
|
# Have approprite dist.ini |
61
|
|
|
|
|
|
|
dzil regenerate # Source tree updated! |
62
|
|
|
|
|
|
|
|
63
|
|
|
|
|
|
|
=head1 DESCRIPTION |
64
|
|
|
|
|
|
|
|
65
|
|
|
|
|
|
|
C<Dist::Zilla::App::Command::regenerate> provides a C<regenerate> command to C<Dist::Zilla> |
66
|
|
|
|
|
|
|
that allows some simple tooling to update your source tree when you choose to. |
67
|
|
|
|
|
|
|
|
68
|
|
|
|
|
|
|
This works by producing a new synthetic target like the C<release> target, which happens |
69
|
|
|
|
|
|
|
after the C<build> stage, but does not produce a release. |
70
|
|
|
|
|
|
|
|
71
|
|
|
|
|
|
|
In conjunction with appropriate C<plugins> performing |
72
|
|
|
|
|
|
|
L<< C<-Regenerator>|Dist::Zilla::Role::Regenerator >>, This means that: |
73
|
|
|
|
|
|
|
|
74
|
|
|
|
|
|
|
=over 4 |
75
|
|
|
|
|
|
|
|
76
|
|
|
|
|
|
|
=item * You won't be frustrated with C<dzil build> constantly tweaking your source tree |
77
|
|
|
|
|
|
|
|
78
|
|
|
|
|
|
|
=item * You won't be forced to ship a release just to update the state of some files that are generated |
79
|
|
|
|
|
|
|
by plugins |
80
|
|
|
|
|
|
|
|
81
|
|
|
|
|
|
|
=item * You won't even have to update your source tree B<ever> if you don't want to. |
82
|
|
|
|
|
|
|
|
83
|
|
|
|
|
|
|
=back |
84
|
|
|
|
|
|
|
|
85
|
|
|
|
|
|
|
When calling C<dzil regenerate>, a full copy of the distribution is built in a temporary directory |
86
|
|
|
|
|
|
|
like it does when you call C<dzil test>. |
87
|
|
|
|
|
|
|
|
88
|
|
|
|
|
|
|
Then after C<dzil regenerate> has written your built distribution out to the temporary directory, |
89
|
|
|
|
|
|
|
any C<plugin>'s that perform the C<-Regenerator> role are called and told where your source tree is, |
90
|
|
|
|
|
|
|
and where the build tree is, and they are expected to do the required work. |
91
|
|
|
|
|
|
|
|
92
|
|
|
|
|
|
|
In effect, C<dzil regenerate> is a lot like: |
93
|
|
|
|
|
|
|
|
94
|
|
|
|
|
|
|
dzil build --not && \ |
95
|
|
|
|
|
|
|
DO_STUFF_WITH .build/latest/ && \ |
96
|
|
|
|
|
|
|
MAYBECOPY .build/latest/stuff ./stuff |
97
|
|
|
|
|
|
|
|
98
|
|
|
|
|
|
|
Where those last 2 lines are done with C<plugins>. |
99
|
|
|
|
|
|
|
|
100
|
|
|
|
|
|
|
=head1 SEE ALSO |
101
|
|
|
|
|
|
|
|
102
|
|
|
|
|
|
|
=over 4 |
103
|
|
|
|
|
|
|
|
104
|
|
|
|
|
|
|
=item * L<< C<dzil update>|Dist::Zilla::App::Command::update >> |
105
|
|
|
|
|
|
|
|
106
|
|
|
|
|
|
|
This command invokes only the C<dzil build> parts of the equation and rely C<dzil build> |
107
|
|
|
|
|
|
|
itself doing your source tree modification. |
108
|
|
|
|
|
|
|
|
109
|
|
|
|
|
|
|
A goal of C<dzil regenerate> is to avoid C<dzil build> doing source tree modification. |
110
|
|
|
|
|
|
|
|
111
|
|
|
|
|
|
|
=back |
112
|
|
|
|
|
|
|
|
113
|
|
|
|
|
|
|
=head1 AUTHOR |
114
|
|
|
|
|
|
|
|
115
|
|
|
|
|
|
|
Kent Fredric <kentnl@cpan.org> |
116
|
|
|
|
|
|
|
|
117
|
|
|
|
|
|
|
=head1 COPYRIGHT AND LICENSE |
118
|
|
|
|
|
|
|
|
119
|
|
|
|
|
|
|
This software is copyright (c) 2017 by Kent Fredric <kentfredric@gmail.com>. |
120
|
|
|
|
|
|
|
|
121
|
|
|
|
|
|
|
This is free software; you can redistribute it and/or modify it under |
122
|
|
|
|
|
|
|
the same terms as the Perl 5 programming language system itself. |
123
|
|
|
|
|
|
|
|
124
|
|
|
|
|
|
|
=cut |