WriteAll.pm 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. #line 1
  2. package Module::Install::WriteAll;
  3. use strict;
  4. use Module::Install::Base ();
  5. use vars qw{$VERSION @ISA $ISCORE};
  6. BEGIN {
  7. $VERSION = '1.04';
  8. @ISA = qw{Module::Install::Base};
  9. $ISCORE = 1;
  10. }
  11. sub WriteAll {
  12. my $self = shift;
  13. my %args = (
  14. meta => 1,
  15. sign => 0,
  16. inline => 0,
  17. check_nmake => 1,
  18. @_,
  19. );
  20. $self->sign(1) if $args{sign};
  21. $self->admin->WriteAll(%args) if $self->is_admin;
  22. $self->check_nmake if $args{check_nmake};
  23. unless ( $self->makemaker_args->{PL_FILES} ) {
  24. # XXX: This still may be a bit over-defensive...
  25. unless ($self->makemaker(6.25)) {
  26. $self->makemaker_args( PL_FILES => {} ) if -f 'Build.PL';
  27. }
  28. }
  29. # Until ExtUtils::MakeMaker support MYMETA.yml, make sure
  30. # we clean it up properly ourself.
  31. $self->realclean_files('MYMETA.yml');
  32. if ( $args{inline} ) {
  33. $self->Inline->write;
  34. } else {
  35. $self->Makefile->write;
  36. }
  37. # The Makefile write process adds a couple of dependencies,
  38. # so write the META.yml files after the Makefile.
  39. if ( $args{meta} ) {
  40. $self->Meta->write;
  41. }
  42. # Experimental support for MYMETA
  43. if ( $ENV{X_MYMETA} ) {
  44. if ( $ENV{X_MYMETA} eq 'JSON' ) {
  45. $self->Meta->write_mymeta_json;
  46. } else {
  47. $self->Meta->write_mymeta_yaml;
  48. }
  49. }
  50. return 1;
  51. }
  52. 1;