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