dzil bootstrap - There is a solution!
I've been reading Zbigniew Lukasiak's blog post about installing Dist::Zilla plugins and Nigel Metheringham's blog post about his thoughts on Dist::Zilla and I have to completely agree.
Dist::Zilla produces a flexibility like no other with its completely insane everything-is-a-plugin approach. Anyone can write almost any type of plugin that hooks up easily to almost every part of the magic that Dist::Zilla does for you. It really is magnificent.
However, that flexibility comes with an added difficulty. There are a lot of plugins out there and when you want to simply build a dist (`dzil build`), it will load any plugin mentioned in the configuration. Since those are loaded by Moose itself, it means any failure to do that (such as with modules that aren't installed) will result in a big stracktrace. You have to scroll to the top of the trace, see what's missing from the failure-to-load message, install that and try again. Whoops, another one is missing...
How about this then...
Given the file dist.ini:
name = Dist-Zilla-App-Command-Bootstrap author = Sawyer Xlicense = Perl_5 copyright_holder = Sawyer X copyright_year = 2010 [@Basic]
[Space]
[AI]
[AutoPrereq]
[PodWacker]
You can now run this:
$ dzil bootstrap You're missing Dist::Zilla::Plugin::Space You're missing Dist::Zilla::Plugin::AI You're missing Dist::Zilla::Plugin::PodWacker
So it's not done yet, true, but it's already good enough to feed cpan or cpanm:
# s/^You're missing //;
$ dzil bootstrap | cpanm
It might be smarter to integrate it with the install command of dzil but I don't like how the default client is cpan and it takes you a lot of chars to make it use cpanm instead. We'll see.
Good night!
I wrote that as
dzil authordeps
a couple of weeks ago. It's part of the Dist::Zilla release that hit CPAN today.Oh well.
I'll check it out when it comes out and see if there's any way I can add to it - though probably not. :)
Why would you want to add to it? It already does exactly what you want, except for not requiring you to
s/^You're missing //;
before passing its output to cpanm :-)I probably implemented it differently, and by "add to it", I meant "help out with making it better", but then continued to say I probably won't be able to, because I assume it's already done in the best possible way. :)
Also, the lines with "You're missing" is just the output I gave to myself when I finished doing it last night at 2AM. I would have deleted the prefix and cleaned up the code before actually suggesting it to rjbs.