Make pod generation more palatable to the existing toolchain
[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;
a0c96f24 11File::Path::rmtree( File::Glob::bsd_glob("$pod_dir/*"), { verbose => 0 } );
12
a14c7707 13
14# generate the OptDeps pod both in the clone-dir and during the makefile distdir
15{
16 print "Regenerating Optional/Dependencies.pod\n";
17 require DBIx::Class::Optional::Dependencies;
18 DBIx::Class::Optional::Dependencies->_gen_pod ($ver, $pod_dir);
19
20 postamble <<"EOP";
21
a0c96f24 22clonedir_generate_files : dbic_clonedir_gen_optdeps_pod
a14c7707 23
24dbic_clonedir_gen_optdeps_pod :
a0c96f24 25\t\$(ABSPERLRUN) -Ilib -MDBIx::Class::Optional::Dependencies -e "DBIx::Class::Optional::Dependencies->_gen_pod(qw($ver $pod_dir))"
a14c7707 26
27EOP
28}
29
a0c96f24 30
a14c7707 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
a0c96f24 40clonedir_generate_files : dbic_clonedir_gen_inherit_pods
a14c7707 41
42dbic_clonedir_gen_inherit_pods :
a0c96f24 43\t\$(ABSPERLRUN) -Ilib maint/gen_pod_inherit
44
45EOP
46}
47
48
49# copy the contents of .generated_pod over to lib/
50# (yes, overwriting is fine, though nothing should reside there)
51{
52 postamble <<"EOP";
53
54clonedir_post_generate_files : dbic_clonedir_copy_generated_pod
55
56dbic_clonedir_copy_generated_pod :
57\t\$(RM_F) .generated_pod/.packlist
58\t\$(ABSPERLRUN) -MExtUtils::Install -e 'install([ from_to => {qw(.generated_pod/DBIx lib/DBIx write .generated_pod/.packlist)}, verbose => 0, uninstall_shadows => 0, skip => [] ]);'
59
60EOP
61}
62
63
64# everything that came from .generated_pod, needs to be removed from our lib/
65{
66 postamble <<"EOP";
67
68clonedir_cleanup_generated_files : dbic_clonedir_cleanup_generated_pod_copies
69
70dbic_clonedir_cleanup_generated_pod_copies :
71\t\$(ABSPERLRUN) -MExtUtils::Install -e 'uninstall(qw(.generated_pod/.packlist))'
a14c7707 72
73EOP
74}
75
76# keep the Makefile.PL eval happy
771;