Author: schwern
Date: Sun Sep 28 13:44:48 2008
New Revision: 11896

Modified:
   Module-Build/trunk/   (props changed)
   Module-Build/trunk/Changes
   Module-Build/trunk/lib/Module/Build/Cookbook.pm

Log:
 [EMAIL PROTECTED]:  schwern | 2008-09-28 16:29:28 -0400
   - Added a recipe for writing a new action to Module::Build::Cookbook


Modified: Module-Build/trunk/Changes
==============================================================================
--- Module-Build/trunk/Changes  (original)
+++ Module-Build/trunk/Changes  Sun Sep 28 13:44:48 2008
@@ -1,9 +1,13 @@
 Revision history for Perl extension Module::Build.
 
 0.30_01
+ New Docs
+ - Added a recipe for writing a new action to Module::Build::Cookbook
 
+ Bug Fixes
  - Workaround HARNESS_TIMER env issue in t/compat.t (RT#39635)
 
+ Other
  - Updated our embedded version.pm to 0.76, enhanced documentation on
    dist_version_from.  [John Peacock]
 

Modified: Module-Build/trunk/lib/Module/Build/Cookbook.pm
==============================================================================
--- Module-Build/trunk/lib/Module/Build/Cookbook.pm     (original)
+++ Module-Build/trunk/lib/Module/Build/Cookbook.pm     Sun Sep 28 13:44:48 2008
@@ -431,6 +431,30 @@
   )->create_build_script;
 
 
+=head2 Adding an action
+
+You can add a new C<./Build> action simply by writing the method for
+it in your subclass.  Use C<depends_on> to declare that another action
+must have been run before your action.
+
+For example, let's say you wanted to be able to write C<./Build
+commit> to test your code and commit it to version control.
+
+  # Build.PL
+  use Module::Build;
+  my $class = Module::Build->subclass(
+      class => "Module::Build::Custom",
+      code => <<'SUBCLASS' );
+
+  sub ACTION_commit {
+      my $self = shift;
+
+      $self->depends_on("test");
+      $self->do_system(qw(svn commit));
+  }
+  SUBCLASS
+
+
 =head1 AUTHOR
 
 Ken Williams <[EMAIL PROTECTED]>
@@ -438,7 +462,7 @@
 
 =head1 COPYRIGHT
 
-Copyright (c) 2001-2006 Ken Williams.  All rights reserved.
+Copyright (c) 2001-2008 Ken Williams.  All rights reserved.
 
 This library is free software; you can redistribute it and/or
 modify it under the same terms as Perl itself.

Reply via email to