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