forked from tokuhirom/cpan-outdated
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Build.PL
45 lines (38 loc) · 1.17 KB
/
Build.PL
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
use strict;
use Module::Build;
use File::Basename;
use File::Spec;
use CPAN::Meta;
use CPAN::Meta::Prereqs;
use 5.008;
my $builder = Module::Build->new(
license => 'perl',
dynamic_config => 0,
configure_requires => {
'Module::Build' => 0.40,
},
no_index => { 'directory' => [ 'inc' ] },
name => 'cpan-outdated',
module_name => 'App::cpanoutdated',
script_files => [glob('script/*'), glob('bin/*')],
test_files => ((-d '.git' || $ENV{RELEASE_TESTING}) && -d 'xt') ? 't/ xt/' : 't/',
recursive_test_files => 1,
);
$builder->create_build_script();
my $mbmeta = CPAN::Meta->load_file('MYMETA.json');
my $meta = CPAN::Meta->load_file('META.json');
my $prereqs_hash = CPAN::Meta::Prereqs->new(
$meta->prereqs
)->with_merged_prereqs(
CPAN::Meta::Prereqs->new($mbmeta->prereqs)
)->as_string_hash;
my $mymeta = CPAN::Meta->new(
{
%{$meta->as_struct},
prereqs => $prereqs_hash
}
);
print "Merging cpanfile prereqs to MYMETA.yml\n";
$mymeta->save('MYMETA.yml', { version => 1.4 });
print "Merging cpanfile prereqs to MYMETA.json\n";
$mymeta->save('MYMETA.json', { version => 2 });