Commit | Line | Data |
2a72f15d |
1 | use warnings; |
2 | use strict; |
ef8e9c69 |
3 | |
4 | use 5.008001; |
2a72f15d |
5 | use inc::Module::Install 1.00; |
ef8e9c69 |
6 | |
509e7821 |
7 | use Getopt::Long(); |
8 | |
9 | my $getopt = Getopt::Long::Parser->new( |
494e0205 |
10 | config => [qw/gnu_getopt bundling_override no_ignore_case pass_through/] |
509e7821 |
11 | ); |
12 | my $args = { |
494e0205 |
13 | skip_author_deps => undef, |
509e7821 |
14 | }; |
15 | $getopt->getoptions($args, 'skip_author_deps'); |
16 | if (@ARGV) { |
494e0205 |
17 | warn "\nIgnoring unrecognized option(s): @ARGV\n\n"; |
509e7821 |
18 | } |
19 | |
ef8e9c69 |
20 | use FindBin; |
21 | use lib "$FindBin::Bin/lib"; |
22 | |
2a72f15d |
23 | perl_version '5.008001'; |
3fe9c5d9 |
24 | name 'DBIx-Class-Schema-Loader'; |
25 | all_from 'lib/DBIx/Class/Schema/Loader.pm'; |
26 | |
65f78d29 |
27 | # temporary, needs to be thrown out |
eaf23084 |
28 | test_requires 'DBIx::Class::IntrospectableM2M' => 0; |
3fe9c5d9 |
29 | |
65f78d29 |
30 | # core, but specific versions not available on older perls |
31 | test_requires 'File::Temp' => '0.16'; |
32 | test_requires 'File::Path' => '2.07'; |
33 | |
34 | test_requires 'DBD::SQLite' => '1.29'; |
35 | test_requires 'Test::Exception' => '0.31'; |
36 | test_requires 'Test::More' => '0.94'; |
37 | test_requires 'Test::Warn' => '0.21'; |
239fa6bc |
38 | test_requires 'Test::Deep' => '0.107'; |
a2e5cee3 |
39 | test_requires 'Test::Differences' => '0.60'; |
65f78d29 |
40 | |
41 | requires 'Carp::Clan' => 0; |
42 | requires 'Class::Accessor::Grouped' => '0.10008'; |
43 | requires 'Class::C3::Componentised' => '1.0008'; |
44 | requires 'Class::Inspector' => '1.27'; |
45 | requires 'Class::Unload' => '0.07'; |
3fe9c5d9 |
46 | requires 'Data::Dump' => '1.06'; |
65f78d29 |
47 | requires 'DBIx::Class' => '0.08127'; |
48 | requires 'Hash::Merge' => '0.12'; |
3fe9c5d9 |
49 | requires 'Lingua::EN::Inflect::Number' => '1.1'; |
4f7692f0 |
50 | requires 'Lingua::EN::Tagger' => '0.23'; |
51 | requires 'Lingua::EN::Inflect::Phrase' => '0.15'; |
ecf22f0a |
52 | requires 'List::Util' => '1.33'; |
942bd5e0 |
53 | requires 'MRO::Compat' => '0.09'; |
65f78d29 |
54 | requires 'namespace::clean' => '0.23'; |
55 | requires 'Scope::Guard' => '0.20'; |
f9daf711 |
56 | requires 'String::ToIdentifier::EN' => '0.05'; |
ea3b8f03 |
57 | requires 'String::CamelCase' => '0.02'; |
ecf22f0a |
58 | requires 'Sub::Util' => '1.40'; |
65f78d29 |
59 | requires 'Try::Tiny' => 0; |
60 | |
61 | # core, but specific versions not available on older perls |
62 | requires 'Digest::MD5' => '2.36'; |
63 | requires 'Exporter' => '5.63'; |
3fe9c5d9 |
64 | |
10b0a36e |
65 | print <<"EOF"; |
66 | ******************* DBIx::Class::Schema::Loader WARNING *********************** |
67 | The default attributes for belongs_to relationships for foreign keys with no |
68 | rules has been changed for most databases, and is soon changing for the rest, |
69 | as ON DELETE/UPDATE and DEFERRABLE clauses for foreign keys are now being |
70 | introspected. |
71 | |
72 | THIS MAY AFFECT YOUR DDL DIFFS WHEN DEPLOYING |
73 | |
74 | YOUR GENERATED CODE WILL ALMOST CERTAINLY CHANGE |
75 | |
76 | Read more about the changes in "relationship_attrs" in: |
77 | |
78 | perldoc DBIx::Class::Schema::Loader::Base |
79 | |
80 | https://metacpan.org/module/DBIx::Class::Schema::Loader::Base#relationship_attrs |
81 | |
82 | See also the "Changes" file for the last few revisions. |
83 | ******************************************************************************* |
84 | EOF |
85 | |
509e7821 |
86 | if ($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; |
116 | create_distdir: author_stop_distdir_creation |
117 | author_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) |
121 | EOP |
122 | |
3fe9c5d9 |
123 | } |
124 | |
ef8e9c69 |
125 | tests_recursive; |
126 | |
127 | install_script 'script/dbicdump'; |
128 | |
64b844d0 |
129 | resources 'IRC' => 'irc://irc.perl.org/#dbix-class'; |
130 | resources 'license' => 'http://dev.perl.org/licenses/'; |
5fa622c2 |
131 | resources 'repository' => 'https://github.com/dbsrgits/dbix-class-schema-loader'; |
64b844d0 |
132 | resources 'MailingList' => 'http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/dbix-class'; |
133 | |
3fe9c5d9 |
134 | auto_install; |
135 | WriteAll; |
ef8e9c69 |
136 | |
137 | # vim:et sts=4 sw=4 tw=0: |