Re: Ending Build.PL if there are missing modules
Adam Kennedy <[email protected]> Sun, 5 Feb 2012 13:43:32 +1100
| Newsgroups | gmane.comp.lang.perl.modules.module-build |
|---|---|
| Message-ID | <CAAVyNAxxvFsS9CV+h+oLiKXbrbfyHNXE5ctn2E8ULDJ2_H_Snw@mail.gmail.com> |
If the goal is only to pick up versioned dependencies, I'm surprised we even need to bother with that. For M:I I've been thinking of just scanning all of script and lib for /^use Module::Name 1.23/ to determine requires, and all of t to find build_requires/test_requires. Anything loaded without a specific numeric version would be ignored and would have to be specified with a manual requires statement. I'd filter out POD and comment lines, but I wouldn't bother with full source parsing (can't really do that inside M:I anyway since I'd have to bundle PPI). Adam On Sun, Feb 5, 2012 at 12:23 PM, David Golden <[email protected]> wrote: > On Sat, Feb 4, 2012 at 5:17 PM, Adam Kennedy <[email protected]> wrote: >> That's how Module::Install's requires_from does it too. >> >> I should look at zilla's code and see how it runs, might be worth >> aligning M:I and it's detection. > > It uses Ricardo's Perl::PrereqScanner, which does a pretty sane job of > it (even detects base/parent and so on). =A0It has some extensions for > picking up Moose and POE prereqs and so on. > > It doesn't help with optional, dynamic prereqs so those have to be > specified manually, but that's unavoidable I think. > > David