| 1 | package Dist::Zilla::Plugin::SetEnv; | ||||||||||
| 2 | |||||||||||
| 3 | 1 | our $DATE = '2016-10-08'; # DATE | |||||||||
| 4 | 1 | our $VERSION = '0.001'; # VERSION | |||||||||
| 5 | |||||||||||
| 6 | 1 | ▶ | use 5.010001; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 7 | 1 | ▶ | use strict; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 8 | 1 | ▶ | use warnings; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 9 | |||||||||||
| 10 | 1 | ▶ | use Moose; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 11 | 1 | ▶ | use namespace::autoclean; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 12 | |||||||||||
| 13 | 1 | with ( | |||||||||
| 14 | 'Dist::Zilla::Role::BeforeBuild', | ||||||||||
| 15 | 'Dist::Zilla::Role::BeforeMint', | ||||||||||
| 16 | 'Dist::Zilla::Role::BeforeRelease', | ||||||||||
| 17 | 'Dist::Zilla::Role::ModuleMaker', | ||||||||||
| 18 | 'Dist::Zilla::Role::FileGatherer', | ||||||||||
| 19 | 'Dist::Zilla::Role::EncodingProvider', | ||||||||||
| 20 | 'Dist::Zilla::Role::FilePruner', | ||||||||||
| 21 | 'Dist::Zilla::Role::VersionProvider', | ||||||||||
| 22 | 'Dist::Zilla::Role::FileMunger', | ||||||||||
| 23 | 'Dist::Zilla::Role::PrereqSource', | ||||||||||
| 24 | 'Dist::Zilla::Role::MetaProvider', | ||||||||||
| 25 | 'Dist::Zilla::Role::InstallTool', | ||||||||||
| 26 | 'Dist::Zilla::Role::BeforeArchive', | ||||||||||
| 27 | 'Dist::Zilla::Role::AfterBuild', | ||||||||||
| 28 | 'Dist::Zilla::Role::AfterMint', | ||||||||||
| 29 | 'Dist::Zilla::Role::AfterRelease', | ||||||||||
| 30 | |||||||||||
| 31 | # not relevant for reporting phase | ||||||||||
| 32 | #'Dist::Zilla::Role::BuildRunner', | ||||||||||
| 33 | #'Dist::Zilla::Role::TestRunner', | ||||||||||
| 34 | #'Dist::Zilla::Role::FileFinder', | ||||||||||
| 35 | #'Dist::Zilla::Role::FileFinderUser', | ||||||||||
| 36 | #'Dist::Zilla::Role::ConfigDumper', | ||||||||||
| 37 | #'Dist::Zilla::Role::MintingProfile', | ||||||||||
| 38 | #'Dist::Zilla::Role::MintingProfile::ShareDir', | ||||||||||
| 39 | #'Dist::Zilla::Role::Releaser', | ||||||||||
| 40 | #'Dist::Zilla::Role::ShareDir', | ||||||||||
| 41 | ); | ||||||||||
| 42 | |||||||||||
| 43 | 0 | ▶ | sub before_build { | ||||||||
|
Subroutine
before_build: not called CC=3 SCAR=24.8
Pod
undocumented
| |||||||||||
| 44 | 0 | my ($self) = @_; | |||||||||
| 45 | |||||||||||
| 46 | 0 | $ENV{DZIL} = 1; | |||||||||
| 47 | 0 | $ENV{DZIL_PHASE} = 'before_build'; | |||||||||
| 48 | 0 | $ENV{DZIL_NAME} = $self->zilla->name; | |||||||||
| 49 | |||||||||||
| 50 | 0 | my @callers; | |||||||||
| 51 | { | ||||||||||
| 52 | 0 | my $i = 0; | |||||||||
| 53 | 0 | while (1) { | |||||||||
| 54 | 0 | my @caller = caller($i); | |||||||||
| 55 | 0 | ▶ | last unless @caller; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 56 | 0 | push @callers, \@caller; | |||||||||
| 57 | 0 | $i++; | |||||||||
| 58 | } | ||||||||||
| 59 | } | ||||||||||
| 60 | |||||||||||
| 61 | # a hack | ||||||||||
| 62 | $ENV{DZIL_TESTING} = 1 if grep { | ||||||||||
| 63 | 0 | ▶ | $_->[3] eq 'Dist::Zilla::Dist::Builder::test' } @callers; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 64 | } | ||||||||||
| 65 | |||||||||||
| 66 | 0 | ▶ | sub before_mint { | ||||||||
|
Subroutine
before_mint: not called CC=1 SCAR=6.9
Pod
undocumented
| |||||||||||
| 67 | 0 | my ($self) = @_; | |||||||||
| 68 | |||||||||||
| 69 | 0 | $ENV{DZIL_PHASE} = 'before_mint'; | |||||||||
| 70 | } | ||||||||||
| 71 | |||||||||||
| 72 | 0 | ▶ | sub before_release { | ||||||||
|
Subroutine
before_release: not called CC=1 SCAR=6.9
Pod
undocumented
| |||||||||||
| 73 | 0 | my ($self) = @_; | |||||||||
| 74 | |||||||||||
| 75 | 0 | $ENV{DZIL_PHASE} = 'before_release'; | |||||||||
| 76 | } | ||||||||||
| 77 | |||||||||||
| 78 | 0 | ▶ | sub make_module { | ||||||||
|
Subroutine
make_module: not called CC=1 SCAR=6.9
Pod
undocumented
| |||||||||||
| 79 | 0 | my ($self) = @_; | |||||||||
| 80 | |||||||||||
| 81 | 0 | $ENV{DZIL_PHASE} = 'make_module'; | |||||||||
| 82 | } | ||||||||||
| 83 | |||||||||||
| 84 | 0 | ▶ | sub gather_files { | ||||||||
|
Subroutine
gather_files: not called CC=1 SCAR=6.9
Pod
undocumented
| |||||||||||
| 85 | 0 | my ($self) = @_; | |||||||||
| 86 | |||||||||||
| 87 | 0 | $ENV{DZIL_PHASE} = 'gather_files'; | |||||||||
| 88 | } | ||||||||||
| 89 | |||||||||||
| 90 | 0 | ▶ | sub set_file_encodings { | ||||||||
|
Subroutine
set_file_encodings: not called CC=1 SCAR=6.9
Pod
undocumented
| |||||||||||
| 91 | 0 | my ($self) = @_; | |||||||||
| 92 | |||||||||||
| 93 | 0 | $ENV{DZIL_PHASE} = 'set_file_encodings'; | |||||||||
| 94 | } | ||||||||||
| 95 | |||||||||||
| 96 | 0 | ▶ | sub prune_files { | ||||||||
|
Subroutine
prune_files: not called CC=1 SCAR=6.9
Pod
undocumented
| |||||||||||
| 97 | 0 | my ($self) = @_; | |||||||||
| 98 | |||||||||||
| 99 | 0 | $ENV{DZIL_PHASE} = 'prune_files'; | |||||||||
| 100 | } | ||||||||||
| 101 | |||||||||||
| 102 | 0 | ▶ | sub provide_version { | ||||||||
|
Subroutine
provide_version: not called CC=1 SCAR=6.9
Pod
undocumented
| |||||||||||
| 103 | 0 | my ($self) = @_; | |||||||||
| 104 | |||||||||||
| 105 | 0 | $ENV{DZIL_PHASE} = 'provide_version'; | |||||||||
| 106 | |||||||||||
| 107 | 0 | undef; | |||||||||
| 108 | } | ||||||||||
| 109 | |||||||||||
| 110 | 0 | ▶ | sub munge_files { | ||||||||
|
Subroutine
munge_files: not called CC=1 SCAR=6.9
Pod
undocumented
| |||||||||||
| 111 | 0 | my ($self) = @_; | |||||||||
| 112 | |||||||||||
| 113 | 0 | $ENV{DZIL_PHASE} = 'munge_files'; | |||||||||
| 114 | } | ||||||||||
| 115 | |||||||||||
| 116 | 0 | ▶ | sub register_prereqs { | ||||||||
|
Subroutine
register_prereqs: not called CC=1 SCAR=6.9
Pod
undocumented
| |||||||||||
| 117 | 0 | my ($self) = @_; | |||||||||
| 118 | |||||||||||
| 119 | 0 | $ENV{DZIL_PHASE} = 'register_prereqs'; | |||||||||
| 120 | } | ||||||||||
| 121 | |||||||||||
| 122 | 0 | ▶ | sub metadata { | ||||||||
|
Subroutine
metadata: not called CC=1 SCAR=6.9
Pod
undocumented
| |||||||||||
| 123 | 0 | my ($self) = @_; | |||||||||
| 124 | |||||||||||
| 125 | 0 | $ENV{DZIL_PHASE} = 'provide_meta'; | |||||||||
| 126 | 0 | {}; | |||||||||
| 127 | } | ||||||||||
| 128 | |||||||||||
| 129 | 0 | ▶ | sub setup_installer { | ||||||||
|
Subroutine
setup_installer: not called CC=1 SCAR=6.9
Pod
undocumented
| |||||||||||
| 130 | 0 | my ($self) = @_; | |||||||||
| 131 | |||||||||||
| 132 | 0 | $ENV{DZIL_PHASE} = 'setup_installer'; | |||||||||
| 133 | } | ||||||||||
| 134 | |||||||||||
| 135 | 0 | ▶ | sub before_archive { | ||||||||
|
Subroutine
before_archive: not called CC=1 SCAR=6.9
Pod
undocumented
| |||||||||||
| 136 | 0 | my ($self) = @_; | |||||||||
| 137 | |||||||||||
| 138 | 0 | $ENV{DZIL_PHASE} = 'before_archive'; | |||||||||
| 139 | } | ||||||||||
| 140 | |||||||||||
| 141 | 0 | ▶ | sub after_build { | ||||||||
|
Subroutine
after_build: not called CC=1 SCAR=6.9
Pod
undocumented
| |||||||||||
| 142 | 0 | my ($self) = @_; | |||||||||
| 143 | |||||||||||
| 144 | 0 | $ENV{DZIL_PHASE} = 'after_build'; | |||||||||
| 145 | } | ||||||||||
| 146 | |||||||||||
| 147 | 0 | ▶ | sub after_release { | ||||||||
|
Subroutine
after_release: not called CC=1 SCAR=6.9
Pod
undocumented
| |||||||||||
| 148 | 0 | my ($self) = @_; | |||||||||
| 149 | |||||||||||
| 150 | 0 | $ENV{DZIL_PHASE} = 'after_release'; | |||||||||
| 151 | } | ||||||||||
| 152 | |||||||||||
| 153 | 0 | ▶ | sub after_mint { | ||||||||
|
Subroutine
after_mint: not called CC=1 SCAR=6.9
Pod
undocumented
| |||||||||||
| 154 | 0 | my ($self) = @_; | |||||||||
| 155 | |||||||||||
| 156 | 0 | $ENV{DZIL_PHASE} = 'after_mint'; | |||||||||
| 157 | } | ||||||||||
| 158 | |||||||||||
| 159 | 1 | __PACKAGE__->meta->make_immutable; | |||||||||
| 160 | 1 | 1; | |||||||||
| 161 | # ABSTRACT: Set various environment variables | ||||||||||
| 162 | |||||||||||
| 163 | __END__ | ||||||||||