| 1 | use 5.006; | ||
| 2 | use strict; | ||
| 3 | use warnings; | ||
| 4 | use Module::Build; | ||
| 5 | |||
| 6 | my $sub = <<'END_SUBS'; | ||
| 7 | use Carp; | ||
| 8 | |||
| 9 | sub ACTION_steps { | ||
| 10 | print <<"END_TS"; | ||
| 11 | perl build.pl | ||
| 12 | build test | ||
| 13 | build distcheck | ||
| 14 | build dist | ||
| 15 | build git | ||
| 16 | or build all | ||
| 17 | END_TS | ||
| 18 | |||
| 19 | } | ||
| 20 | |||
| 21 | sub ACTION_all { | ||
| 22 | print `perl build.pl`; | ||
| 23 | # SET RELEASE_TESTING=1 & build test | ||
| 24 | print map {`build $_`} qw(test distcheck dist git); | ||
| 25 | |||
| 26 | print 'git push (using GitGui)'; | ||
| 27 | print 'cpan upload (pause.perl.org)'; | ||
| 28 | } | ||
| 29 | |||
| 30 | sub ACTION_CPAN { | ||
| 31 | my $mod = 'Excel::Template::XLSX'; | ||
| 32 | (my $path = $mod) =~ s|::|/|g; | ||
| 33 | my $ver = eval qq{require 'lib/${path}.pm'; \$${mod}::VERSION}; | ||
| 34 | (my $tar = $mod) =~ s|::|\-|g; | ||
| 35 | $tar = "${tar}-${ver}.tar.gz"; | ||
| 36 | # use CPAN::Uploader; | ||
| 37 | # my $config = CPAN::Uploader->read_config_file(); | ||
| 38 | # $config->{debug} = 1; | ||
| 39 | # CPAN::Uploader->upload_file($tar, $config); | ||
| 40 | # # Does not work - gets 401 auth required | ||
| 41 | } | ||
| 42 | |||
| 43 | sub ACTION_git { | ||
| 44 | my $result; | ||
| 45 | $result = `git add lib\*.pm lib\*\*.pm lib\*\*\*.pm lib\*\*\*\*.pm `; | ||
| 46 | $result .= `git add Changes build.pl MANIFEST MANIFEST.SKIP`; | ||
| 47 | $result .= `git add build.pl `; | ||
| 48 | $result .= `git status -s`; | ||
| 49 | print $result; | ||
| 50 | } | ||
| 51 | |||
| 52 | END_SUBS | ||
| 53 | |||
| 54 | my $class = Module::Build->subclass( class => 'Build_with_Zip', code => $sub ); | ||
| 55 | |||
| 56 | my $builder = $class->new( | ||
| 57 | module_name => 'Excel::Template::XLSX', | ||
| 58 | license => 'perl', | ||
| 59 | dist_author => q{Dave Clarke <dclarke@cpan.org>}, | ||
| 60 | dist_version_from => 'lib/Excel/Template/XLSX.pm', | ||
| 61 | dist_abstract => q[ | ||
| 62 | Re-creates Excel (.xlsx) files from a template. Excel | ||
| 63 | content can be appended using Excel::Writer::XLSX. ], | ||
| 64 | |||
| 65 | build_requires => { | ||
| 66 | 'Test::More' => 0, | ||
| 67 | 'Test::Differences' => 0, | ||
| 68 | 'Test::CheckManifest' => 1.29, | ||
| 69 | 'Template::Tiny' => 0, | ||
| 70 | }, | ||
| 71 | |||
| 72 | configure_requires => { 'Module::Build' => 0.4, }, | ||
| 73 | |||
| 74 | requires => { | ||
| 75 | 'perl' => '5.12.0', | ||
| 76 | 'Excel::Writer::XLSX' => 0.90, | ||
| 77 | 'Archive::Zip' => 0, | ||
| 78 | 'Graphics::ColorUtils' => 0, | ||
| 79 | 'Scalar::Util' => 0, | ||
| 80 | 'XML::Twig' => 0, | ||
| 81 | }, | ||
| 82 | add_to_cleanup => [qw(Excel-Template-XLSX-* *.zip *.pui *.prj make.bat)], | ||
| 83 | create_makefile_pl => 'traditional', | ||
| 84 | |||
| 85 | ); | ||
| 86 | |||
| 87 | $builder->create_build_script(); |