Updates.
[dbsrgits/SQL-Translator.git] / lib / SQL / Translator / Module / Build.pm
CommitLineData
50f63fb1 1package SQL::Translator::Module::Build;
2
3use strict;
4use warnings;
5use File::Find;
6
7use base qw/Module::Build/;
8
9# Copies contents of ./templates into blib/templates. These are then installed
10# based on the install_paths setting given to the constructor.
11# Called by Module::Build due to add_build_element call in Build.PL
12sub process_template_files {
13 my $build = shift;
14 find({
15 no_chdir => 1,
16 wanted => sub {
17 return unless -f $_;
18 $build->copy_if_modified( from => $_, to_dir => "blib", verbose => 1);
19 },
20 },'templates');
21}
22
23# Install the templates copied into blib above. Uses
24sub ACTION_install {
25 my $build = shift;
26 $build->SUPER::ACTION_install(@_);
27 require ExtUtils::Install;
28 my $install_to = $build->config_data( 'template_dir' );
29 ExtUtils::Install::install(
30 { 'templates' => $install_to }, 1, 0, $build->{args}{uninst} || 0 );
31}
32
331;