summaryrefslogtreecommitdiffstats
path: root/inc/MakeMaker.pm
diff options
context:
space:
mode:
authorJesse Luehrs <doy@tozt.net>2013-08-01 11:06:44 -0400
committerJesse Luehrs <doy@tozt.net>2013-08-01 11:09:31 -0400
commit5ceef90c2388f73c0de979cd19cb3ff5060ecb66 (patch)
treedaaa7a99bee3019ebb0ed0aafebd141b61afb247 /inc/MakeMaker.pm
parentea99455a19e79bbededbd31a5cb56ffc1f738845 (diff)
downloadparse-keyword-5ceef90c2388f73c0de979cd19cb3ff5060ecb66.tar.gz
parse-keyword-5ceef90c2388f73c0de979cd19cb3ff5060ecb66.zip
refactor this to make it easier to modify
Diffstat (limited to 'inc/MakeMaker.pm')
-rw-r--r--inc/MakeMaker.pm19
1 files changed, 6 insertions, 13 deletions
diff --git a/inc/MakeMaker.pm b/inc/MakeMaker.pm
index 25cbf7e..bb31600 100644
--- a/inc/MakeMaker.pm
+++ b/inc/MakeMaker.pm
@@ -1,5 +1,6 @@
package inc::MakeMaker;
use Moose;
+use inc::MMHelper;
extends 'Dist::Zilla::Plugin::MakeMaker::Awesome';
@@ -7,15 +8,7 @@ around _build_MakeFile_PL_template => sub {
my $orig = shift;
my $self = shift;
my $tmpl = $self->$orig;
- my $extra = <<'EXTRA';
-use Config;
-use Devel::CallParser 'callparser1_h', 'callparser_linkable';
-open my $fh, '>', 'callparser1.h' or die "Couldn't write to callparser1.h";
-$fh->print(callparser1_h);
-my @linkable = callparser_linkable;
-unshift @linkable, "Keyword$Config{obj_ext}" if @linkable;
-$WriteMakefileArgs{OBJECT} = join(' ', @linkable) if @linkable;
-EXTRA
+ my $extra = inc::MMHelper::makefile_pl_extra;
$tmpl =~ s/^(WriteMakefile\()/$extra\n$1/m
or die "Couldn't fix template";
return $tmpl;
@@ -25,10 +18,10 @@ around _build_WriteMakefile_args => sub {
my $orig = shift;
my $self = shift;
my $args = $self->$orig(@_);
- $args->{clean} = {
- FILES => "callparser1.h",
- };
- return $args;
+ return {
+ %$args,
+ %{ inc::MMHelper::mm_args() },
+ }
};
__PACKAGE__->meta->make_immutable;