Commit | Line | Data |
a14c7707 |
1 | # leftovers in old checkouts |
2 | unlink 'lib/DBIx/Class/Optional/Dependencies.pod' |
3 | if -f 'lib/DBIx/Class/Optional/Dependencies.pod'; |
4 | |
5 | my $pod_dir = '.generated_pod'; |
6 | my $ver = Meta->version; |
7 | |
8 | # cleanup the generated pod dir (again - kill leftovers from old checkouts) |
9 | require File::Path; |
10 | require File::Glob; |
a0c96f24 |
11 | File::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 |
22 | clonedir_generate_files : dbic_clonedir_gen_optdeps_pod |
a14c7707 |
23 | |
24 | dbic_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 | |
27 | EOP |
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 |
40 | clonedir_generate_files : dbic_clonedir_gen_inherit_pods |
a14c7707 |
41 | |
42 | dbic_clonedir_gen_inherit_pods : |
a0c96f24 |
43 | \t\$(ABSPERLRUN) -Ilib maint/gen_pod_inherit |
44 | |
45 | EOP |
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 | |
54 | clonedir_post_generate_files : dbic_clonedir_copy_generated_pod |
55 | |
56 | dbic_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 | |
60 | EOP |
61 | } |
62 | |
63 | |
64 | # everything that came from .generated_pod, needs to be removed from our lib/ |
65 | { |
66 | postamble <<"EOP"; |
67 | |
68 | clonedir_cleanup_generated_files : dbic_clonedir_cleanup_generated_pod_copies |
69 | |
70 | dbic_clonedir_cleanup_generated_pod_copies : |
71 | \t\$(ABSPERLRUN) -MExtUtils::Install -e 'uninstall(qw(.generated_pod/.packlist))' |
a14c7707 |
72 | |
73 | EOP |
74 | } |
75 | |
76 | # keep the Makefile.PL eval happy |
77 | 1; |