App-Tel
view release on metacpan or search on metacpan
local/lib/perl5/Module/Build/API.pod view on Meta::CPAN
=item C<check>
A code reference that checks that a value specified for the property is valid.
During the execution of the code reference, the new value will be included in
the C<$_> variable. If the value is correct, the C<check> code reference
should return true. If the value is not correct, it sends an error message to
C<property_error()> and returns false.
=back
When this method is called, a new property will be installed in the
Module::Build class, and an accessor will be built to allow the property to be
get or set on the build object.
print $build->pedantic, $/;
$build->pedantic(0);
If the default value is a hash reference, this generates a special-case
accessor method, wherein individual key/value pairs may be set or fetched:
print "stuff{foo} is: ", $build->stuff( 'foo' ), $/;
$build->stuff( foo => 'bar' );
print $build->stuff( 'foo' ), $/; # Outputs "bar"
Of course, you can still set the entire hash reference at once, as well:
$build->stuff( { foo => 'bar', baz => 'yo' } );
In either case, if a C<check> has been specified for the property, it will be
applied to the entire hash. So the check code reference should look something
like:
check => sub {
return 1 if defined $_ && exists $_->{foo};
shift->property_error(qq{Property "stuff" needs "foo"});
return 0;
},
=item property_error
[version 0.31]
=back
=head2 METHODS
=over 4
=item add_build_element($type)
[version 0.26]
Adds a new type of entry to the build process. Accepts a single
string specifying its type-name. There must also be a method defined
to process things of that type, e.g. if you add a build element called
C<'foo'>, then you must also define a method called
C<process_foo_files()>.
See also
L<Module::Build::Cookbook/"Adding new file types to the build process">.
=item add_to_cleanup(@files)
[version 0.03]
You may call C<< $self->add_to_cleanup(@patterns) >> to tell
C<Module::Build> that certain files should be removed when the user
performs the C<Build clean> action. The arguments to the method are
patterns suitable for passing to Perl's C<glob()> function, specified
in either Unix format or the current machine's native format. It's
usually convenient to use Unix format when you hard-code the filenames
(e.g. in F<Build.PL>) and the native format when the names are
programmatically generated (e.g. in a testing script).
I decided to provide a dynamic method of the C<$build> object, rather
than just use a static list of files named in the F<Build.PL>, because
these static lists can get difficult to manage. I usually prefer to
keep the responsibility for registering temporary files close to the
code that creates them.
=item args()
[version 0.26]
my $args_href = $build->args;
my %args = $build->args;
my $arg_value = $build->args($key);
$build->args($key, $value);
This method is the preferred interface for retrieving the arguments passed via
command line options to F<Build.PL> or F<Build>, minus the Module-Build
specific options.
When called in a scalar context with no arguments, this method returns a
reference to the hash storing all of the arguments; in an array context, it
returns the hash itself. When passed a single argument, it returns the value
stored in the args hash for that option key. When called with two arguments,
the second argument is assigned to the args hash under the key passed as the
first argument.
=item autosplit_file($from, $to)
[version 0.28]
Invokes the L<AutoSplit> module on the C<$from> file, sending the
output to the C<lib/auto> directory inside C<$to>. C<$to> is
typically the C<blib/> directory.
=item base_dir()
[version 0.14]
Returns a string containing the root-level directory of this build,
i.e. where the C<Build.PL> script and the C<lib> directory can be
found. This is usually the same as the current working directory,
because the C<Build> script will C<chdir()> into this directory as
soon as it begins execution.
=item build_requires()
local/lib/perl5/Module/Build/API.pod view on Meta::CPAN
=item scripts()
=item sign()
=item tap_harness_args()
=item test_file_exts()
=item test_requires()
=item use_rcfile()
=item use_tap_harness()
=item verbose()
=item xs_files()
=back
=head1 MODULE METADATA
If you would like to add other useful metadata, C<Module::Build>
supports this with the C<meta_add> and C<meta_merge> arguments to
L</new()>. The authoritative list of supported metadata can be found at
L<CPAN::Meta::Spec> but for convenience - here are a few of the more useful ones:
=over 4
=item keywords
For describing the distribution using keyword (or "tags") in order to
make CPAN.org indexing and search more efficient and useful.
=item resources
A list of additional resources available for users of the
distribution. This can include links to a homepage on the web, a
bug tracker, the repository location, and even a subscription page for the
distribution mailing list.
=back
=head1 AUTHOR
Ken Williams <kwilliams@cpan.org>
=head1 COPYRIGHT
Copyright (c) 2001-2006 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.
=head1 SEE ALSO
perl(1), L<Module::Build>(3), L<Module::Build::Authoring>(3),
L<Module::Build::Cookbook>(3), L<ExtUtils::MakeMaker>(3)
F<META.yml> Specification:
L<CPAN::Meta::Spec>
=cut
( run in 0.539 second using v1.01-cache-2.11-cpan-39bf76dae61 )