now that i started using dist::zilla, prereqs are not listed in a build script, but in dist zilla configuration file. but the problem is the same: prereqs are listed manually. and doing stuff manually sucks.
i had to do something. so i used dist-zilla's plugin infrastructure and just uploaded dist::zilla::plugin::autoprereq. just add:
in your dist.ini, and it will automatically find your prereqs for dist::zilla to use.[AutoPrereq]
the parsing is somehow very rough: it will just find the lines beginning by use or require. for more advanced / hackish stuff, dist::zilla::plugin::prereq is still available. i still think that it should cover 80+% of the cases. i considered using module::info, but it evals the modules to find the prereqs and the result is damn slow... and speed was more important imo.
note that i plan to add the possibility to add modules manually, in order to add missing modules (or maybe we can use both prereq and autoprereq?), and a skip option to trim modules that should not be added to the list of prereqs.
also, i may change the algorithm used to find prereqs: maybe ppi will be fast enough? we'll see.
but in the meantime, just enjoy not writing anymore those prereqs by hand! :-)
You should look at Module::Depends so that you don't need to do the hard work yourself.
ReplyDeleteYou could use the same mechanism that Module::Install uses.
ReplyDeleteM:I assumes that any use line that specifies a version is intended to be listed in META.yml, and anything that doesn't have one is not.
use strict; (Not dependency)
use Module 1.00; (Is a dependency)
@michael: nope, module::depends is extracting prereqs from meta.yml, and this file is created by dist::zilla - from prereqs extracted by dist::zilla::plugin::autoprereq! :-)
ReplyDelete@alias: the problem being that it would force a big style change to authors. and i want to be as transparent as possible.