An introduction to App::ModuleBuildTiny part 1: setting things up

App::ModuleBuildTiny is a relatively new authoring tool. It aims to be a relatively lightweight (at least to some other tools like Dist::Zilla) and newbie friendly tool. It supports two install tools: Module::Build::Tiny (obviously what it was originally designed for) and Dist::Build; it does not support ExtUtils::MakeMaker or Module::Build.

Installing

Installing is just a matter of installing the App::ModuleBuildTiny distribution using your favorite CPAN client.

A minimal setup

Before minting, it's advisable to have run mbtiny setup at least once, to set up a general configuration. It's not strictly required, but it will set a default configuration so you don't have to answer these same questions every time you mint a new distribution. If you don't care about the details, mbtiny setup minimal will have you set up in a minute with two unavoidable licensing related questions:

  • What is the author's name?
  • What is the author's email?

If you want a simple setup, that's all you need and you can actually stop reading the rest of this post.

A detailed setup

If you want more control, you can use mbtiny setup all to get all configuration questions. All questions have usable defaults. It adds one more legal question to the previous two.

What license do you want to use?

This defaults to Perl_5, the same license as Perl uses. If you've never given licenses much thought this is probably the best option for a perl module because this is what most of CPAN uses.

Writeback questions

These questions decide which files are written back to your filesystem/repository.

Do you want to write your build files to your filesystem?

If enabled, this will write Build.PL, META.json, META.yml, and MANIFEST files to disk when regenerating. If not they'll only be in the tarball. Enabling this is generally recommended as it makes CI workflows easier and enhances reproducibility.

Do you want to write your LICENSE file to your filesystem?

If enabled, it will generate and write a LICENSE file on regeneration (though usually it doesn't change after minting). This is usually what you want.

Do you want to write your README file to your filesystem?

If true this will generate a README file from the main module's pod. Unless you'd rather write your own README file you probably want to enable this.

Automation questions

These questions enable some extra magic that make mbtiny a little easier to use, but you don't actually need any of these if you don't want to.

Do you want mbtiny to automatically handle git for you?

This integrates automatic git handling. If enabled this will turn on flags on three commands

  • On mbtiny mint it will set --init-git to initialize a new git repository.
  • On mbtiny regenerate it will set --commit to commit the generated changes.
  • On mbtiny upload it will enable --tag and --push to tag and push the current commit.

I would generally recommend enabling this unless you're not using git. All of these options can be overridden the usual way (e.g. mbtiny mint Foo --no-init-git).

Do you want mbtiny to automatically bump on regenerate for you?

If enabled this will turn on the --bump option to mbtiny regenerate by default. In my experience bumping is the only time when you want to regenerate, but maybe someone wants to use a different workflow from mine.

Do you want mbtiny to automatically scan dependencies for you?

If enabled this will turn on the --scan option to mbtiny regenerate by default. This is similar to the [AutoPrereqs] plugin in Dist::Zilla. If you don't like this you can disable it and manually set your prerequisites using a cpanfile or a preqreqs.yml file.

Do you want mbtiny to automatically add a repository link to the metadata

This will try to automatically detect the right repository link for your distribution. Currently only github is well supported, patches for other git providers are welcome.

Do you want mbtiny to automatically add a bug tracker link to the metadata

This will try to automatically detect the right bug tracker for your distribution. Currently only github is well supported, patches for other git providers are welcome.

Changing things later

If you want to change things later, you call always call mbtiny setup all to go through the same questions again. Or use the setup set mode like mbtiny setup set auto_scan false.

Leave a comment

About Leon Timmermans

user-pic