lucy-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From nwelln...@apache.org
Subject [lucy-commits] [3/6] git commit: Switch to Module::Build->depends_on
Date Tue, 22 Apr 2014 20:59:09 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/93b82bed
Tree: http://git-wip-us.apache.org/repos/asf/lucy-clownfish/tree/93b82bed
Diff: http://git-wip-us.apache.org/repos/asf/lucy-clownfish/diff/93b82bed

Branch: refs/heads/master
Commit: 93b82bed6e9c9acd1595fbad207b7a29580075c2
Parents: 4845706
Author: Nick Wellnhofer <wellnhofer@aevum.de>
Authored: Sun Feb 16 22:13:01 2014 +0100
Committer: Nick Wellnhofer <wellnhofer@aevum.de>
Committed: Tue Apr 22 21:17:01 2014 +0200

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


http://git-wip-us.apache.org/repos/asf/lucy-clownfish/blob/93b82bed/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/93b82bed/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 e632bc8..da22e53 100644
--- a/compiler/perl/lib/Clownfish/CFC/Perl/Build.pm
+++ b/compiler/perl/lib/Clownfish/CFC/Perl/Build.pm
@@ -249,7 +249,7 @@ sub _compile_clownfish {
 
 sub ACTION_pod {
     my $self = shift;
-    $self->dispatch("clownfish");
+    $self->depends_on('clownfish');
     $self->_write_pod(@_);
 }
 
@@ -354,7 +354,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;
@@ -485,9 +485,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/93b82bed/runtime/perl/buildlib/Clownfish/Build.pm
----------------------------------------------------------------------
diff --git a/runtime/perl/buildlib/Clownfish/Build.pm b/runtime/perl/buildlib/Clownfish/Build.pm
index 9a28a55..991ac5a 100644
--- a/runtime/perl/buildlib/Clownfish/Build.pm
+++ b/runtime/perl/buildlib/Clownfish/Build.pm
@@ -97,7 +97,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;
 
@@ -108,8 +108,7 @@ sub ACTION_copy_clownfish_includes {
 sub ACTION_clownfish {
     my $self = shift;
 
-    $self->dispatch('charmony');
-    $self->dispatch('cfc');
+    $self->depends_on(qw( charmony cfc ));
 
     $self->SUPER::ACTION_clownfish;
 }
@@ -176,8 +175,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