Codebase list libmoose-perl / 2434a15
affirm at the end of the build that everything is declared as an authordep that should be See PR#86 -- for now, at least, we need to ensure that runtime prereqs are extractable without performing a full 'dzil build', so travis can get everything set up in advance (because the newly-built Moose is run as part of the build, if we perform the build to get the prereqs we have already lost). Karen Etheridge 9 years ago
2 changed file(s) with 57 addition(s) and 0 deletion(s). Raw diff Collapse all Expand all
392392 [Test::CheckBreaks]
393393 conflicts_module = Moose::Conflicts
394394
395 ; authordep Dist::Zilla::Util::AuthorDeps = 5.021
396 ; authordep CPAN::Meta::Requirements
397 ; authordep Test::Deep
398 [=inc::CheckAuthorDeps]
399
395400 [=inc::CheckDelta]
396401 [=inc::GitUpToDate]
397402
0 use strict;
1 use warnings;
2 package inc::CheckAuthorDeps;
3
4 # our goal is to verify that the declared authordeps already reflect
5 # everything in configure + runtime prerequisites -- otherwise, we won't be
6 # able to bootstrap our built Moose for the purposes of running
7 # author/docGenerator.pl
8
9 use Moose;
10 with 'Dist::Zilla::Role::AfterBuild';
11
12 sub after_build
13 {
14 my $self = shift;
15
16 # get our authordeps
17 require Dist::Zilla::Util::AuthorDeps;
18 Dist::Zilla::Util::AuthorDeps->VERSION(5.021);
19
20 require CPAN::Meta::Requirements;
21 my $authordeps = CPAN::Meta::Requirements->new;
22 $authordeps->add_string_requirement(%$_)
23 foreach @{ Dist::Zilla::Util::AuthorDeps::extract_author_deps('.') };
24
25 # get our prereqs
26 my $prereqs = $self->zilla->prereqs;
27
28 # merge prereqs into authordeps
29 my $merged_prereqs = CPAN::Meta::Requirements->new;
30 $merged_prereqs->add_requirements($authordeps);
31 $merged_prereqs->add_requirements($prereqs->requirements_for('configure', 'requires'));
32 $merged_prereqs->add_requirements($prereqs->requirements_for('runtime', 'requires'));
33
34 # remove some false positives we know we already have fulfilled
35 $merged_prereqs->clear_requirement('ExtUtils::MakeMaker');
36 $merged_prereqs->clear_requirement('Dist::CheckConflicts');
37
38 # the merged set should not be different than the original authordeps.
39 require Test::Deep;
40 my ($ok, $stack) = Test::Deep::cmp_details(
41 $authordeps->as_string_hash,
42 Test::Deep::superhashof($merged_prereqs->as_string_hash),
43 );
44
45 return if $ok;
46
47 $self->log_fatal('authordeps does not have all prereqs found in configure, runtime prereqs: '
48 . Test::Deep::deep_diag($stack));
49 }
50
51 1;