Entering MooseX, XIX Now We Package II

So in my last post I had started to play about with Dist::Zilla and my initial playing about I was very pleased at what it gave me. Now I did have a few thinks to clean up, some test roles that where throwing some sort of warning when they should not and where I was building the Mod was 100% right.

So the first the extra roles


Warning: prerequisite test_role1 0 not found.
Warning: prerequisite test_role2 0 not found.
Warning: prerequisite test_role3 0 not found.


So having a look at 'Dist::Zilla::Plugin::AutoPrereqs' I see there is a 'skip' attribute for it (with with Dist::Zilla plugins there are custom param you can pass to them from the .ini file.

So all I need is add a quick regex like this to the ini file

[AutoPrereqs]
skip = test_role\d

and then did

dzil build

and got
[DZ] beginning to build MooseX-AuthorizedMethodRoles
[DZ] guessing dist's main_module is lib/MooseX/AuthorizedMethodRoles.pm
[DZ] extracting distribution abstract from lib/MooseX/AuthorizedMethodRoles.pm
[DZ] writing MooseX-AuthorizedMethodRoles in MooseX-AuthorizedMethodRoles-0.001
Error open (<:unix) on 'MooseX-AuthorizedMethodRoles-0.001/Makefile.PL': No such
file or directory at C:/Dwimperl/perl/site/lib/Dist/Zilla/File/OnDisk.pm line 3
4

Opps didn't expect that but I guess it is a good thing as one doesn't want to overwrite a good build with a potentially bad one so remember that list of commands from the last post I will give this a try

? dzil clean
[DZ] clean: removing .build
[DZ] clean: removing MooseX-AuthorizedMethodRoles-0.001
[DZ] clean: removing MooseX-AuthorizedMethodRoles-0.001.tar.gz

ok got rid of those lets give it another go

? dzil build
[DZ] beginning to build MooseX-AuthorizedMethodRoles
[DZ] guessing dist's main_module is lib/MooseX/AuthorizedMethodRoles.pm
[DZ] extracting distribution abstract from lib/MooseX/AuthorizedMethodRoles.pm
[DZ] writing MooseX-AuthorizedMethodRoles in MooseX-AuthorizedMethodRoles-0.001
[DZ] building archive with Archive::Tar; install Archive::Tar::Wrapper 0.15 or n
ewer for improved speed
[DZ] writing archive to MooseX-AuthorizedMethodRoles-0.001.tar.gz

and that cleaned the warning up for me now lets see how to have this baby crete my dis in an other dir than the dir I do my codding int.

So after a little snooping about I discovered that the GatherDir plugin has the 'root' attribute and by my reading all I think I need to do is move my ini file into the dir I want (dist or tag or alike) from my dev dir (branch trunk etc) point to my dev dir with this attribute and it should work? So I move my ini to D:\Blods\ and added


[GatherDir]
root = D:\Blogs\Moosex-AuthorizedMethodRoles

to my ini and this time I did

dzil build clean

and I get a nice clean dir, also notice that you can string more than 1 dzil command at a time kool.

D:\Blogs\MooseX-AuthorizedMethodRoles-0.001

and a 'tar.gz' file

D:\Blogs\MooseX-AuthorizedMethodRoles-0.001.tar.gz


right where I expected them

Well so far so good that was quite straightforward I can see why this Mod is becomming the way to do it in Perl. Now I was going to go one more step and use Dist::Zilla to get my source from github and sent it to CPAN but that rather goes out of scope for this series of post so on to my next victim tomorrow.

LqeuLhb.jpg

Leave a comment

About byterock

user-pic Long time Perl guy, a few CPAN mods allot of work on DBD::Oracle and a few YAPC presentations