use warnings FATAL => 'all';
use 5.008001;
use ExtUtils::MakeMaker;
+
+check_conflicts();
(do 'maint/Makefile.PL.include' or die $@) unless -f 'META.yml';
my %BUILD_DEPS = ();
WriteMakefile(
NAME => 'Moo',
VERSION_FROM => 'lib/Moo.pm',
+ CONFIGURE_REQUIRES => {
+ 'Dist::CheckConflicts' => '0.02',
+ },
PREREQ_PM => {
%RUN_DEPS,
($] >= 5.010 ? () : ('MRO::Compat' => 0)),
($mymeta_works ? () : (%BUILD_DEPS)),
+ 'Dist::CheckConflicts' => '0.02',
},
($mymeta_works
? ( # BUILD_REQUIRES makes MYMETA right, requires stops META being wrong
},
($mymeta && !$mymeta_works ? (NO_MYMETA => 1) : ()),
LICENSE => 'perl',
+ 'EXE_FILES' => [
+ 'bin/moo-outdated',
+ ],
);
+
+# copied from Moose-2.0801/Makefile.PL
+sub check_conflicts {
+ if ( eval { require 'lib/Moo/Conflicts.pm'; 1; } ) {
+ if ( eval { Moo::Conflicts->check_conflicts; 1 } ) {
+ return;
+ }
+ else {
+ my $err = $@;
+ $err =~ s/^/ /mg;
+ warn "***\n$err***\n";
+ }
+ }
+ else {
+ print <<'EOF';
+***
+ Your toolchain doesn't support configure_requires, so
+ Dist::CheckConflicts hasn't been installed yet. You should check for
+ conflicting modules manually using the 'moo-outdated' script that is
+ installed with this distribution once the installation finishes.
+***
+EOF
+ }
+
+ # More or less copied from Module::Build
+ return if $ENV{PERL_MM_USE_DEFAULT};
+ return unless -t STDIN && ( -t STDOUT || !( -f STDOUT || -c STDOUT ) );
+
+ sleep 4;
+}
+
--- /dev/null
+#!/usr/bin/perl
+
+use strict;
+use warnings;
+# PODNAME: moo-outdated
+
+use Getopt::Long;
+use Moo::Conflicts;
+
+my $verbose;
+GetOptions( 'verbose|v' => \$verbose );
+
+if ($verbose) {
+ Moo::Conflicts->check_conflicts;
+}
+else {
+ my @conflicts = Moo::Conflicts->calculate_conflicts;
+ print "$_\n" for map { $_->{package} } @conflicts;
+ exit @conflicts;
+}
+
--- /dev/null
+package # hide from PAUSE
+ Moo::Conflicts;
+
+use strict;
+use warnings;
+
+use Dist::CheckConflicts
+ -dist => 'Moo',
+ -conflicts => {
+ # enter conflicting downstream deps here, with the version indicating
+ # the last *broken* version that *does not work*.
+
+ },
+
+ # these dists' ::Conflicts modules (if they exist) are also checked for
+ # more incompatibilities -- should include all runtime prereqs here.
+ -also => [ qw(
+ Carp
+ Class::Method::Modifiers
+ strictures
+ Module::Runtime
+ Role::Tiny
+ Devel::GlobalDestruction
+ ) ],
+;
+
+1;