3 sqlite => File::Spec->catfile(qw(t lib sqlite.sql)),
4 dbdfile => File::Spec->catfile(qw(t lib dbdfile.sql)),
7 # If the author doesn't have the prereqs, we will end up obliterating
8 # the ddl file, and all tests will fail, therefore don't do anything
10 # The EUMM build-stage generation will run unconditionally and
11 # errors will not be trapped
12 require DBIx::Class::Optional::Dependencies;
13 if ( DBIx::Class::Optional::Dependencies->req_ok_for ('deploy') ) {
14 foreach my $type (qw(sqlite dbdfile)) {
15 print "Regenerating t/lib/$type.sql\n";
16 if (my $out = ` "$^X" -Ilib maint/gen_schema_$type `) {
17 open (my $fh, '>:unix', $ddl_fn->{$type}) or die "Unable to open $ddl_fn->{$type}: $!";
21 # if we don't do it some git tools (e.g. gitk) get confused that the
22 # ddl file is modified, when it clearly isn't
23 system('git status --porcelain >' . File::Spec->devnull);
28 my $postamble = <<"EOP";
30 clonedir_generate_files : dbic_clonedir_regen_test_ddl
32 dbic_clonedir_regen_test_ddl :
34 foreach my $type (qw(sqlite dbdfile)) {
35 $postamble .= <<"EOP";
36 \t\$(ABSPERLRUN) -Ilib -- maint/gen_schema_$type > @{[ $mm_proto->quote_literal($ddl_fn->{$type}) ]}
37 @{[ $crlf_fixup->($ddl_fn->{$type}) ]}
43 # keep the Makefile.PL eval happy