http://www.perlmonks.org?node_id=972740


in reply to My Perl Module Toolchain

Just for contrast, here is my process. Again, it is just what works for me, without any guarantee that it will work the same for you:

Starting a project

Usually, I start a project by starting with an empty directory, in which I usually only create bin/ and lib/ directories, together with (eventually) scripts and modules. The t/ directory of tests only gets filled with tests once I have stumbled upon a tricky part of code where I think that tests will help me to formalize the results and/or the API even where the existing program in bin/ does not.

Makefile.PL

Once a module goes "to release", that is, gets installed on any other machine, I like to list all dependencies and use cpan . (or cpanm) to install these prerequisites. I use a Makefile.PL from my other modules and change it to fit the distribution at hand. Usually at the same time, I copy the "boilerplate" tests 99-* which check for POD wellformedness, version number consistency, line endings consistency and some other technicalities. Also the "boilerplate" MANIFEST.skip and .gitignore get copied and customized. Usually, this is the moment when I check the whole tree into source control, git in my case.

Releasing

I cobbled a shell script together that does a full test suite run from the git repository checkout, uploads the tarball to CPAN, and then pushes the tree and tag to github. It's based on Module::Release (resp. the included release script) doing the heavy lifting of running the test suite, checking that the checkout is recent etc.:

#!/bin/bash if [ -d .git ]; then git checkout -f fi rm *.tar.gz rm *.tar /opt/perl/bin/release_corion -k -p if [[ $? -ne 0 ]]; then echo "Some error, not pushing ($?)" exit fi if [[ -d .git ]]; then for REMOTE in $(git remote); do git push $REMOTE --tags && git push $REMOTE --all done fi