📄 module::build.3
字号:
Creates a \*(L"distribution directory\*(R" named \f(CW\*(C`$dist_name\-$dist_version\*(C'\fR(if that directory already exists, it will be removed first), thencopies all the files listed in the \fI\s-1MANIFEST\s0\fR file to that directory.This directory is what the distribution tarball is created from..IP "distmeta" 4.IX Item "distmeta"[version 0.21].SpCreates the \fI\s-1META\s0.yml\fR file that describes the distribution..Sp\&\fI\s-1META\s0.yml\fR is a file containing various bits of \*(L"metadata\*(R" about thedistribution. The metadata includes the distribution name, version,abstract, prerequisites, license, and various other data about thedistribution. This file is created as \fI\s-1META\s0.yml\fR in \s-1YAML\s0 format.It is recommended that the \f(CW\*(C`YAML\*(C'\fR module be installed to create it.If the \f(CW\*(C`YAML\*(C'\fR module is not installed, an internal module suppliedwith Module::Build will be used to write the \s-1META\s0.yml file, and thiswill most likely be fine..Sp\&\fI\s-1META\s0.yml\fR file must also be listed in \fI\s-1MANIFEST\s0\fR \- if it's not, awarning will be issued..SpThe current version of the \fI\s-1META\s0.yml\fR specification can be found at<http://module\-build.sourceforge.net/META\-spec\-current.html>.IP "distsign" 4.IX Item "distsign"[version 0.16].SpUses \f(CW\*(C`Module::Signature\*(C'\fR to create a \s-1SIGNATURE\s0 file for yourdistribution, and adds the \s-1SIGNATURE\s0 file to the distribution's\&\s-1MANIFEST\s0..IP "disttest" 4.IX Item "disttest"[version 0.05].SpPerforms the 'distdir' action, then switches into that directory andruns a \f(CW\*(C`perl Build.PL\*(C'\fR, followed by the 'build' and 'test' actions inthat directory..IP "docs" 4.IX Item "docs"[version 0.20].SpThis will generate documentation (e.g. Unix man pages and htmldocuments) for any installable items under \fBblib/\fR thatcontain \s-1POD\s0. If there are no \f(CW\*(C`bindoc\*(C'\fR or \f(CW\*(C`libdoc\*(C'\fR installationtargets defined (as will be the case on systems that don't supportUnix manpages) no action is taken for manpages. If there are no\&\f(CW\*(C`binhtml\*(C'\fR or \f(CW\*(C`libhtml\*(C'\fR installation targets defined no action istaken for html documents..IP "fakeinstall" 4.IX Item "fakeinstall"[version 0.02].SpThis is just like the \f(CW\*(C`install\*(C'\fR action, but it won't actually doanything, it will just report what it \fIwould\fR have done if you hadactually run the \f(CW\*(C`install\*(C'\fR action..IP "help" 4.IX Item "help"[version 0.03].SpThis action will simply print out a message that is meant to help youuse the build process. It will show you a list of available buildactions too..SpWith an optional argument specifying an action name (e.g. \f(CW\*(C`Build helptest\*(C'\fR), the 'help' action will show you any \s-1POD\s0 documentation it canfind for that action..IP "html" 4.IX Item "html"[version 0.26].SpThis will generate \s-1HTML\s0 documentation for any binary or library filesunder \fBblib/\fR that contain \s-1POD\s0. The \s-1HTML\s0 documentation will only beinstalled if the install paths can be determined from values in\&\f(CW\*(C`Config.pm\*(C'\fR. You can also supply or override install paths on thecommand line by specifying \f(CW\*(C`install_path\*(C'\fR values for the \f(CW\*(C`binhtml\*(C'\fRand/or \f(CW\*(C`libhtml\*(C'\fR installation targets..IP "install" 4.IX Item "install"[version 0.01].SpThis action will use \f(CW\*(C`ExtUtils::Install\*(C'\fR to install the files from\&\f(CW\*(C`blib/\*(C'\fR into the system. See \*(L"\s-1INSTALL\s0 \s-1PATHS\s0\*(R"for details about how Module::Build determines where to installthings, and how to influence this process..SpIf you want the installation process to look around in \f(CW@INC\fR forother versions of the stuff you're installing and try to delete it,you can use the \f(CW\*(C`uninst\*(C'\fR parameter, which tells \f(CW\*(C`ExtUtils::Install\*(C'\fR todo so:.Sp.Vb 1\& ./Build install uninst=1.Ve.SpThis can be a good idea, as it helps prevent multiple versions of amodule from being present on your system, which can be a confusingsituation indeed..IP "manifest" 4.IX Item "manifest"[version 0.05].SpThis is an action intended for use by module authors, not peopleinstalling modules. It will bring the \fI\s-1MANIFEST\s0\fR up to date with thefiles currently present in the distribution. You may use a\&\fI\s-1MANIFEST\s0.SKIP\fR file to exclude certain files or directories frominclusion in the \fI\s-1MANIFEST\s0\fR. \fI\s-1MANIFEST\s0.SKIP\fR should contain a bunchof regular expressions, one per line. If a file in the distributiondirectory matches any of the regular expressions, it won't be includedin the \fI\s-1MANIFEST\s0\fR..SpThe following is a reasonable \fI\s-1MANIFEST\s0.SKIP\fR starting point, you canadd your own stuff to it:.Sp.Vb 7\& ^_build\& ^Build$\& ^blib\& ~$\& \e.bak$\& ^MANIFEST\e.SKIP$\& CVS.Ve.SpSee the distcheck and skipcheck actions if you want to find outwhat the \f(CW\*(C`manifest\*(C'\fR action would do, without actually doing anything..IP "manpages" 4.IX Item "manpages"[version 0.28].SpThis will generate man pages for any binary or library files under\&\fBblib/\fR that contain \s-1POD\s0. The man pages will only be installed if theinstall paths can be determined from values in \f(CW\*(C`Config.pm\*(C'\fR. You canalso supply or override install paths by specifying there values onthe command line with the \f(CW\*(C`bindoc\*(C'\fR and \f(CW\*(C`libdoc\*(C'\fR installationtargets..IP "pardist" 4.IX Item "pardist"[version 0.2806].SpGenerates a \s-1PAR\s0 binary distribution for use with \s-1PAR\s0 or PAR::Dist..SpIt requires that the PAR::Dist module (version 0.17 and up) isinstalled on your system..IP "ppd" 4.IX Item "ppd"[version 0.20].SpBuild a \s-1PPD\s0 file for your distribution..SpThis action takes an optional argument \f(CW\*(C`codebase\*(C'\fR which is used inthe generated ppd file to specify the (usually relative) \s-1URL\s0 of thedistribution. By default, this value is the distribution name withoutany path information..SpExample:.Sp.Vb 1\& ./Build ppd \-\-codebase "MSWin32\-x86\-multi\-thread/Module\-Build\-0.21.tar.gz".Ve.IP "ppmdist" 4.IX Item "ppmdist"[version 0.23].SpGenerates a \s-1PPM\s0 binary distribution and a \s-1PPD\s0 description file. Thisaction also invokes the 'ppd' action, so it can accept the same\&\f(CW\*(C`codebase\*(C'\fR argument described under that action..SpThis uses the same mechanism as the \f(CW\*(C`dist\*(C'\fR action to tar & zip itsoutput, so you can supply \f(CW\*(C`tar\*(C'\fR and/or \f(CW\*(C`gzip\*(C'\fR parameters to affectthe result..IP "prereq_report" 4.IX Item "prereq_report"[version 0.28].SpThis action prints out a list of all prerequisites, the versions required, andthe versions actually installed. This can be useful for reviewing theconfiguration of your system prior to a build, or when compiling data to sendfor a bug report..IP "pure_install" 4.IX Item "pure_install"[version 0.28].SpThis action is identical to the \f(CW\*(C`install\*(C'\fR action. In the future,though, when \f(CW\*(C`install\*(C'\fR starts writing to the file \&\fI$(\s-1INSTALLARCHLIB\s0)/perllocal.pod\fR, \f(CW\*(C`pure_install\*(C'\fR won't, and thatwill be the only difference between them..IP "realclean" 4.IX Item "realclean"[version 0.01].SpThis action is just like the \f(CW\*(C`clean\*(C'\fR action, but also removes the\&\f(CW\*(C`_build\*(C'\fR directory and the \f(CW\*(C`Build\*(C'\fR script. If you run the\&\f(CW\*(C`realclean\*(C'\fR action, you are essentially starting over, so you willhave to re-create the \f(CW\*(C`Build\*(C'\fR script again..IP "retest" 4.IX Item "retest"[version 0.2806].SpThis is just like the \f(CW\*(C`test\*(C'\fR action, but doesn't actually build thedistribution first, and doesn't add \fIblib/\fR to the load path, andtherefore will test against a \fIpreviously\fR installed version of thedistribution. This can be used to verify that a certain installeddistribution still works, or to see whether newer versions of adistribution still pass the old regression tests, and so on..IP "skipcheck" 4.IX Item "skipcheck"[version 0.05].SpReports which files are skipped due to the entries in the\&\fI\s-1MANIFEST\s0.SKIP\fR file (See manifest for details).IP "test" 4.IX Item "test"[version 0.01].SpThis will use \f(CW\*(C`Test::Harness\*(C'\fR to run any regression tests and reporttheir results. Tests can be defined in the standard places: a filecalled \f(CW\*(C`test.pl\*(C'\fR in the top-level directory, or several files endingwith \f(CW\*(C`.t\*(C'\fR in a \f(CW\*(C`t/\*(C'\fR directory..SpIf you want tests to be 'verbose', i.e. show details of test executionrather than just summary information, pass the argument \f(CW\*(C`verbose=1\*(C'\fR..SpIf you want to run tests under the perl debugger, pass the argument\&\f(CW\*(C`debugger=1\*(C'\fR..SpIn addition, if a file called \f(CW\*(C`visual.pl\*(C'\fR exists in the top-leveldirectory, this file will be executed as a Perl script and its outputwill be shown to the user. This is a good place to put speed tests orother tests that don't use the \f(CW\*(C`Test::Harness\*(C'\fR format for output..SpTo override the choice of tests to run, you may pass a \f(CW\*(C`test_files\*(C'\fRargument whose value is a whitespace-separated list of test scripts torun. This is especially useful in development, when you only want torun a single test to see whether you've squashed a certain bug yet:.Sp.Vb 1\& ./Build test \-\-test_files t/something_failing.t.Ve.SpYou may also pass several \f(CW\*(C`test_files\*(C'\fR arguments separately:.Sp.Vb 1\& ./Build test \-\-test_files t/one.t \-\-test_files t/two.t.Ve.Spor use a \f(CW\*(C`glob()\*(C'\fR\-style pattern:.Sp.Vb 1\& ./Build test \-\-test_files \*(Aqt/01\-*.t\*(Aq.Ve.IP "testall" 4.IX Item "testall"[verion 0.2807].Sp[Note: the 'testall' action and the code snippets below are currentlyin alpha stage, see\&\*(L"/www.nntp.perl.org/group/perl.module.build/2007/03/msg584.html\*(R"\*(L" in \*(R"http: ].SpRuns the \f(CW\*(C`test\*(C'\fR action plus each of the \f(CW\*(C`test$type\*(C'\fR actions defined bythe keys of the \f(CW\*(C`test_types\*(C'\fR parameter..SpCurrently, you need to define the ACTION_test$type method yourself andenumerate them in the test_types parameter..Sp.Vb 12\& my $mb = Module::Build\->subclass(\& code => q(\& sub ACTION_testspecial { shift\->generic_test(type => \*(Aqspecial\*(Aq); }\& sub ACTION_testauthor { shift\->generic_test(type => \*(Aqauthor\*(Aq); }\& )\& )\->new(\& ...\& test_types => {\& special => \*(Aq.st\*(Aq,\& author => \*(Aq.at\*(Aq,\& },\& ....Ve.IP "testcover" 4.IX Item "testcover"[version 0.26].SpRuns the \f(CW\*(C`test\*(C'\fR action using \f(CW\*(C`Devel::Cover\*(C'\fR, generating acode-coverage report showing which parts of the code were actuallyexercised during the tests..SpTo pass options to \f(CW\*(C`Devel::Cover\*(C'\fR, set the \f(CW$DEVEL_COVER_OPTIONS\fRenvironment variable:.Sp.Vb 1\& DEVEL_COVER_OPTIONS=\-ignore,Build ./Build testcover.Ve.IP "testdb" 4.IX Item "testdb"[version 0.05].SpThis is a synonym for the 'test' action with the \f(CW\*(C`debugger=1\*(C'\fRargument..IP "testpod" 4.IX Item "testpod"[version 0.25].SpThis checks all the files described in the \f(CW\*(C`docs\*(C'\fR action and produces \f(CW\*(C`Test::Harness\*(C'\fR\-style output. If you are a module author,this is useful to run before creating a new release..IP "testpodcoverage" 4.IX Item "testpodcoverage"[version 0.28].SpThis checks the pod coverage of the distribution and produces \f(CW\*(C`Test::Harness\*(C'\fR\-style output. If you are a module author,this is useful to run before creating a new release..IP "versioninstall" 4.IX Item "versioninstall"[version 0.16].Sp** Note: since \f(CW\*(C`only.pm\*(C'\fR is so new, and since we just recently addedsupport for it here too, this feature is to be consideredexperimental. **.SpIf you have the \f(CW\*(C`only.pm\*(C'\fR module installed on your system, you canuse this action to install a module into the version-specific librarytrees. This means that you can have several versions of the samemodule installed and \f(CW\*(C`use\*(C'\fR a specific one like this:.Sp.Vb 1\& use only MyModule => 0.55;.Ve.SpTo override the default installation libraries in \f(CW\*(C`only::config\*(C'\fR,specify the \f(CW\*(C`versionlib\*(C'\fR parameter when you run the \f(CW\*(C`Build.PL\*(C'\fR script:.Sp.Vb 1\& perl Build.PL \-\-versionlib /my/version/place/.Ve.SpTo override which version the module is installed as, specify the\&\f(CW\*(C`versionlib\*(C'\fR parameter when you run the \f(CW\*(C`Build.PL\*(C'\fR script:.Sp.Vb 1\& perl Build.PL \-\-version 0.50.Ve.SpSee the \f(CW\*(C`only.pm\*(C'\fR documentation for more information onversion-specific installs..SH "OPTIONS".IX Header "OPTIONS"
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -