| 1 | package Minilla::Profile::XS; | ||
| 2 | 1 | ▶ | use strict; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 3 | 1 | ▶ | use warnings; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 4 | 1 | ▶ | use utf8; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 5 | 1 | ▶ | use parent qw(Minilla::Profile::ModuleBuild); |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 6 | |||
| 7 | 1 | ▶ | use File::Spec::Functions qw(catfile); |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 8 | 1 | ▶ | use File::Basename qw(dirname); |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 9 | 1 | ▶ | use Data::Section::Simple qw(get_data_section); |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 10 | |||
| 11 | 1 | ▶ | use Minilla::Gitignore; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 12 | 1 | ▶ | use Minilla::Util qw(require_optional); |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 13 | 1 | ▶ | use Minilla::Logger; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 14 | |||
| 15 | 0 | ▶ | sub module_pm_src { |
|
Subroutine
module_pm_src: not called CC=1 SCAR=6.9
Pod
undocumented
| |||
| 16 | 0 | join("\n", | |
| 17 | 'use XSLoader;', | ||
| 18 | 'XSLoader::load(__PACKAGE__, $VERSION);' | ||
| 19 | ); | ||
| 20 | } | ||
| 21 | |||
| 22 | 0 | ▶ | sub generate { |
|
Subroutine
generate: not called CC=1 SCAR=6.9
Pod
undocumented
| |||
| 23 | 0 | my $self = shift; | |
| 24 | |||
| 25 | 0 | require_optional( 'Devel/PPPort.pm', 'PPPort is required for XS support' ); | |
| 26 | |||
| 27 | 0 | $self->render('Module.pm', catfile('lib', $self->path)); | |
| 28 | 0 | $self->render('Module.xs', catfile('lib', dirname($self->path), $self->suffix . '.xs')); | |
| 29 | |||
| 30 | 0 | my $ppport = catfile(dirname(catfile('lib', $self->path)), 'ppport.h'); | |
| 31 | 0 | infof("Writing ppport.h: %s\n", $ppport); | |
| 32 | 0 | Devel::PPPort::WriteFile($ppport); | |
| 33 | |||
| 34 | 0 | $self->render('Changes'); | |
| 35 | 0 | $self->render('t/00_compile.t'); | |
| 36 | 0 | $self->render('t/01_simple.t'); | |
| 37 | 0 | $self->render('github_actions_test.yml', catfile('.github', 'workflows', 'test.yml')); | |
| 38 | |||
| 39 | 0 | $self->render('.gitignore'); | |
| 40 | 0 | my $gi = Minilla::Gitignore->load('.gitignore'); | |
| 41 | 0 | $gi->add(catfile('lib', dirname($self->path), $self->suffix . '.c')); | |
| 42 | 0 | $gi->add("!$ppport"); # Import ppport.h! | |
| 43 | 0 | $gi->save('.gitignore'); | |
| 44 | |||
| 45 | 0 | $self->write_file('LICENSE', Minilla::License::Perl_5->new( | |
| 46 | holder => sprintf('%s <%s>', $self->author, $self->email) | ||
| 47 | )->fulltext); | ||
| 48 | |||
| 49 | 0 | $self->render('cpanfile'); | |
| 50 | } | ||
| 51 | |||
| 52 | 1 | 1; | |
| 53 | __DATA__ | ||