Merge all pod generation into one inc snippet, cleanup the poddir beforehand
[dbsrgits/DBIx-Class.git] / maint / Makefile.PL.inc / 53_autogen_pod.pl
CommitLineData
a14c7707 1# leftovers in old checkouts
2unlink 'lib/DBIx/Class/Optional/Dependencies.pod'
3 if -f 'lib/DBIx/Class/Optional/Dependencies.pod';
4
5my $pod_dir = '.generated_pod';
6my $ver = Meta->version;
7
8# cleanup the generated pod dir (again - kill leftovers from old checkouts)
9require File::Path;
10require File::Glob;
11File::Path::rmtree( [File::Glob::bsd_glob "$pod_dir/*"], { verbose => 0 } );
12
13# generate the OptDeps pod both in the clone-dir and during the makefile distdir
14{
15 print "Regenerating Optional/Dependencies.pod\n";
16 require DBIx::Class::Optional::Dependencies;
17 DBIx::Class::Optional::Dependencies->_gen_pod ($ver, $pod_dir);
18
19 postamble <<"EOP";
20
21.PHONY: dbic_clonedir_gen_optdeps_pod
22
23create_distdir : dbic_clonedir_gen_optdeps_pod
24
25dbic_clonedir_gen_optdeps_pod :
26\t\$(ABSPERL) -Ilib -MDBIx::Class::Optional::Dependencies -e "DBIx::Class::Optional::Dependencies->_gen_pod(qw($ver $pod_dir))"
27
28EOP
29}
30
31# generate the inherit pods both in the clone-dir and during the makefile distdir
32{
33 print "Regenerating project documentation to include inherited methods\n";
34
35 # if the author doesn't have them, don't fail the initial "perl Makefile.pl" step
36 do "maint/gen_pod_inherit" or print "\n!!! FAILED: $@\n";
37
38 postamble <<"EOP";
39
40.PHONY: dbic_clonedir_gen_inherit_pods
41
42create_distdir : dbic_clonedir_gen_inherit_pods
43
44dbic_clonedir_gen_inherit_pods :
45\t\$(ABSPERL) -Ilib maint/gen_pod_inherit
46
47EOP
48}
49
50# keep the Makefile.PL eval happy
511;