.\" Automatically generated by Pod::Man 4.14 (Pod::Simple 3.42) .\" .\" Standard preamble: .\" ======================================================================== .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" Set up some character translations and predefined strings. \*(-- will .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left .\" double quote, and \*(R" will give a right double quote. \*(C+ will .\" give a nicer C++. Capital omega is used to do unbreakable dashes and .\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff, .\" nothing in troff, for use with C<>. .tr \(*W- .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' .ie n \{\ . ds -- \(*W- . ds PI pi . if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch . if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch . ds L" "" . ds R" "" . ds C` "" . ds C' "" 'br\} .el\{\ . ds -- \|\(em\| . ds PI \(*p . ds L" `` . ds R" '' . ds C` . ds C' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" .\" If the F register is >0, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .\" .\" Avoid warning from groff about undefined register 'F'. .de IX .. .nr rF 0 .if \n(.g .if rF .nr rF 1 .if (\n(rF:(\n(.g==0)) \{\ . if \nF \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . if !\nF==2 \{\ . nr % 0 . nr F 2 . \} . \} .\} .rr rF .\" ======================================================================== .\" .IX Title "Dist::Zilla::Role::Bootstrap 3pm" .TH Dist::Zilla::Role::Bootstrap 3pm "2022-06-13" "perl v5.34.0" "User Contributed Perl Documentation" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .SH "NAME" Dist::Zilla::Role::Bootstrap \- Shared logic for bootstrap things. .SH "VERSION" .IX Header "VERSION" version 1.001004 .SH "SYNOPSIS" .IX Header "SYNOPSIS" For consuming plugins: .PP .Vb 2 \& use Moose; \& with \*(AqDist::Zilla::Role::Bootstrap\*(Aq; \& \& sub bootstrap { \& my $bootstrap_root = $_[0]\->_bootstrap_root; \& # Do the actual bootstrap work here \& $_[0]\->_add_inc(\*(Aq./some/path/here\*(Aq); \& } .Ve .PP For users of plugins: .PP .Vb 3 \& [Some::Plugin::Name] \& try_built = 0 ; # use / as the root to bootstrap \& try_built = 1 ; # try to use /Dist\-Name\-.*/ instead of / \& \& fallback = 0 ; # don\*(Aqt bootstrap at all if /Dist\-Name\-.*/ matches != 1 things \& fallback = 1 ; # fallback to / if /Dist\-Name\-.*/ matches != 1 things .Ve .SH "DESCRIPTION" .IX Header "DESCRIPTION" This module is a role that aims to be consumed by plugins that want to perform some very early bootstrap operation that may affect the loading environment of successive plugins, especially with regards to plugins that may wish to build with themselves, either by consuming the source tree itself, or by consuming a previous built iteration. .PP Implementation is quite simple: .ie n .IP "1. ""with"" this role in your plugin" 4 .el .IP "1. \f(CWwith\fR this role in your plugin" 4 .IX Item "1. with this role in your plugin" .Vb 1 \& with \*(AqDist::Zilla::Role::Bootstrap\*(Aq .Ve .ie n .IP "2. Implement the ""bootstrap"" sub." 4 .el .IP "2. Implement the \f(CWbootstrap\fR sub." 4 .IX Item "2. Implement the bootstrap sub." .Vb 3 \& sub bootstrap { \& my ( $self ) = @_; \& } .Ve .ie n .IP "3. \fIOptional\fR: Fetch the discovered ""bootstrap"" root via:" 4 .el .IP "3. \fIOptional\fR: Fetch the discovered \f(CWbootstrap\fR root via:" 4 .IX Item "3. Optional: Fetch the discovered bootstrap root via:" .Vb 1 \& $self\->_bootstrap_root .Ve .ie n .IP "4. \fIOptional\fR: Load some path into @INC via:" 4 .el .IP "4. \fIOptional\fR: Load some path into \f(CW@INC\fR via:" 4 .IX Item "4. Optional: Load some path into @INC via:" .Vb 1 \& $self\->_add_inc($path) .Ve .SH "REQUIRED METHODS" .IX Header "REQUIRED METHODS" .ie n .SS """bootstrap""" .el .SS "\f(CWbootstrap\fP" .IX Subsection "bootstrap" Any user specified \f(CW\*(C`bootstrap\*(C'\fR method will be invoked during \f(CW\*(C`plugin_from_config\*(C'\fR. .PP This is \fB\s-1AFTER\s0\fR \f(CW\*(C`\->new\*(C'\fR, \fB\s-1AFTER\s0\fR \f(CW\*(C`\->BUILD\*(C'\fR, and \fB\s-1AFTER\s0\fR \f(CW\*(C`dzil\*(C'\fR's internal \f(CW\*(C`plugin_from_config\*(C'\fR steps. .PP This occurs within the \f(CW\*(C`register_component\*(C'\fR phase of the plug-in loading and configuration. .PP This also occurs \fB\s-1BEFORE\s0\fR \f(CW\*(C`Dist::Zilla\*(C'\fR attaches the plug-in into the plug-in stash. .SH "ATTRIBUTES" .IX Header "ATTRIBUTES" .ie n .SS """distname""" .el .SS "\f(CWdistname\fP" .IX Subsection "distname" The name of the distribution. .PP This value is vivified by asking \f(CW\*(C`zilla\->name\*(C'\fR. .PP Usually this value is populated by \f(CW\*(C`dist.ini\*(C'\fR in the property \f(CW\*(C`name\*(C'\fR .PP However, occasionally, this value is discovered by a \f(CW\*(C`plugin\*(C'\fR. .PP In such a case, that plugin cannot be bootstrapped, because that plugin \fB\s-1MUST\s0\fR be loaded prior to bootstrap. .ie n .SS """try_built""" .el .SS "\f(CWtry_built\fP" .IX Subsection "try_built" This attribute controls how the consuming \f(CW\*(C`plugin\*(C'\fR behaves. .IP "\(bu" 4 false \fB(default)\fR : bootstrapping is only done to \f(CW\*(C`PROJECTROOT/lib\*(C'\fR .IP "\(bu" 4 true : bootstrap attempts to try \f(CW\*(C`PROJECTROOT/\-/lib\*(C'\fR .ie n .SS """fallback""" .el .SS "\f(CWfallback\fP" .IX Subsection "fallback" This attribute is for use in conjunction with \f(CW\*(C`try_built\*(C'\fR .IP "\(bu" 4 \&\f(CW\*(C`false\*(C'\fR : When \f(CW\*(C`PROJECTROOT/\-\*(C'\fR does not exist, don't perform any bootstrapping .IP "\(bu" 4 \&\f(CW\*(C`true\*(C'\fR \fB(default)\fR : When \f(CW\*(C`PROJECTROOT/\-\*(C'\fR does not exist, bootstrap to \f(CW\*(C`PROJECTROOT/lib\*(C'\fR .ie n .SS """try_built_method""" .el .SS "\f(CWtry_built_method\fP" .IX Subsection "try_built_method" This attribute controls how \f(CW\*(C`try_built\*(C'\fR behaves when multiple directories exist that match \f(CW\*(C`PROJECTROOT/\-.*\*(C'\fR .PP Two valid options at this time: .IP "\(bu" 4 \&\f(CW\*(C`mtime\*(C'\fR \fB(default)\fR : Pick the directory with the most recent \f(CW\*(C`mtime\*(C'\fR .IP "\(bu" 4 \&\f(CW\*(C`parseversion\*(C'\fR : Attempt to parse versions on all candidate directories and use the one with the largest version. .PP Prior to \f(CW0.2.0\fR this property did not exist, and default behavior was to assume \f(CW\*(C`0 Candidates\*(C'\fR and \f(CW\*(C`2 or more Candidates\*(C'\fR were the same problem. .SH "AUTHOR" .IX Header "AUTHOR" Kent Fredric .SH "COPYRIGHT AND LICENSE" .IX Header "COPYRIGHT AND LICENSE" This software is copyright (c) 2017 by Kent Fredric . .PP This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.