Generalize the SQLite DDL generation tool (see next commit)
[dbsrgits/DBIx-Class.git] / maint / Makefile.PL.inc / 56_autogen_schema_files.pl
CommitLineData
a2c29633 1require File::Spec;
2my $test_ddl_fn = File::Spec->catfile(qw( t lib sqlite.sql ));
3my @test_ddl_cmd = qw( -I lib -I t/lib -- maint/gen_sqlite_schema_files --schema-class DBICTest::Schema );
4
5# If the author doesn't have the prereqs, still generate a Makefile
6# The EUMM build-stage generation will run unconditionally and
7# errors will not be ignored unlike here
8require DBIx::Class::Optional::Dependencies;
9if ( DBIx::Class::Optional::Dependencies->req_ok_for ('deploy') ) {
10 print "Regenerating $test_ddl_fn\n";
11 system( $^X, @test_ddl_cmd, '--ddl-out' => $test_ddl_fn );
12
13 # if we don't do it some git tools (e.g. gitk) get confused that the
14 # ddl file is modified, when it clearly isn't
15 system('git status --porcelain >' . File::Spec->devnull);
16}
17
18postamble <<"EOP";
19
20clonedir_generate_files : dbic_clonedir_regen_test_ddl
21
22dbic_clonedir_regen_test_ddl :
23\t\$(ABSPERLRUN) @test_ddl_cmd --ddl-out @{[ $mm_proto->quote_literal($test_ddl_fn) ]}
24EOP
25
26# keep the Makefile.PL eval happy
271;