Dist::Zilla::Dist::Builder(3pm)

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

VERSION
version 6.037

PERL VERSION
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.

ATTRIBUTES

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

METHODS

  from_config
  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

  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 gets 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.

  ensure_built
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!

  dist_basename
  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.

  archive_basename
  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").

  archive_filename
  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.

  build_archive
  $zilla->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
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-*".

  ensure_built_in_tmpdir
  $zilla->ensure_built_in_tmpdir;

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

  install
  $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

  test
  $zilla->test(\%arg);

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

  run_tests_in
  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.

  run_in_build
  $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.

AUTHOR
Ricardo SIGNES 😏 <cpan@semiotic.systems>

COPYRIGHT AND LICENSE
This software is copyright (c) 2026 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.