Improve col_accessor_map coderef documentation
[dbsrgits/DBIx-Class-Schema-Loader.git] / Makefile.PL
CommitLineData
2a72f15d 1use warnings;
2use strict;
ef8e9c69 3
4use 5.008001;
2a72f15d 5use inc::Module::Install 1.00;
ef8e9c69 6
509e7821 7use Getopt::Long();
8
9my $getopt = Getopt::Long::Parser->new(
494e0205 10 config => [qw/gnu_getopt bundling_override no_ignore_case pass_through/]
509e7821 11);
12my $args = {
494e0205 13 skip_author_deps => undef,
509e7821 14};
15$getopt->getoptions($args, 'skip_author_deps');
16if (@ARGV) {
494e0205 17 warn "\nIgnoring unrecognized option(s): @ARGV\n\n";
509e7821 18}
19
ef8e9c69 20use FindBin;
21use lib "$FindBin::Bin/lib";
22
2a72f15d 23perl_version '5.008001';
3fe9c5d9 24name 'DBIx-Class-Schema-Loader';
25all_from 'lib/DBIx/Class/Schema/Loader.pm';
26
65f78d29 27# temporary, needs to be thrown out
eaf23084 28test_requires 'DBIx::Class::IntrospectableM2M' => 0;
3fe9c5d9 29
65f78d29 30# core, but specific versions not available on older perls
31test_requires 'File::Temp' => '0.16';
32test_requires 'File::Path' => '2.07';
33
34test_requires 'DBD::SQLite' => '1.29';
35test_requires 'Test::Exception' => '0.31';
36test_requires 'Test::More' => '0.94';
37test_requires 'Test::Warn' => '0.21';
239fa6bc 38test_requires 'Test::Deep' => '0.107';
a2e5cee3 39test_requires 'Test::Differences' => '0.60';
65f78d29 40
41requires 'Carp::Clan' => 0;
42requires 'Class::Accessor::Grouped' => '0.10008';
43requires 'Class::C3::Componentised' => '1.0008';
44requires 'Class::Inspector' => '1.27';
45requires 'Class::Unload' => '0.07';
3fe9c5d9 46requires 'Data::Dump' => '1.06';
65f78d29 47requires 'DBIx::Class' => '0.08127';
48requires 'Hash::Merge' => '0.12';
3fe9c5d9 49requires 'Lingua::EN::Inflect::Number' => '1.1';
4f7692f0 50requires 'Lingua::EN::Tagger' => '0.23';
51requires 'Lingua::EN::Inflect::Phrase' => '0.15';
ecf22f0a 52requires 'List::Util' => '1.33';
942bd5e0 53requires 'MRO::Compat' => '0.09';
65f78d29 54requires 'namespace::clean' => '0.23';
55requires 'Scope::Guard' => '0.20';
f9daf711 56requires 'String::ToIdentifier::EN' => '0.05';
ea3b8f03 57requires 'String::CamelCase' => '0.02';
ecf22f0a 58requires 'Sub::Util' => '1.40';
65f78d29 59requires 'Try::Tiny' => 0;
60
61# core, but specific versions not available on older perls
62requires 'Digest::MD5' => '2.36';
63requires 'Exporter' => '5.63';
3fe9c5d9 64
10b0a36e 65print <<"EOF";
66******************* DBIx::Class::Schema::Loader WARNING ***********************
67The default attributes for belongs_to relationships for foreign keys with no
68rules has been changed for most databases, and is soon changing for the rest,
69as ON DELETE/UPDATE and DEFERRABLE clauses for foreign keys are now being
70introspected.
71
72THIS MAY AFFECT YOUR DDL DIFFS WHEN DEPLOYING
73
74YOUR GENERATED CODE WILL ALMOST CERTAINLY CHANGE
75
76Read more about the changes in "relationship_attrs" in:
77
78perldoc DBIx::Class::Schema::Loader::Base
79
80https://metacpan.org/module/DBIx::Class::Schema::Loader::Base#relationship_attrs
81
82See also the "Changes" file for the last few revisions.
83*******************************************************************************
84EOF
85
509e7821 86if ($Module::Install::AUTHOR && ! $args->{skip_author_deps}) {
30ede608 87 my @missing_plugins;
88 for my $plugin (qw(ReadmeFromPod AuthorTests)) {
89 eval "require Module::Install::$plugin" and next;
93c51ef2 90 push @missing_plugins, "Module::Install::$plugin";
30ede608 91 chomp(my $err = $@);
92 $missing_plugins[-1] .= " ($err)"
93 unless $err =~ m{^Can't locate Module/Install/$plugin.pm in \@INC};
94 }
95 die "\nYou need to install the following modules to run this Makefile.PL in author mode:\n\n", join("\n", @missing_plugins), "\n\n"
96 if @missing_plugins;
2a72f15d 97
98 warn "\n*** AUTHOR MODE: some optional dependencies converted to hard requires.\n\n";
ff746964 99
ef8e9c69 100 require DBIx::Class::Schema::Loader::Optional::Dependencies;
01012543 101
406a97c2 102 test_requires %{DBIx::Class::Schema::Loader::Optional::Dependencies
103 ->modreq_list_for([
104 grep { !/rdbms/ }
105 keys %{ DBIx::Class::Schema::Loader::Optional::Dependencies
106 ->req_group_list
107 }
108 ])};
109
110 DBIx::Class::Schema::Loader::Optional::Dependencies->_gen_pod(undef, 'lib');
2a72f15d 111
605be787 112 author_tests( 'xt' );
2a72f15d 113 readme_from( 'lib/DBIx/Class/Schema/Loader.pm' );
114 realclean_files( qw[README MANIFEST lib/DBIx/Class/Schema/Loader/Optional/Dependencies.pod] );
1fb9f509 115 postamble <<EOP;
116create_distdir: author_stop_distdir_creation
117author_stop_distdir_creation:
118\t\$(NOECHO) \$(ECHO) Creation of dist with author mode deps not allowed
119\t\$(NOECHO) \$(ECHO) Please re-run Makefile.PL with --skip_author_deps
120\t\$(NOECHO) \$(FALSE)
121EOP
122
3fe9c5d9 123}
124
ef8e9c69 125tests_recursive;
126
127install_script 'script/dbicdump';
128
64b844d0 129resources 'IRC' => 'irc://irc.perl.org/#dbix-class';
130resources 'license' => 'http://dev.perl.org/licenses/';
5fa622c2 131resources 'repository' => 'https://github.com/dbsrgits/dbix-class-schema-loader';
64b844d0 132resources 'MailingList' => 'http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/dbix-class';
133
3fe9c5d9 134auto_install;
135WriteAll;
ef8e9c69 136
137# vim:et sts=4 sw=4 tw=0: