Commit | Line | Data |
d5382a2d |
1 | use Module::Build; |
2 | |
3 | use strict; |
4 | |
5 | my $requires = { |
6 | 'perl' => '5.6.0', |
7 | 'Test::More' => 0.01, |
8 | 'XML::Parser' => 0.01, |
9 | 'IO::Scalar' => 0.01, |
10 | 'File::Basename' => 0.01, |
11 | 'Spreadsheet::WriteExcel' => 0.42, |
12 | 'Spreadsheet::WriteExcel::Utility' => 0.01, |
13 | }; |
14 | |
15 | if ($] < 5.008) { |
16 | eval { require Unicode::String; }; |
17 | if ($@) { |
18 | print "Note: If you want to work with Unicode, you will need to install"; |
19 | print "the optional module Unicode::String and set USE_UNICODE to true."; |
20 | my $resp = Module::Build->prompt( "Do you want to install it now?", "y"); |
21 | if ( $resp =~ /y/i ) { |
22 | $requires->{'Unicode::String'} => '0.01'; |
23 | } |
24 | } else { |
25 | print "You have Unicode::String installed. If you warn to use Unicode,"; |
26 | print "You will need to set USE_UNICODE to true." |
27 | } |
28 | } |
29 | |
30 | my $build = Module::Build->new( |
31 | module_name => 'Excel::Template', |
32 | license => 'perl', |
33 | requires => $requires, |
34 | optional => { |
35 | }, |
36 | build_requires => { |
37 | 'File::Path' => '0.01', |
38 | 'File::Temp' => '0.01', |
39 | 'Test::Deep' => '0.095', |
40 | 'Test::More' => '0.47', |
41 | 'Test::Exception' => '0.21', |
42 | }, |
43 | create_makefile_pl => 'traditional', |
44 | add_to_cleanup => [ |
45 | 'META.yml', '*.bak', '*.gz', 'Makefile.PL', 'cover_db', |
46 | ], |
47 | # test_files => 't/??_*.t', |
48 | ); |
49 | |
50 | $build->create_build_script; |