line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Dist::Zilla::Plugin::ACPS::Legacy; |
2
|
|
|
|
|
|
|
|
3
|
1
|
|
|
1
|
|
1803
|
use Moose; |
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
4
|
|
|
|
|
|
|
use v5.10; |
5
|
|
|
|
|
|
|
use autodie; |
6
|
|
|
|
|
|
|
use JSON qw( from_json ); |
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
# ABSTRACT: Dist::Zilla plugin for ACPS CIs that are pre-Dist::Zilla |
9
|
|
|
|
|
|
|
our $VERSION = '0.30'; # VERSION |
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
with qw( |
12
|
|
|
|
|
|
|
Dist::Zilla::Role::VersionProvider |
13
|
|
|
|
|
|
|
Dist::Zilla::Role::BuildPL |
14
|
|
|
|
|
|
|
Dist::Zilla::Role::PrereqSource |
15
|
|
|
|
|
|
|
); |
16
|
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
use namespace::autoclean; |
18
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
sub provide_version |
20
|
|
|
|
|
|
|
{ |
21
|
|
|
|
|
|
|
my($self) = @_; |
22
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
my $version; |
24
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
foreach my $line (split /\n/, $self->zilla->main_module->content) |
26
|
|
|
|
|
|
|
{ |
27
|
|
|
|
|
|
|
$version = $1 if $line =~ /\$VERSION\s+=\s+["']?(.*?)["']?;/; |
28
|
|
|
|
|
|
|
} |
29
|
|
|
|
|
|
|
|
30
|
|
|
|
|
|
|
return $version; |
31
|
|
|
|
|
|
|
} |
32
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
sub setup_installer |
34
|
|
|
|
|
|
|
{ |
35
|
|
|
|
|
|
|
# Build.PL is gathered from a static file. |
36
|
|
|
|
|
|
|
} |
37
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
sub register_prereqs |
39
|
|
|
|
|
|
|
{ |
40
|
|
|
|
|
|
|
my $self = shift; |
41
|
|
|
|
|
|
|
|
42
|
|
|
|
|
|
|
my $meta = eval { from_json($self->zilla->root->file('META.json')->slurp) }; |
43
|
|
|
|
|
|
|
die "unable to load META.json, run ./Build distmeta to generate it: $@" if $@ or !defined $meta; |
44
|
|
|
|
|
|
|
|
45
|
|
|
|
|
|
|
foreach my $phase (qw( configure build runtime )) |
46
|
|
|
|
|
|
|
{ |
47
|
|
|
|
|
|
|
if(exists $meta->{prereqs}->{$phase}) |
48
|
|
|
|
|
|
|
{ |
49
|
|
|
|
|
|
|
$self->zilla->log("using $phase prereqs from META.json"); |
50
|
|
|
|
|
|
|
$self->zilla->register_prereqs({ phase => $phase }, %{ $meta->{prereqs}->{$phase}->{requires} }); |
51
|
|
|
|
|
|
|
} |
52
|
|
|
|
|
|
|
else |
53
|
|
|
|
|
|
|
{ |
54
|
|
|
|
|
|
|
$self->zilla->log("WARNING: can't find $phase prereqs from META.json"); |
55
|
|
|
|
|
|
|
} |
56
|
|
|
|
|
|
|
} |
57
|
|
|
|
|
|
|
} |
58
|
|
|
|
|
|
|
|
59
|
|
|
|
|
|
|
__PACKAGE__->meta->make_immutable; |
60
|
|
|
|
|
|
|
|
61
|
|
|
|
|
|
|
1; |
62
|
|
|
|
|
|
|
|
63
|
|
|
|
|
|
|
|
64
|
|
|
|
|
|
|
|
65
|
|
|
|
|
|
|
=pod |
66
|
|
|
|
|
|
|
|
67
|
|
|
|
|
|
|
=head1 NAME |
68
|
|
|
|
|
|
|
|
69
|
|
|
|
|
|
|
Dist::Zilla::Plugin::ACPS::Legacy - Dist::Zilla plugin for ACPS CIs that are pre-Dist::Zilla |
70
|
|
|
|
|
|
|
|
71
|
|
|
|
|
|
|
=head1 VERSION |
72
|
|
|
|
|
|
|
|
73
|
|
|
|
|
|
|
version 0.30 |
74
|
|
|
|
|
|
|
|
75
|
|
|
|
|
|
|
=head1 DESCRIPTION |
76
|
|
|
|
|
|
|
|
77
|
|
|
|
|
|
|
Don't use this direectly, instead use L<@ACPS::Legacy|Dist::Zilla::PluginBundle::ACPS::Legacy>. |
78
|
|
|
|
|
|
|
This plugin does this: |
79
|
|
|
|
|
|
|
|
80
|
|
|
|
|
|
|
=over 4 |
81
|
|
|
|
|
|
|
|
82
|
|
|
|
|
|
|
=item * |
83
|
|
|
|
|
|
|
|
84
|
|
|
|
|
|
|
Determines the version from MainModule::VERSION instead of getting it from the dist.ini. |
85
|
|
|
|
|
|
|
|
86
|
|
|
|
|
|
|
=back |
87
|
|
|
|
|
|
|
|
88
|
|
|
|
|
|
|
=head1 AUTHOR |
89
|
|
|
|
|
|
|
|
90
|
|
|
|
|
|
|
Graham Ollis <gollis@sesda3.com> |
91
|
|
|
|
|
|
|
|
92
|
|
|
|
|
|
|
=head1 COPYRIGHT AND LICENSE |
93
|
|
|
|
|
|
|
|
94
|
|
|
|
|
|
|
This software is copyright (c) 2012 by NASA GSFC. |
95
|
|
|
|
|
|
|
|
96
|
|
|
|
|
|
|
This is free software; you can redistribute it and/or modify it under |
97
|
|
|
|
|
|
|
the same terms as the Perl 5 programming language system itself. |
98
|
|
|
|
|
|
|
|
99
|
|
|
|
|
|
|
=cut |
100
|
|
|
|
|
|
|
|
101
|
|
|
|
|
|
|
|
102
|
|
|
|
|
|
|
__END__ |
103
|
|
|
|
|
|
|
|