Ado

 view release on metacpan or  search on metacpan

lib/Ado/Build.pm  view on Meta::CPAN

  use warnings FATAL => 'all';
  use FindBin;
  use lib("$FindBin::Bin/lib");
  use Ado::Build;
  my $builder = Ado::Build->new(..);
  $builder->create_build_script();

  #on the command line
  cd /path/to/cloned/Ado
  perl Build.PL
  ./Build
  ./Build test
  #change/add some code
  ./Build test
  ./Build perltidy
  ./Build dist
  ./Build submit
  #.... and so on


=head1 DESCRIPTION

This is a subclass of L<Module::Build>. We use L<Module::Build::API> to add
custom functionality. This module and L<Ado::BuildPlugin> exist just because of
the additional install paths that we use beside C<lib> and C<bin> and
processing the files in those paths. These modules also can serve as examples
for your own builders if you have some custom things to do during  build, test,
install and even if you need to add a new C<ACTION_*> to your setup.

=head1 ATTRIBUTES

Ado::Build defines some attributes, used across different actions.

=head2 PERL_DIRS

Returns the list of absolute paths to directories in the project containing
Perl files. Read-only.

  $self->PERL_DIRS;
  #(/base/dir/bin, /base/dir/lib, /base/dir/t, /base/dir/etc)



=head1 METHODS

Ado::Build inherits all methods from L<Module::Build> and implements
the following ones.

=head2 create_build_script

This method is called in C<Build.PL>.
In this method we also call C<add_build_element> for C<etc> C<public>,
C<templates> and C<log> folders.
Finally we set all the C<install_path>s for the distro
and we call C<$self-E<gt>SUPER::create_build_script>.

=head2 process_etc_files

Moves files found in C<Ado/etc> to C<Ado/blib/etc>.
See L<Module::Build::API/METHODS>
Returns void.

=head2 process_log_files

Moves files found in C<Ado/log> to C<Ado/blib/log>.
Returns void.

=head2 process_public_files

Moves files found in C<Ado/public> to C<Ado/blib/public>.
Returns void.

=head2 process_templates_files

Moves files found in C<Ado/templates> to C<Ado/blib/templates>.
Returns void.

=head2 ACTION_build

We put here custom functionality executed around the
C<$self-E<gt>SUPER::ACTION_build>. See the source for details.

=head2 ACTION_test

We put here custom functionality executed around the
C<$self-E<gt>SUPER::ACTION_test>. See the source for details.

=head2 ACTION_dist

We put here custom functionality executed around the
C<$self-E<gt>SUPER::ACTION_dist>. See the sources for details.

=head2 ACTION_install

Changes file permissions to C<0600> of some files
like C<etc/ado.sqlite> and to C<0400> of some files like C<etc/ado.conf>.
You can put additional custom functionality here.

=head2 ACTION_fakeuninstall

Dry run for uninstall operation against module Ado.

=head2 ACTION_uninstall

Perform uninstall operation against Ado module.

=head2 ACTION_perltidy

Tidies all C<*.conf, *.pm, *.pl, *.t> files found in project
directories C<bin, lib, t, etc> in the distribution.
Uses the C<./pertidyrc> found in the project root directory.
Cleans up all C<.bak> files.
This action does not tidies C<Build.PL>.
Use C<perltidy Build.PL> for that.

  perl Build.PL
  ./Build perltidy
  ./Build
  ...

=head2 ACTION_submit

TODO: commit and push after testing tidying and who knows what..

  ./Build submit



=head2 do_create_readme

Creates the README file from C<lib/Ado/Manual.pod>.

=head1 SEE ALSO

L<Ado::BuildPlugin>,
L<Module::Build::API>,



( run in 1.082 second using v1.01-cache-2.11-cpan-d7f47b0818f )