Dist::Zilla::Dist::Builder - dist zilla subclass for building dists


version 6.030


This module should work on any version of perl still receiving updates from the Perl 5 Porters. This means it should work on any version of perl released in the last two to three years. (That is, if the most recently released version is v5.40, then this module should work on both v5.40 and v5.38.)

Although it may work on older versions of perl, no guarantee is made that the minimum required version will not be increased. The version may be increased for any reason, and there is no promise that patches will be accepted to lower the minimum required perl.



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



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

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

This method should not be relied upon, yet. Its semantics are certain to change.

Valid arguments are:

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



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.


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



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.


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


  my $basename = $zilla->dist_basename;

This method will return the dist's basename (e.g. Dist-Name-1.01. The basename is used as the top-level directory in the tarball. It does not include -TRIAL, even if building a trial dist.


  my $basename = $zilla->archive_basename;

This method will return the filename, without the format extension (e.g. Dist-Name-1.01 or Dist-Name-1.01-TRIAL).


  my $tarball = $zilla->archive_filename;

This method will return the filename (e.g. Dist-Name-1.01.tar.gz) of the tarball of this distribution. It will include -TRIAL if building a trial distribution, unless the version contains an underscore. The tarball might not exist.



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



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.


This method removes temporary files and directories suspected to have been produced by the Dist::Zilla build process. Specifically, it deletes the .build directory and any entity that starts with the dist name and a hyphen, like matching the glob Your-Dist-*.



This method will consistently build the distribution in a temporary subdirectory. It will return the path for the temporary build location.


  $zilla->install( \%arg );

This method installs the distribution locally. The distribution will be built in a temporary subdirectory, then the process will change directory to that subdir and an installer will be run.

Valid arguments are:

  keep_build_dir  - if true, don't rmtree the build dir, even if everything
                    seemed to work
  install_command - the command to run in the subdir to install the dist
                    default (roughly): $^X -MCPAN -einstall .

                    this argument should be an arrayref



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

\%arg may be omitted. Otherwise, valid arguments are:

  keep_build_dir  - if true, don't rmtree the build dir, even if everything
                    seemed to work


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

This method runs the tests in $directory (a Path::Tiny), 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.


  $zilla->run_in_build( \@cmd );

This method makes a temporary directory, builds the distribution there, executes all the dist's BuildRunners (unless directed not to, via $arg->{build} = 0), and then runs the given command in the build directory. If the command exits non-zero, the directory will be left in place.


Ricardo SIGNES 😏 <>


This software is copyright (c) 2023 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.