From: Karen Etheridge Date: Sun, 19 Oct 2014 06:05:20 +0000 (-0700) Subject: run ExtUtils::MakeMaker::Dist::Zilla::Develop out of inc/, so contributors don't... X-Git-Tag: v0.13~7 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=p5sagit%2FSub-Name.git;a=commitdiff_plain;h=1cd6d141fd7279752746cfd7b3e2ae03bf2fe023 run ExtUtils::MakeMaker::Dist::Zilla::Develop out of inc/, so contributors don't have to install it --- diff --git a/Makefile.PL b/Makefile.PL index 9b5cd9c..29249eb 100644 --- a/Makefile.PL +++ b/Makefile.PL @@ -1,4 +1,5 @@ use strict; use warnings; +use lib 'inc'; use ExtUtils::MakeMaker::Dist::Zilla::Develop; WriteMakefile(NAME => 'Sub::Name'); diff --git a/dist.ini b/dist.ini index 1de7a0c..60d77b6 100644 --- a/dist.ini +++ b/dist.ini @@ -10,6 +10,7 @@ installer = MakeMaker Authority.authority = cpan:FLORA Test::MinimumVersion.max_target_perl = 5.006 Git::GatherDir.exclude_filename = Makefile.PL +Git::GatherDir.exclude_match = ^inc/ [Prereqs / TestSuggests] B::C = 1.48 diff --git a/inc/ExtUtils/MakeMaker/Dist/Zilla/Develop.pm b/inc/ExtUtils/MakeMaker/Dist/Zilla/Develop.pm new file mode 100644 index 0000000..78c7d1c --- /dev/null +++ b/inc/ExtUtils/MakeMaker/Dist/Zilla/Develop.pm @@ -0,0 +1,188 @@ +package ExtUtils::MakeMaker::Dist::Zilla::Develop; +BEGIN { + $ExtUtils::MakeMaker::Dist::Zilla::Develop::AUTHORITY = 'cpan:DOY'; +} +{ + $ExtUtils::MakeMaker::Dist::Zilla::Develop::VERSION = '0.03'; +} +use strict; +use warnings; +# ABSTRACT: create bare-bones Makefile.PL files for use with dzil + +use ExtUtils::MakeMaker (); + +sub import { + warn <<'EOF'; + + ********************************* WARNING ********************************** + + This module uses Dist::Zilla for development. This Makefile.PL will let you + run the tests, but you are encouraged to install Dist::Zilla and the needed + plugins if you intend on doing any serious hacking. + + **************************************************************************** + +EOF + + ExtUtils::MakeMaker->export_to_level(1, @_); +} + +{ + package # hide from PAUSE + MY; + + my $message; + BEGIN { + $message = <<'MESSAGE'; + + ********************************* ERROR ************************************ + + This module uses Dist::Zilla for development. This Makefile.PL will let you + run the tests, but should not be used for installation or building dists. + Building a dist should be done with 'dzil build', installation should be + done with 'dzil install', and releasing should be done with 'dzil release'. + + **************************************************************************** + +MESSAGE + $message =~ s/^(.*)$/\t\$(NOECHO) echo "$1";/mg; + } + + sub install { + return < 'Foo::Bar'); + +=head1 DESCRIPTION + +L makes developing modules much easier by generating all kinds of +boilerplate files, saving authors from having to write them by hand, but in +some cases this can make developing more inconvenient. The most prominent +example of this is with C files - although the majority of +distributions can be hacked on just by editing the files in a source control +checkout and using C for testing, for some this isn't sufficient. In +particular, distributions which use an auto-generated test suite and +distributions which use XS both need special handling at build time before they +will function, and with Dist::Zilla, this means running C and +rebuilding after every change. This is tedious! + +This module provides an alternative. Create a minimal C in source +control which handles just enough functionality for basic development (it can +be as minimal as just what is in the L, but can also contain +commands to generate your test suite, for example), and tell Dist::Zilla to +replace it with a real C when you're actually ready to build a +real distribution. To do this, make sure you're still using the +L plugin, either directly or through +a pluginbundle like L<@Basic|Dist::Zilla::PluginBundle::Basic>, and add the +C option to your F where you use +C<[GatherDir]>. + +In addition, this module also intercepts the C and C rules in +the generated Makefile to run the appropriate Dist::Zilla commands +(C and C). This allows users to continue to use the +C set of commands, and have the +correct thing continue to happen. + +Note that if you're using this module to ease testing of an XS distribution, +you'll need to account for your module not containing a C<$VERSION> statement +(assuming you're using the L +plugin). To do this, you should use an XSLoader invocation similar to this: + + BEGIN { + XSLoader::load( + 'Foo::Bar', + $Foo::Bar::{VERSION} ? ${ $Foo::Bar::{VERSION} } : () + ); + } + +This ensures that the C<$Foo::Bar::VERSION> glob isn't created if it didn't +exist initially, since this can confuse XSLoader. + +=head1 BUGS + +No known bugs. + +Please report any bugs to GitHub Issues at +L. + +=head1 SEE ALSO + +L + +L + +=head1 SUPPORT + +You can find this documentation for this module with the perldoc command. + + perldoc ExtUtils::MakeMaker::Dist::Zilla::Develop + +You can also look for information at: + +=over 4 + +=item * MetaCPAN + +L + +=item * Github + +L + +=item * RT: CPAN's request tracker + +L + +=item * CPAN Ratings + +L + +=back + +=head1 AUTHOR + +Jesse Luehrs + +=head1 COPYRIGHT AND LICENSE + +This software is copyright (c) 2014 by Jesse Luehrs. + +This is free software; you can redistribute it and/or modify it under +the same terms as the Perl 5 programming language system itself. + +=cut