Skip to content

Commit

Permalink
CPAN Release 0.02
Browse files Browse the repository at this point in the history
- First working version
- Handles Inline compilation and distdir
- autostub not working
  • Loading branch information
ingydotnet committed Dec 17, 2014
1 parent a5233cf commit 0ac8f0a
Show file tree
Hide file tree
Showing 5 changed files with 55 additions and 15 deletions.
9 changes: 4 additions & 5 deletions .travis.yml
@@ -1,6 +1,6 @@
# DO NOT EDIT
#
# This .travis.yml file generated by Zilla-Dist-0.0.174.
# This .travis.yml file generated by Zilla-Dist-0.0.176.
#
# To update it, run:
#
Expand All @@ -22,14 +22,13 @@ install:
- cpanm --quiet --notest
Devel::Cover::Report::Coveralls
Inline::Module
Module::build
Module::Build

script:
- test -e test &&
- true && [ ! -e test/ ] ||
PERL5OPT=-MDevel::Cover=-coverage,statement,branch,condition,path,subroutine
prove -lv test/
|| true
- test -e test && cover || true
- true && [ ! -e test/ ] || cover

after_success:
- cover -report coveralls
Expand Down
3 changes: 2 additions & 1 deletion About
Expand Up @@ -66,6 +66,7 @@ This repoository contains the following top level files and directories:
doc/ - Documentation directory.
.git/ - Git repository data.
lib/ - All the source code libraries (modules).
note/ - Random note files. To-Do lists, specs, etc.

Resources
---------
Expand All @@ -89,4 +90,4 @@ for up-to-date instructions.



# This file generated by Zilla-Dist-0.0.174
# This file generated by Zilla-Dist-0.0.176
7 changes: 7 additions & 0 deletions Changes
@@ -1,4 +1,11 @@
---
version: 0.02
date: Wed Dec 17 15:06:29 PST 2014
changes:
- First working version
- Handles Inline compilation and distdir
- autostub not working
---
version: 0.01
date: Mon Dec 15 22:48:52 EST 2014
changes:
Expand Down
2 changes: 1 addition & 1 deletion Meta
@@ -1,7 +1,7 @@
=meta: 0.0.2

name: Module-Build-InlineModule
version: 0.01
version: 0.02
abstract: Module::Build Support for Inline::Module
homepage: https://metacpan.org/release/Module-Build-InlineModule
language: perl
Expand Down
49 changes: 41 additions & 8 deletions lib/Module/Build/InlineModule.pm
@@ -1,26 +1,59 @@
use strict; use warnings;
package Module::Build::InlineModule;
our $VERSION = '0.01';
our $VERSION = '0.02';

use base 'Module::Build';
__PACKAGE__->add_property('inline');

use Inline::Module();

use XXX;

sub ACTION_code {
my $self = shift;
$self->SUPER::ACTION_code(@_);
my $module = $self->{properties}{inline}{module};
print "$module\n";
my $inline = $self->get_inline;
my @inc = @INC;
local @INC = ('lib', @inc);
eval "require $module; 1" or die $@;
local @INC = (
(-e 'inc' ? ('inc') : ()),
'lib',
@inc,
);
for my $module (@{$inline->{module}}) {
eval "require $module; 1" or die $@;
}
Inline::Module->handle_fixblib;
}

sub ACTION_distdir {
XXX "ACTION_distdir", @_;
my $self = shift;
$self->SUPER::ACTION_distdir(@_);
my $distdir = $self->dist_dir;
my $inline = $self->get_inline;

my $inline_module = Inline::Module->new(%$inline);
my $stub_modules = $inline->{stub};
my @included_modules = $inline_module->included_modules;

Inline::Module->handle_distdir(
$distdir,
@$stub_modules,
'--',
@included_modules,
);
}

# Replace this with call to Inline::Module
sub get_inline {
my $self = shift;
my $inline = $self->{properties}{inline}
or die "Missing Module::Build property: 'inline'";
$inline->{module} or die
"Module::Build::InlineModule property 'inline' missing key 'module'";
$inline->{module} = [$inline->{module}] unless ref $inline->{module};
$inline->{stub} ||= [ map "${_}::Inline", @{$inline->{module}} ];
$inline->{stub} = [$inline->{stub}] unless ref $inline->{stub};
$inline->{ilsm} ||= 'Inline::C';
$inline->{ilsm} = [$inline->{ilsm}] unless ref $inline->{ilsm};
return $inline;
}

1;

0 comments on commit 0ac8f0a

Please sign in to comment.