You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucy.apache.org by ma...@apache.org on 2012/12/13 03:27:50 UTC

[lucy-commits] [9/12] git commit: refs/heads/chaz_compiler_flags - Provide access to generated Charmony config.

Provide access to generated Charmony config.

Once the "charmony" action has been run and the Perl config file
generated, provide access to the resulting config.


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

Branch: refs/heads/chaz_compiler_flags
Commit: 8a80ecf3862255c8b377eec0ebc9eab8ab5dfe5e
Parents: 8b291d2
Author: Marvin Humphrey <ma...@rectangular.com>
Authored: Mon Dec 3 11:22:59 2012 -0800
Committer: Marvin Humphrey <ma...@rectangular.com>
Committed: Mon Dec 10 18:33:53 2012 -0800

----------------------------------------------------------------------
 .../perl/lib/Clownfish/CFC/Perl/Build/Charmonic.pm |   16 +++++++++++++++
 1 files changed, 16 insertions(+), 0 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucy/blob/8a80ecf3/clownfish/compiler/perl/lib/Clownfish/CFC/Perl/Build/Charmonic.pm
----------------------------------------------------------------------
diff --git a/clownfish/compiler/perl/lib/Clownfish/CFC/Perl/Build/Charmonic.pm b/clownfish/compiler/perl/lib/Clownfish/CFC/Perl/Build/Charmonic.pm
index 13abca9..edbd1d9 100644
--- a/clownfish/compiler/perl/lib/Clownfish/CFC/Perl/Build/Charmonic.pm
+++ b/clownfish/compiler/perl/lib/Clownfish/CFC/Perl/Build/Charmonic.pm
@@ -87,6 +87,22 @@ sub ACTION_charmony {
     system(@command) and die "Failed to run $CHARMONIZER_EXE_PATH: $!";
 }
 
+my $config;
+
+sub charmony {
+    my ( undef, $key ) = @_;
+    if (!$config) {
+        eval { require 'Charmony.pm'; };
+        if ( !$@ ) {
+            $config = Charmony->config;
+        }
+    }
+    if ($config) {
+        return $config->{$key};
+    }
+    return;
+}
+
 sub _quotify {
     my $string = shift;
     $string =~ s/\\/\\\\/g;