-
Notifications
You must be signed in to change notification settings - Fork 34
/
Build.PL
87 lines (77 loc) · 2.42 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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
#!/usr/bin/env perl
# Build script mainly used to run tests.
#
# Do this once, first:
# perl Build.PL
# Then before each commit, run the test for the module
# you altered:
# ./Build test --verbose --test_files t/appropriatetestscript.t
# And if you did something major, run the whole test suite:
# ./Build test
#
# less often, when interested:
# ./Build testcover
# ./Build testpod
# ./Build testpodcoverage
#
# setenv DEVEL_COVER_OPTIONS '+ignore,5.8.8'
# beforehand if coverage includes extraneous stuff
#
use strict;
use warnings;
use lib 'build_lib';
use MyBuild;
my $build = MyBuild->new(
module_name => 'VertRes',
dist_version => 0.04,
dist_author => 'Vertebrate Resequencing group at the Sanger Institute',
dist_abstract => 'A collection of modules and scripts for processing and analysing large quantities of sequencing data.',
license => 'perl',
recursive_test_files => 1,
build_requires => {
'Test::Strict' => 0,
'Test::Most' => 0
},
requires => {
'Filesys::DfPortable' => 0,
'Filesys::DiskUsage' => 0,
'File::Fetch' => 0,
'File::Rsync' => 0,
'File::Temp' => 0,
'Net::FTP::Robust' => 0,
'Time::Format' => 0,
'IO::Capture::Stderr' => 0,
'Math::Random' => 0,
},
pm_files => get_pm_files(),
script_files => 'scripts'
);
$build->create_vrconfig_file();
$build->create_build_script;
exit;
sub get_pm_files {
my %pm_files;
foreach my $module (check_dir('modules')) {
my $in_lib = $module;
$in_lib =~ s/^modules/lib/;
$pm_files{$module} = $in_lib;
}
return \%pm_files;
}
sub check_dir {
my $dir = shift;
opendir(my $dir_handle, $dir);
my @pm_files;
foreach my $thing (readdir($dir_handle)) {
if ($thing =~ /^\.+$/) { next; }
$thing = $dir."/".$thing;
if (-d $thing) {
push(@pm_files, check_dir($thing));
next;
}
if ($thing =~ /\.pm$/) {
push(@pm_files, $thing);
}
}
return @pm_files;
}