Commit | Line | Data |
e01862e4 |
1 | require File::Spec; |
2 | my $ddl_fn = File::Spec->catfile(qw(t lib sqlite.sql)); |
3 | |
4 | # If the author doesn't have the prereqs, we will end up obliterating |
5 | # the ddl file, and all tests will fail, therefore don't do anything |
6 | # on error |
7 | # The EUMM build-stage generation will run unconditionally and |
8 | # errors will not be trapped |
4a51243f |
9 | require DBIx::Class::Optional::Dependencies; |
10 | if ( DBIx::Class::Optional::Dependencies->req_ok_for ('deploy') ) { |
11 | print "Regenerating t/lib/sqlite.sql\n"; |
12 | if (my $out = ` "$^X" -Ilib maint/gen_schema `) { |
13 | open (my $fh, '>:unix', $ddl_fn) or die "Unable to open $ddl_fn: $!"; |
14 | print $fh $out; |
15 | close $fh; |
16 | } |
e01862e4 |
17 | } |
18 | |
19 | postamble <<"EOP"; |
20 | |
21 | clonedir_generate_files : dbic_clonedir_regen_test_ddl |
22 | |
23 | dbic_clonedir_regen_test_ddl : |
24 | \t\$(ABSPERLRUN) -Ilib -- maint/gen_schema > @{[ $mm_proto->quote_literal($ddl_fn) ]} |
ffce4b65 |
25 | @{[ $crlf_fixup->($ddl_fn) ]} |
e01862e4 |
26 | EOP |
27 | |
28 | # keep the Makefile.PL eval happy |
29 | 1; |