You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucy.apache.org by nw...@apache.org on 2014/07/07 00:14:06 UTC

git commit: Document bind_all method

Repository: lucy-clownfish
Updated Branches:
  refs/heads/master f03f8adb0 -> 2433806e8


Document bind_all method


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

Branch: refs/heads/master
Commit: 2433806e856da5b8f72bbcb234beba1e6729aafa
Parents: f03f8ad
Author: Nick Wellnhofer <we...@aevum.de>
Authored: Mon Jul 7 00:13:45 2014 +0200
Committer: Nick Wellnhofer <we...@aevum.de>
Committed: Mon Jul 7 00:13:45 2014 +0200

----------------------------------------------------------------------
 compiler/perl/lib/Clownfish/CFC/Perl/Build.pm | 51 +++++++++++++++-------
 1 file changed, 35 insertions(+), 16 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucy-clownfish/blob/2433806e/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 9a4091d..1b6c04f 100644
--- a/compiler/perl/lib/Clownfish/CFC/Perl/Build.pm
+++ b/compiler/perl/lib/Clownfish/CFC/Perl/Build.pm
@@ -597,6 +597,41 @@ the Perl bindings for Clownfish modules.
 
     $builder->create_build_script();
 
+=head1 BUILD ACTIONS
+
+Clownfish::CFC::Perl::Build defines the following build actions.
+
+=head2 code
+
+Build the whole project. The C<code> action searches the C<buildlib>
+directory for .pm files whose path contains the string C<Binding>. For each
+module found, the class method C<bind_all> will be called with a
+L<Clownfish::CFC::Model::Hierarchy> object as argument. This method
+should register all the L<Clownfish::CFC::Binding::Perl::Class> objects
+for which bindings should be generated.
+
+For example, the file C<buildlib/My/Module/Binding.pm> could look like:
+
+    package My::Module::Binding;
+
+    sub bind_all {
+        my ($class, $hierarchy) = @_;
+
+        my $binding = Clownfish::CFC::Binding::Perl::Class->new(
+            parcel     => 'MyModule',
+            class_name => 'My::Module::Class',
+        );
+        Clownfish::CFC::Binding::Perl::Class->register($binding);
+    }
+
+=head2 clownfish
+
+Compile the Clownfish headers and generate code in the C<autogen> directory.
+
+=head2 pod
+
+Generate POD from Clownfish headers.
+
 =head1 CONSTRUCTOR
 
 =head2 new( I<[labeled params]> )
@@ -678,21 +713,5 @@ system include directory. Typically used for additional .h files that the
 Get or set a Clownfish build param. Supports all the parameters that can be
 passed to L</new>.
 
-=head1 BUILD ACTIONS
-
-Clownfish::CFC::Perl::Build defines the following build actions.
-
-=head2 code
-
-Build the whole project.
-
-=head2 clownfish
-
-Compile the Clownfish headers and generate code in the C<autogen> directory.
-
-=head2 pod
-
-Generate POD from Clownfish headers.
-
 =cut