lucy-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From nwelln...@apache.org
Subject [lucy-commits] [6/6] git commit: Switch to Module::Build->depends_on
Date Sun, 16 Feb 2014 23:20:07 GMT
Switch to Module::Build->depends_on

According to the Module::Build documentation, 'depends_on' is preferred
over 'dispatch' when calling actions from inside another action.

Calling 'dispatch' also has the side effect of localizing the
Module::Build properties hash. This makes it impossible to call an
action which changes some properties and use the changed properties
afterwards. The next commit relies on this feature.


Project: http://git-wip-us.apache.org/repos/asf/lucy-clownfish/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucy-clownfish/commit/8e4c8f1d
Tree: http://git-wip-us.apache.org/repos/asf/lucy-clownfish/tree/8e4c8f1d
Diff: http://git-wip-us.apache.org/repos/asf/lucy-clownfish/diff/8e4c8f1d

Branch: refs/heads/cflags
Commit: 8e4c8f1dad023b35122a76f2638655e6bec59c14
Parents: 3371dd1
Author: Nick Wellnhofer <wellnhofer@aevum.de>
Authored: Sun Feb 16 22:13:01 2014 +0100
Committer: Nick Wellnhofer <wellnhofer@aevum.de>
Committed: Mon Feb 17 00:18:42 2014 +0100

----------------------------------------------------------------------
 compiler/perl/buildlib/Clownfish/CFC/Build.pm |  6 ++----
 compiler/perl/lib/Clownfish/CFC/Perl/Build.pm | 12 +++++++-----
 runtime/perl/buildlib/Clownfish/Build.pm      | 10 ++++------
 3 files changed, 13 insertions(+), 15 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucy-clownfish/blob/8e4c8f1d/compiler/perl/buildlib/Clownfish/CFC/Build.pm
----------------------------------------------------------------------
diff --git a/compiler/perl/buildlib/Clownfish/CFC/Build.pm b/compiler/perl/buildlib/Clownfish/CFC/Build.pm
index b695813..93fa675 100644
--- a/compiler/perl/buildlib/Clownfish/CFC/Build.pm
+++ b/compiler/perl/buildlib/Clownfish/CFC/Build.pm
@@ -95,7 +95,7 @@ sub ACTION_lemon {
 # Run all .y files through lemon.
 sub ACTION_parsers {
     my $self = shift;
-    $self->dispatch('lemon');
+    $self->depends_on('lemon');
     my $y_files = $self->rscan_dir( $CFC_SOURCE_DIR, qr/\.y$/ );
     for my $y_file (@$y_files) {
         my $c_file = $y_file;
@@ -133,9 +133,7 @@ sub ACTION_lexers {
 sub ACTION_code {
     my $self = shift;
 
-    $self->dispatch('charmony');
-    $self->dispatch('ppport');
-    $self->dispatch('parsers');
+    $self->depends_on(qw( charmony ppport parsers ));
 
     my @flags = $self->split_like_shell($self->charmony("EXTRA_CFLAGS"));
     # The flag for the MSVC6 hack contains spaces. Make sure it stays quoted.

http://git-wip-us.apache.org/repos/asf/lucy-clownfish/blob/8e4c8f1d/compiler/perl/lib/Clownfish/CFC/Perl/Build.pm
----------------------------------------------------------------------
diff --git a/compiler/perl/lib/Clownfish/CFC/Perl/Build.pm b/compiler/perl/lib/Clownfish/CFC/Perl/Build.pm
index 1811bbd..224a5bd 100644
--- a/compiler/perl/lib/Clownfish/CFC/Perl/Build.pm
+++ b/compiler/perl/lib/Clownfish/CFC/Perl/Build.pm
@@ -243,7 +243,7 @@ sub _compile_clownfish {
 
 sub ACTION_pod {
     my $self = shift;
-    $self->dispatch("clownfish");
+    $self->depends_on('clownfish');
     $self->_write_pod(@_);
 }
 
@@ -348,7 +348,7 @@ sub ACTION_ppport {
 sub ACTION_compile_custom_xs {
     my $self = shift;
 
-    $self->dispatch('ppport');
+    $self->depends_on('ppport');
 
     require ExtUtils::CBuilder;
     require ExtUtils::ParseXS;
@@ -479,9 +479,11 @@ sub ACTION_compile_custom_xs {
 sub ACTION_code {
     my $self = shift;
 
-    $self->dispatch('clownfish');
-    $self->dispatch('compile_custom_xs');
-    $self->dispatch('copy_clownfish_includes');
+    $self->depends_on(qw(
+        clownfish
+        compile_custom_xs
+        copy_clownfish_includes
+    ));
 
     $self->SUPER::ACTION_code;
 }

http://git-wip-us.apache.org/repos/asf/lucy-clownfish/blob/8e4c8f1d/runtime/perl/buildlib/Clownfish/Build.pm
----------------------------------------------------------------------
diff --git a/runtime/perl/buildlib/Clownfish/Build.pm b/runtime/perl/buildlib/Clownfish/Build.pm
index 610828b..6925a73 100644
--- a/runtime/perl/buildlib/Clownfish/Build.pm
+++ b/runtime/perl/buildlib/Clownfish/Build.pm
@@ -86,7 +86,7 @@ sub _run_make {
 # Build the charmonizer tests.
 sub ACTION_charmonizer_tests {
     my $self = shift;
-    $self->dispatch('charmony');
+    $self->depends_on('charmony');
     print "Building Charmonizer Tests...\n\n";
     my $flags = join( " ",
         $self->config('ccflags'),
@@ -116,7 +116,7 @@ sub ACTION_cfc {
 sub ACTION_copy_clownfish_includes {
     my $self = shift;
 
-    $self->dispatch('charmony');
+    $self->depends_on('charmony');
 
     $self->SUPER::ACTION_copy_clownfish_includes;
 
@@ -127,8 +127,7 @@ sub ACTION_copy_clownfish_includes {
 sub ACTION_clownfish {
     my $self = shift;
 
-    $self->dispatch('charmonizer_tests');
-    $self->dispatch('cfc');
+    $self->depends_on(qw( charmonizer_tests cfc ));
 
     $self->SUPER::ACTION_clownfish;
 }
@@ -195,8 +194,7 @@ sub ACTION_test_valgrind {
     if ( !$ENV{LUCY_VALGRIND} ) {
         warn "\$ENV{LUCY_VALGRIND} not true -- possible false positives";
     }
-    $self->dispatch('code');
-    $self->dispatch('suppressions');
+    $self->depends_on(qw( code suppressions ));
 
     # Unbuffer STDOUT, grab test file names and suppressions files.
     $|++;


Mime
View raw message