The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

Dist::Zilla - distribution builder; installer not included!

VERSION

version 2.101290

DESCRIPTION

Dist::Zilla builds distributions of code to be uploaded to the CPAN. In this respect, it is like ExtUtils::MakeMaker, Module::Build, or Module::Install. Unlike those tools, however, it is not also a system for installing code that has been downloaded from the CPAN. Since it's only run by authors, and is meant to be run on a repository checkout rather than on published, released code, it can do much more than those tools, and is free to make much more ludicrous demands in terms of prerequisites.

For more information, see Dist::Zilla::Tutorial.

ATTRIBUTES

name

The name attribute (which is required) gives the name of the distribution to be built. This is usually the name of the distribution's main module, with the double colons (::) replaced with dashes. For example: Dist-Zilla.

version

This is the version of the distribution to be created.

abstract

This is a one-line summary of the distribution. If none is given, one will be looked for in the "main_module" of the dist.

main_module

This is the module where Dist::Zilla might look for various defaults, like the distribution abstract. By default, it's derived from the distribution name. If your distribution is Foo-Bar, and lib/Foo/Bar.pm exists, that's the main_module. Otherwise, it's the shortest-named module in the distribution. This may change!

You can override the default by specifying the file path explicitly, ie: main_module = lib/Foo/Bar.pm

This is the name of the legal entity who holds the copyright on this code. This is a required attribute with no default!

This is the year of copyright for the dist. By default, it's this year.

license

This is the Software::License object for this dist's license. It will be created automatically, if possible, with the copyright_holder and copyright_year attributes. If necessary, it will try to guess the license from the POD of the dist's main module.

A better option is to set the license name in the dist's config to something understandable, like Perl_5.

authors

This is an arrayref of author strings, like this:

  [
    'Ricardo Signes <rjbs@cpan.org>',
    'X. Ample, Jr <example@example.biz>',
  ]

This is likely to change at some point in the near future.

files

This is an arrayref of objects implementing Dist::Zilla::Role::File that will, if left in this arrayref, be built into the dist.

root

This is the root directory of the dist, as a Path::Class::Dir. It will nearly always be the current working directory in which dzil was run.

is_trial

This attribute tells us whether or not the dist will be a trial release.

plugins

This is an arrayref of plugins that have been plugged into this Dist::Zilla object.

built_in

This is the Path::Class::Dir, if any, in which the dist has been built.

distmeta

This is a hashref containing the metadata about this distribution that will be stored in META.yml or META.json. You should not alter the metadata in this hash; use a MetaProvider plugin instead.

prereq

This is a hashref of module prerequisites. This attribute is likely to get greatly overhauled, or possibly replaced with a method based on other (private?) attributes.

Actually, it is more likely that this attribute will contain an object in the future.

METHODS

from_config

  my $zilla = Dist::Zilla->from_config(\%arg);

This routine returns a new Zilla from the configuration in the current working directory.

Valid arguments are:

  config_class - the class to use to read the config
                 default: Dist::Zilla::Config::Finder

plugin_named

  my $plugin = $zilla->plugin_named( $plugin_name );

plugins_with

  my $roles = $zilla->plugins_with( -SomeRole );

This method returns an arrayref containing all the Dist::Zilla object's plugins that perform a the named role. If the given role name begins with a dash, the dash is replaced with "Dist::Zilla::Role::"

find_files

  my $files = $zilla->find_files( $finder_name );

This method will look for a FileFinder-performing plugin with the given name and return the result of calling find_files on it. If no plugin can be found, an exception will be raised.

build_in

  $zilla->build_in($root);

This method builds the distribution in the given directory. If no directory name is given, it defaults to DistName-Version. If the distribution has already been built, an exception will be thrown.

build

This method just calls build_in with no arguments. It get you the default behavior without the weird-looking formulation of build_in with no object for the preposition!

ensure_built_in

  $zilla->ensure_built_in($root);

This method behaves like "build_in", but if the dist is already built in $root (or the default root, if no root is given), no exception is raised.

build_archive

  $dist->build_archive;

This method will ensure that the dist has been built, and will then build a tarball of the build directory in the current directory.

release

  $zilla->release;

This method releases the distribution, probably by uploading it to the CPAN. The actual effects of this method (as with most of the methods) is determined by the loaded plugins.

clean

install

test

  $zilla->test;

This method builds a new copy of the distribution and tests it.

run_tests_in

  my $error = $zilla->run_tests_in($directory);

This method runs the tests in $directory (a Path::Class::Dir), which must contain an already-built copy of the distribution. It will throw an exception if there are test failures.

It does not set any of the *_TESTING environment variables, nor does it clean up $directory afterwards.

run_in_build

log

  $zilla->log($message);

This method logs the given message.

SUPPORT

There are usually people on irc.perl.org in #distzilla, even if they're idling.

There is a mailing list to discuss Dist::Zilla. You can join the list or browse the archives.

AUTHOR

  Ricardo SIGNES <rjbs@cpan.org>

COPYRIGHT AND LICENSE

This software is copyright (c) 2010 by Ricardo SIGNES.

This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.