Distar - Additions to ExtUtils::MakeMaker for dist authors
Makefile.PL
:
use ExtUtils::MakeMaker;
(do './maint/Makefile.PL.include' or die $@) unless -f 'META.yml';
WriteMakefile(...);
maint/Makefile.PL.include
:
BEGIN { -e 'Distar' or system qw(git clone https://github.com/p5sagit/Distar.git) }
use lib 'Distar/lib';
use Distar 0.001;
author 'A. U. Thor <author@cpan.org>';
manifest_include t => 'test-helper.pl';
manifest_include corpus => '.txt';
make commmands:
$ perl Makefile.PL
$ make bump # bump version
$ make bump V=2.000000 # bump to specific version
$ make bumpminor # bump minor version component
$ make bumpmajor # bump major version component
$ make nextrelease # add version heading to Changes file
$ make releasetest # build dist and test (with xt/ and RELEASE_TESTING=1)
$ make preflight # check that repo and file state is release ready
$ make release # check releasetest and preflight, commits and tags,
# builds and uploads to CPAN, and pushes commits and
# tag
$ make release FAKE_RELEASE=1
# builds a release INCLUDING committing and tagging,
# but does not upload to cpan or push anything to git
ExtUtils::MakeMaker works well enough as development tool for builting and testing, but using it to release is annoying and error prone. Distar adds just enough to ExtUtils::MakeMaker for it to be a usable dist author tool. This includes extra commands for releasing and safety checks, and automatic generation of some files. It doesn't require any non-core modules and is compatible with old versions of perl.
Set the author to include in generated META files. Can be a single entry, or an arrayref.
Add a pattern to include files in the MANIFEST file, and thus in the generated dist files.
The pattern can be either a regex, or a path suffix. It will be applied to the full path past the directory specified.
The default files that are always included are: .pm
and .pod
files in
lib
, .t
files in t
and xt
, .pm
files in t/lib
and xt/lib
,
Changes
, MANIFEST
, README
, LICENSE
, META.yml
, and .PL
files in
the dist root, and all files in maint
.
-
MANIFEST.SKIP
The
MANIFEST.SKIP
will be automatically generated to exclude any files not explicitly allowed viamanifest_include
or the included defaults. It will be created (or updated) atperl Makefile.PL
time. -
README
The
README
file will be generated at dist generation time, inside the built dist. It will be generated usingpod2text
on the main module.If a
README
file exists in the repo, it will be used directly instead of generating the file.
test will be adjusted to include xt/
tests by default. This will only apply
for authors, not users installing from CPAN.
Releases the dist. Before releasing, checks will be done on the dist using the
preflight
and releasetest
commands.
Releasing will generate a dist tarball and upload it to CPAN using cpan-upload. It will also create a git tag for the release, and push the tag and branch.
If release is run with FAKE_RELEASE=1 set, it will skip uploading to CPAN and pushing to git. A release commit will still be created and tagged locally.
Performs a number of checks on the files and repository, ensuring it is in a sane state to do a release. The checks are:
- All version numbers match
- The
MANIFEST
file is up to date - The branch is correct
- There is no existing tag for the version
- There are no unmerged upstream changes
- There are no outstanding local changes
- There is an appropriate staged Changes heading
- cpan-upload is available
Test the dist preparing for a release. This generates a dist dir and runs the
tests from inside it. This ensures all appropriate files are included inside
the dist. RELEASE_TESTING
will be set in the environment.
Adds an appropriate changelog heading for the release, and prompts to stage the change.
Bumps the version number. This will try to preserve the length and format of the version number. The least significant digit will be incremented. Versions with underscores will preserve the underscore in the same position.
Optionally accepts a V
option to set the version to a specific value.
The version changes will automatically be committed. Unstaged modifications to the files will be left untouched.
The V option will be passed along to the version bumping script. It can accept a space separated list of options, including an explicit version number.
Options:
-
--force
Updates version numbers even if they do not match the current expected version number.
-
--stable
Attempts to convert the updated version to a stable version, removing any underscore.
-
--alpha
Attempts to convert the updated version to an alpha version, adding an underscore in an appropriate place.
Like bump, but increments the minor segment of the version. This will treat numeric versions as x.yyyzzz format, incrementing the yyy segment.
Like bumpminor, but bumping the major segment.
Updates Distar and re-runs perl Makefile.PL
IRC: #web-simple on irc.perl.org
Git repository: git://git.shadowcat.co.uk/p5sagit/Distar
Git browser: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=p5sagit/Distar.git;a=summary
mst - Matt S. Trout (cpan:MSTROUT) mst@shadowcat.co.uk
haarg - Graham Knop (cpan:HAARG) haarg@cpan.org
ether - Karen Etheridge (cpan:ETHER) ether@cpan.org
frew - Arthur Axel "fREW" Schmidt (cpan:FREW) frioux@gmail.com
Mithaldu - Christian Walde (cpan:MITHALDU) walde.christian@googlemail.com
Copyright (c) 2011-2015 the Distar "AUTHOR" and "CONTRIBUTORS" as listed above.
This library is free software and may be distributed under the same terms as perl itself. See http://dev.perl.org/licenses/.