view release on metacpan or search on metacpan
VERSION_FROM => 'lib/Some/Module.pm',
);
With no import arguments, ASPEER::MakeMaker enables the const_config,
depend, postamble, and post_initialize hooks. A caller may also request
additional sections explicitly:
use ASPEER::MakeMaker qw(const_config postamble);
The generated postamble dispatches make targets back into the module
through a MakeMaker-generated command using the global PERLRUN value.
Local include paths are quoted for the platform shell. The target method
receives a fixed MakeMaker argument block first, followed by any
target-specific arguments.
The Makefile retains any existing dependencies and also depends on
VERSION_FROM. License metadata is enriched when both LICENSE and AUTHOR
are supplied, but neither field is mandatory.
During post-initialization, documentation and temporary source files are
removed from the install map. If Git and VERSION_FROM are available, a
With no import arguments, `ASPEER::MakeMaker` enables the `const_config`,
`depend`, `postamble`, and `post_initialize` hooks. A caller may also request
additional sections explicitly:
```perl
use ASPEER::MakeMaker qw(const_config postamble);
```
The generated postamble dispatches make targets back into the module through a
MakeMaker-generated command using the global `PERLRUN` value. Local include
paths are quoted for the platform shell. The target method receives a fixed
MakeMaker argument block first, followed by any target-specific arguments.
The Makefile retains any existing dependencies and also depends on
`VERSION_FROM`. License metadata is enriched when both `LICENSE` and `AUTHOR`
are supplied, but neither field is mandatory.
During post-initialization, documentation and temporary source files are
removed from the install map. If Git and `VERSION_FROM` are available, a
matching `.sha` provenance file is updated only when its content changes and is
lib/ASPEER/MakeMaker/MM/Constant.pm view on Meta::CPAN
"$(EXE_FILES)"
"$(DIST_DEFAULT_TARGET)"
"$(SUFFIX)"
"$(ABSTRACT_FROM)"
]),
# Local constants override anything above
#
%{do($local_fn) || {}},
%{do(my($fn)=glob(sprintf('~/.%s.local', __PACKAGE__))) || {}} # || {} avoids warning
);
# Export constants to namespace, place in export tags
#
require Exporter;
@ISA=qw(Exporter);
{
no warnings qw(once);
lib/ASPEER/MakeMaker/MM/Import.pm view on Meta::CPAN
macro.
It publishes supplied license metadata:
- copies `LICENSE` and the first `AUTHOR` into the macro table when supplied
- uses `Software::LicenseUtils` to resolve the license when both are supplied
- writes the resulting URL into `META_MERGE.resources.license`
Neither `LICENSE` nor `AUTHOR` is required by this helper.
The method then installs a global `PERLRUN` command which preserves loaded
MakeMaker extensions and local include paths. Include arguments are quoted
through the active MakeMaker implementation. It also stores `DIST_DEFAULT` in
the `DIST_DEFAULT_TARGET` macro.
### depend
```perl
ASPEER::MakeMaker::MM::Import::depend($hook, $mm, @args);
```
lib/ASPEER/MakeMaker/MM/Import.pm view on Meta::CPAN
```perl
ASPEER::MakeMaker::MM::Import::postamble($hook, $mm, @args);
```
Calls the original MakeMaker `postamble`, then appends the template named by
`TEMPLATE_POSTAMBLE_FN` in the importing class's `MM::Constant` package.
The module uses `MM_PREFIX` from the importing class's `MM::Constant` package
when naming its command macro. If it is absent, the class name is uppercased
and `::` is replaced with `_`. MakeMaker's `oneliner` method generates the
platform-specific Perl command. The command deliberately uses the global
`PERLRUN` macro so the same extension environment is available to generated
targets, then explicitly reloads the dispatch module belonging to this prefix.
This keeps the target callable when a subsequently loaded extension replaces
the shared `PERLRUN` value.
The parent class's bundled template is:
```text
lib/ASPEER/MakeMaker/MM/postamble.inc
```
lib/ASPEER/MakeMaker/MM/Import.pm view on Meta::CPAN
=item -
writes the resulting URL into C<META_MERGE.resources.license>
=back
Neither C<LICENSE> nor C<AUTHOR> is required by this helper.
The method then installs a global C<PERLRUN> command which preserves loaded
MakeMaker extensions and local include paths. Include arguments are quoted
through the active MakeMaker implementation. It also stores C<DIST_DEFAULT> in
the C<DIST_DEFAULT_TARGET> macro.
=head3 depend
ASPEER::MakeMaker::MM::Import::depend($hook, $mm, @args);
Calls the original MakeMaker C<depend> section. When C<VERSION_FROM> is set, it
lib/ASPEER/MakeMaker/MM/Import.pm view on Meta::CPAN
=head3 postamble
ASPEER::MakeMaker::MM::Import::postamble($hook, $mm, @args);
Calls the original MakeMaker C<postamble>, then appends the template named by
C<TEMPLATE_POSTAMBLE_FN> in the importing class's C<MM::Constant> package.
The module uses C<MM_PREFIX> from the importing class's C<MM::Constant> package
when naming its command macro. If it is absent, the class name is uppercased
and C<::> is replaced with C<_>. MakeMaker's C<oneliner> method generates the
platform-specific Perl command. The command deliberately uses the global
C<PERLRUN> macro so the same extension environment is available to generated
targets, then explicitly reloads the dispatch module belonging to this prefix.
This keeps the target callable when a subsequently loaded extension replaces
the shared C<PERLRUN> value.
The parent class's bundled template is:
lib/ASPEER/MakeMaker/MM/postamble.inc
lib/ASPEER/MakeMaker/MM/Import.pm.md view on Meta::CPAN
macro.
It publishes supplied license metadata:
- copies `LICENSE` and the first `AUTHOR` into the macro table when supplied
- uses `Software::LicenseUtils` to resolve the license when both are supplied
- writes the resulting URL into `META_MERGE.resources.license`
Neither `LICENSE` nor `AUTHOR` is required by this helper.
The method then installs a global `PERLRUN` command which preserves loaded
MakeMaker extensions and local include paths. Include arguments are quoted
through the active MakeMaker implementation. It also stores `DIST_DEFAULT` in
the `DIST_DEFAULT_TARGET` macro.
### depend
```perl
ASPEER::MakeMaker::MM::Import::depend($hook, $mm, @args);
```
lib/ASPEER/MakeMaker/MM/Import.pm.md view on Meta::CPAN
```perl
ASPEER::MakeMaker::MM::Import::postamble($hook, $mm, @args);
```
Calls the original MakeMaker `postamble`, then appends the template named by
`TEMPLATE_POSTAMBLE_FN` in the importing class's `MM::Constant` package.
The module uses `MM_PREFIX` from the importing class's `MM::Constant` package
when naming its command macro. If it is absent, the class name is uppercased
and `::` is replaced with `_`. MakeMaker's `oneliner` method generates the
platform-specific Perl command. The command deliberately uses the global
`PERLRUN` macro so the same extension environment is available to generated
targets, then explicitly reloads the dispatch module belonging to this prefix.
This keeps the target callable when a subsequently loaded extension replaces
the shared `PERLRUN` value.
The parent class's bundled template is:
```text
lib/ASPEER/MakeMaker/MM/postamble.inc
```
lib/ASPEER/MakeMaker/MM/Util.pm view on Meta::CPAN
- `TO_INST_PM_AR` from whitespace-splitting `TO_INST_PM`
- `EXE_FILES_AR` from whitespace-splitting `EXE_FILES`
### perlrun
```perl
my $command = perlrun($hook_object, $make_maker_object);
```
Builds the global Makefile `PERLRUN` command beginning with `$(PERL)`. It
includes non-default local `@INC` directories as `-I` options, loaded
`ExtUtils::*` modules as `-M` options, and the registered MakeMaker extension
classes in activation order. Modules are emitted once. When supplied, the
active MakeMaker object quotes `-I` arguments for the platform shell.
This value is installed into MakeMaker's `PERLRUN` macro by
`ASPEER::MakeMaker::MM::Import::const_config` and is reused by generated
targets.
## Usage Conventions
lib/ASPEER/MakeMaker/MM/Util.pm view on Meta::CPAN
C<EXE_FILES_AR> from whitespace-splitting C<EXE_FILES>
=back
=head3 perlrun
my $command = perlrun($hook_object, $make_maker_object);
Builds the global Makefile C<PERLRUN> command beginning with C<$(PERL)>. It
includes non-default local C<@INC> directories as C<-I> options, loaded
C<ExtUtils::*> modules as C<-M> options, and the registered MakeMaker extension
classes in activation order. Modules are emitted once. When supplied, the
active MakeMaker object quotes C<-I> arguments for the platform shell.
This value is installed into MakeMaker's C<PERLRUN> macro by
C<ASPEER::MakeMaker::MM::Import::const_config> and is reused by generated
targets.
lib/ASPEER/MakeMaker/MM/Util.pm.md view on Meta::CPAN
- `TO_INST_PM_AR` from whitespace-splitting `TO_INST_PM`
- `EXE_FILES_AR` from whitespace-splitting `EXE_FILES`
### perlrun
```perl
my $command = perlrun($hook_object, $make_maker_object);
```
Builds the global Makefile `PERLRUN` command beginning with `$(PERL)`. It
includes non-default local `@INC` directories as `-I` options, loaded
`ExtUtils::*` modules as `-M` options, and the registered MakeMaker extension
classes in activation order. Modules are emitted once. When supplied, the
active MakeMaker object quotes `-I` arguments for the platform shell.
This value is installed into MakeMaker's `PERLRUN` macro by
`ASPEER::MakeMaker::MM::Import::const_config` and is reused by generated
targets.
## Usage Conventions
t/02-mm-integration.t view on Meta::CPAN
# Generate the Makefile through command-line activation
#
local $ENV{'PERL5LIB'}=join(
$Config{'path_sep'},
grep {defined($_) && length($_)} ($common_lib_dn, $ENV{'PERL5LIB'})
);
is(system($^X, "-I$local_lib_dn", '-MASPEER::MakeMaker', 'Makefile.PL'), 0,
'Makefile.PL succeeds with command-line import');
my $makefile=slurp('Makefile');
like($makefile, qr/^PERLRUN\s*=.*-MASPEER::MakeMaker/m,
'global PERLRUN reloads the MakeMaker integration');
like($makefile, qr/^PERLRUN\s*=.*-MExtUtils::MakeMaker/m,
'global PERLRUN retains loaded MakeMaker modules');
like($makefile, qr/(?:'-I[^']*local lib'|"-I[^"]*local lib")/,
'global PERLRUN quotes include paths containing spaces');
like($makefile, qr/^Makefile\s*:\s*\$\(VERSION_FROM\)$/m,
'Makefile depends on VERSION_FROM');
like($makefile, qr/^generated\.out\s*:\s*generated\.in$/m,
'existing Makefile dependencies are retained');
like($makefile,
qr/^ASPEER_MAKEMAKER_PM_TARGET=\$\(PERLRUN\) -M\$\(ASPEER_MAKEMAKER_PM\).*\s-e\s/m,
'target command explicitly reloads its dispatch module');
like($makefile,
qr/^\s*\@\$\(ASPEER_MAKEMAKER_PM_TARGET\) util_sync \$\(UPDATE_SOURCE_UTIL_FN\)$/m,
'util_sync target passes its method explicitly');
unlike($makefile, qr/^MM_PREFIX\s*=/m,
'private macro prefix configuration is not emitted');
my ($perlrun)=($makefile=~/^(PERLRUN\s*=.*)$/m);
my @common_import=($perlrun=~/-MASPEER::MakeMaker(?==|\s|$)/g);
is(scalar(@common_import), 1,
'global PERLRUN contains the active extension once');
unlike($makefile, qr/(?:gherkin|foobar|serfin)/,
'generated Makefile contains no demonstration targets');
like($makefile, qr/^EXE_FILES\s*=\s*bin\/sample\.pl$/m,
'executable retains its declared filename');
ok(!-e 'bin/sample', 'extensionless executable is not created implicitly');
unlike($makefile, qr/lib\/Sample\.pm\.(?:md|new|1)\s+blib\//,
'documentation and temporary sidecars are excluded from install map');
like($makefile, qr/'LICENSE'\s+'\$\(INST_LIBDIR\)/,
'license file is included in install map');
like(slurp('MYMETA.json'), qr/"license"\s*:\s*\[/,