| 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 cpan); | ||
| 25 | print 'git push (using GitGui)'; | ||
| 26 | } | ||
| 27 | |||
| 28 | sub ACTION_cpan { | ||
| 29 | my $mod = 'Excel::Template::XLSX'; | ||
| 30 | (my $path = $mod) =~ s|::|/|g; | ||
| 31 | my $ver = eval qq{use $mod; \$${mod}::VERSION}; | ||
| 32 | (my $tgz = $mod) =~ s|::|\-|g; | ||
| 33 | $tgz = "${tgz}-${ver}.tar.gz"; | ||
| 34 | use CPAN::Uploader; | ||
| 35 | my $config = CPAN::Uploader->read_config_file(); | ||
| 36 | CPAN::Uploader->upload_file($tgz, $config); | ||
| 37 | # print STDOUT `cpan-upload -u $ARGV[1] -p $ARGV[2] $tgz`; # add --dry-run option if needed | ||
| 38 | # `mojo cpanify -u sri -p secr3t $tgz`; | ||
| 39 | } | ||
| 40 | |||
| 41 | sub ACTION_git { | ||
| 42 | my $result; | ||
| 43 | $result = `git add lib\*.pm lib\*\*.pm lib\*\*\*.pm lib\*\*\*\*.pm `; | ||
| 44 | $result .= `git add Changes build.pl MANIFEST MANIFEST.SKIP`; | ||
| 45 | $result .= `git add build.pl `; | ||
| 46 | $result .= `git status -s`; | ||
| 47 | print $result; | ||
| 48 | } | ||
| 49 | |||
| 50 | END_SUBS | ||
| 51 | |||
| 52 | my $class = Module::Build->subclass( class => 'Build_with_Zip', code => $sub ); | ||
| 53 | |||
| 54 | my $builder = $class->new( | ||
| 55 | module_name => 'Excel::Template::XLSX', | ||
| 56 | license => 'perl', | ||
| 57 | dist_author => q{Dave Clarke <dclarke@cpan.org>}, | ||
| 58 | dist_version_from => 'lib/Excel/Template/XLSX.pm', | ||
| 59 | dist_abstract => q[ | ||
| 60 | Re-creates Excel (.xlsx) files from a template. Excel | ||
| 61 | content can be appended using Excel::Writer::XLSX. ], | ||
| 62 | |||
| 63 | build_requires => { | ||
| 64 | 'Test::More' => 0, | ||
| 65 | 'Test::Differences' => 0, | ||
| 66 | 'Test::CheckManifest' => 1.29, | ||
| 67 | 'Template::Tiny' => 0, | ||
| 68 | }, | ||
| 69 | |||
| 70 | configure_requires => { | ||
| 71 | 'Module::Build' => 0.4, | ||
| 72 | 'CPAN::Uploader' => 0.1, | ||
| 73 | }, | ||
| 74 | |||
| 75 | requires => { | ||
| 76 | 'perl' => '5.12.0', | ||
| 77 | 'Excel::Writer::XLSX' => 1.01, | ||
| 78 | 'Archive::Zip' => 0, | ||
| 79 | 'Graphics::ColorUtils' => 0, | ||
| 80 | 'Scalar::Util' => 0, | ||
| 81 | 'XML::Twig' => 0, | ||
| 82 | }, | ||
| 83 | add_to_cleanup => [qw(Excel-Template-XLSX-* *.zip *.pui *.prj make.bat)], | ||
| 84 | create_makefile_pl => 'traditional', | ||
| 85 | |||
| 86 | ); | ||
| 87 | |||
| 88 | $builder->add_build_element( q[xlsx] ); | ||
| 89 | $builder->create_build_script(); |