[Module-build-checkins] Module-Build/lib/Module/Build Cookbook.pm,1.11,1.12
Status: Beta
Brought to you by:
kwilliams
From: Ken W. <kwi...@us...> - 2004-11-12 02:27:55
|
Update of /cvsroot/module-build/Module-Build/lib/Module/Build In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv25893/lib/Module/Build Modified Files: Cookbook.pm Log Message: Eliminate a redundant recipe Index: Cookbook.pm =================================================================== RCS file: /cvsroot/module-build/Module-Build/lib/Module/Build/Cookbook.pm,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** Cookbook.pm 5 Nov 2004 16:27:53 -0000 1.11 --- Cookbook.pm 12 Nov 2004 02:27:00 -0000 1.12 *************** *** 111,142 **** =head1 ADVANCED RECIPES - =head2 Adding new elements to the build process - - If there's some new type of file (i.e. not a F<.pm> file, or F<.xs> - file, or one of the other things C<Module::Build> knows how to - process) that you'd like to handle during the building of your module, - you can do something like the following in your F<Build.PL> file: - - use Module::Build; - - my $class = Module::Build->subclass( code => <<'EOC' ); - sub process_foo_files { - my $self = shift; - ... locate and process foo files, and create something in blib/ - } - } - - my $build = $class->new( ... ); - - $build->add_build_element('foo'); - - - This creates a custom subclass of C<Module::Build> that knows how to - build elements of type C<foo>. It should place the elements in a - subdirectory of F<blib/> corresponding to items that C<Module::Build> - knows how to install - to add new capabilities in I<that> arena, see - L</Adding new types to the install process>. - - =head2 Changing the order of the build process --- 111,114 ---- *************** *** 221,232 **** If your extra files actually need to be created on the user's machine, ! you'll probably have to override the C<build> action to do so: use Module::Build; my $class = Module::Build->subclass(code => <<'EOF'); ! sub ACTION_build { my $self = shift; ! $self->SUPER::ACTION_build(@_); ! ... create the .dat files here ... } EOF --- 193,206 ---- If your extra files actually need to be created on the user's machine, ! or if they need some other kind of special processing, you'll probably ! want to create a special method to do so, named ! C<process_${kind}_files()>: use Module::Build; my $class = Module::Build->subclass(code => <<'EOF'); ! sub process_dat_files { my $self = shift; ! ... locate and process *.dat files, ! ... and create something in blib/lib/ } EOF *************** *** 240,244 **** If your extra files don't go in F<lib/> but in some other place, see ! L<"Adding new elements to the install process"> Please note that these examples use some capabilities of Module::Build --- 214,219 ---- If your extra files don't go in F<lib/> but in some other place, see ! L<"Adding new elements to the install process"> for how to actually ! get them installed. Please note that these examples use some capabilities of Module::Build *************** *** 281,284 **** --- 256,263 ---- installed. + See also L<"Adding new file types to the build process"> for how to + create the stuff in F<blib/conf/> in the first place. + + =head1 AUTHOR |