use inc::Module::Install;

name 'MooseX-MakeImmutable';
all_from 'lib/MooseX/MakeImmutable.pm';

resources repository => 'http://github.com/robertkrimen/moosex-makeimmutable/tree/master';

{
    require ExtUtils::MakeMaker;
    use strict;
    no strict 'refs';

    my $libscan = \&{"ExtUtils::MM_Any::libscan"};
    *{"ExtUtils::MM_Any::libscan"} = sub {
        return '' unless $libscan->(@_);
        return '' if $_[1] =~ /\.sw[p-z]$/;
        return $_[1];
    };
}

{
    map { my ($pk, $vr) = split m/\s/; build_requires $pk => $vr || 0 } grep { ! /^\s*#/ } split m/\n/, <<_END_;
Test::Most
_END_

    map { my ($pk, $vr) = split m/\s/; requires $pk => $vr || 0 } grep { ! /^\s*#/ } split m/\n/, <<_END_;
Carp::Clan
Class::Inspector
Module::Pluggable 3.8
Devel::InnerPackage
List::MoreUtils
Moose
Scalar::Util
_END_
}

auto_install;

WriteAll;