Skip to content

Commit

Permalink
Merge pull request #84 from gfx/patch
Browse files Browse the repository at this point in the history
minor patches
  • Loading branch information
skaji committed Jan 7, 2018
2 parents 5a53058 + 4b6d8e4 commit fe21189
Show file tree
Hide file tree
Showing 5 changed files with 32 additions and 64 deletions.
17 changes: 0 additions & 17 deletions MANIFEST.SKIP

This file was deleted.

64 changes: 25 additions & 39 deletions builder/MyBuilder.pm
Original file line number Diff line number Diff line change
@@ -1,62 +1,51 @@
package builder::MyBuilder;
use strict;
use warnings;
use utf8;
use 5.008_005;
use base qw(Module::Build::XSUtil);

sub new {
my ($class, %args) = @_;

$class->SUPER::new(
%args,
conflicts => {
'Any::Moose', '< 0.10',
'MouseX::AttributeHelpers', '< 0.06',
'MouseX::NativeTraits', '< 1.00',
},
generate_ppport_h => 'ppport.h',
generate_xshelper_h => 'xshelper.h',
xs_files => {
'xs-src/Mouse.xs' => 'lib/Mouse.xs',
},
c_source => [
'xs-src'
],
include_dirs => ['.'],
c_source => [ 'xs-src' ],
generate_ppport_h => 'xs-src/ppport.h',
generate_xshelper_h => 'xs-src/xshelper.h',
xs_files => { 'xs-src/Mouse.xs' => 'lib/Mouse.xs' },
);
}

sub ACTION_code {
my ($self) = @_;

system($^X, 'tool/generate-mouse-tiny.pl', 'lib/Mouse/Tiny.pm') == 0
or warn "Cannot generate Mouse::Tiny: $!";
my ($self, @args) = @_;

open my $fh, '>', 'xs-src/xs_version.h';
print {$fh} "#ifndef XS_VERSION\n";
printf {$fh} "#define XS_VERSION \"%s\"\n", $self->dist_version;
print {$fh} "#endif\n";
close($fh);
$self->run_perl_script('tool/generate-mouse-tiny.pl', [], ['lib/Mouse/Tiny.pm']) or die;

unless ($self->pureperl_only) {
for my $xs (qw(
if (!$self->pureperl_only) {
$self->_write_xs_version;
my @xs = qw(
xs-src/MouseAccessor.xs
xs-src/MouseAttribute.xs
xs-src/MouseTypeConstraints.xs
xs-src/MouseUtil.xs
)) {
);
for my $xs (@xs) {
(my $c = $xs) =~ s/\.xs\z/.c/;
next if $self->up_to_date($xs, $c);
$self->compile_xs($xs, outfile => $c);
}
}
$self->SUPER::ACTION_code(@args);
}

$self->SUPER::ACTION_code();
sub _write_xs_version {
my $self = shift;
open my $fh, '>', 'xs-src/xs_version.h' or die;
print {$fh} "#ifndef XS_VERSION\n";
printf {$fh} "#define XS_VERSION \"%s\"\n", $self->dist_version;
print {$fh} "#endif\n";
}

sub ACTION_test {
my ($self) = @_;
my ($self, @args) = @_;

if ($ENV{COMPAT_TEST}) {
$self->depends_on('moose_compat_test');
Expand All @@ -65,23 +54,20 @@ sub ACTION_test {
if (!$self->pureperl_only) {
local $ENV{MOUSE_XS} = 1;
$self->log_info("xs tests.\n");
$self->SUPER::ACTION_test();
$self->SUPER::ACTION_test(@args);
}

{
local $ENV{PERL_ONLY} = 1;
$self->log_info("pureperl tests.\n");
$self->SUPER::ACTION_test();
$self->SUPER::ACTION_test(@args);
}
}

sub ACTION_moose_compat_test {
my $class = shift;

$class->depends_on('code');

system($^X, 'tool/create-moose-compatibility-tests.pl')
== 0 or warn "tool/create-moose-compatibility-tests.pl: $!";
my $self = shift;
$self->depends_on('code');
$self->run_perl_script('tool/create-moose-compatibility-tests.pl') or die;
}

1;
11 changes: 4 additions & 7 deletions cpanfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ requires 'Scalar::Util', '1.14';

requires 'XSLoader', '0.02';

conflicts 'Any::Moose', '< 0.10';
conflicts 'MouseX::AttributeHelpers', '< 0.06';
conflicts 'MouseX::NativeTraits', '< 1.00';

on configure => sub {
requires 'Devel::PPPort', '3.33';
requires 'ExtUtils::ParseXS', '3.22';
Expand All @@ -16,8 +20,6 @@ on configure => sub {

on 'test' => sub {
requires 'Test::More', '0.88';

# Comes from author/cpanm.requires
requires 'Test::Exception';
requires 'Test::Fatal';
requires 'Test::LeakTrace';
Expand All @@ -27,11 +29,8 @@ on 'test' => sub {
};

on 'develop' => sub {
# author's tests
requires 'Test::Pod::Coverage';
requires 'Test::DependentModules';

# required by recipes and examples
suggests 'Regexp::Common';
suggests 'Locale::US';
suggests 'HTTP::Headers';
Expand All @@ -41,5 +40,3 @@ on 'develop' => sub {
suggests 'Test::Deep';
suggests 'IO::String';
};


4 changes: 3 additions & 1 deletion minil.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name = "Mouse"
badges = ["travis"]
allow_pureperl=1
allow_pureperl = 1
module_maker = "ModuleBuild"

[build]
Expand All @@ -12,3 +12,5 @@ directory = ["t", "xt", "tool", "author", "example", "benchmarks", "builder"]
[ReleaseTest]
MinimumVersion = false

[FileGatherer]
exclude_match = ["^Moose-t-failing", "^xt", "^author", "^TODO$"]
File renamed without changes.

0 comments on commit fe21189

Please sign in to comment.