Skip Menu |
 

Preferred bug tracker

Please visit the preferred bug tracker to report your issue.

This queue is for tickets about the Dist-Zilla CPAN distribution.

Report information
The Basics
Id: 55998
Status: open
Priority: 0/
Queue: Dist-Zilla

People
Owner: Nobody in particular
Requestors: avar [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: Wishlist
Broken in: (no value)
Fixed in: (no value)



Subject: Implement a sugary PP config format
Currently dist.ini is the main supported format, it forces you to shoehorn all your arguments into a key-value namespace and doesn't allow you to execute any Perl code. As a result any dist that does something out of the ordinary (like XS dists) have to write their own plugins to emit a custom Makefile.PL at this point (see my OverridableMakeMaker for an example). It would be nice if there was a way to write a dist.pl in a way that wasn't ugly (and documented!). Attached is an example of how this might look like. The example assumes that Dist::Zilla::Magic is implementing an end-of-scope hook that returns the data being fed into it as a HashRef. Furthermore: As long as dist.ini is the default config format plugin authors will be forced to shoehorn everything into a key-value namespace 1-level deep if they want to be compatible with most DZ dists. This has irked my more than anything else about DZ. I think it would be nice to have a pure-Perl config format as the default. That would make the easy things easy and the hard things possible.
Subject: dist.pl
Download dist.pl
text/x-perl 2.4k
use Dist::Zilla::Magic; conf name => 'Hailo'; conf author => 'Hinrik Örn Sigurðsson <hinrik.sig@gmail.com>'; conf author => 'Ævar Arnfjörð Bjarmason <avar@cpan.org>'; conf copyright_holder => 'Hinrik Örn Sigurðsson and Ævar Arnfjörð Bjarmason'; conf license => 'Perl_5'; conf_plugin '@AVAR' => { dist => 'Hailo', bugtracker => 'rt', github_user => 'hailo', no_AutoPrereq => 1, no_MakeMaker => 1, }; our @DIR = qw(libutf libfmt libregexp); our @OBJ = map { s/\.c$/.o/; $_ } grep { ! /test/ } glob "lib*/*.c"; conf_plugin OverridableMakeMaker => { # Here be XS -extra_args => { DIR => [ @DIR ], INC => join(' ', map { "-I$_" } @DIR), # This used to be '-shared lib*/*.o' but that doesn't work on Win32 LDDLFLAGS => "-shared @OBJ", }, }; conf_plugin '=inc::Dist::Zilla::Plugin::HailoMakeMaker / HailoMakeMaker'; conf_plugin 'Prereq' => { perl => 5.010, Time::HiRes => 0, File::Spec::Functions => 0, ## Depend on Mouse and Moose, we can use either one # Mouse Mouse => 0.50, MouseX::Types => 0.05, MouseX::Getopt => 0.2601, # Moose Moose => 0.94, MooseX::Types => 0.21, MooseX::StrictConstructor => 0.08, MooseX::Getopt => 0.26, # Hailo.pm Any::Moose => 0.11, autodie => 2.08, File::CountLines => 0.0.2, IO::Interactive => 0.0.6, # Command.pm Getopt::Long::Descriptive => 0.083, Dir::Self => 0.10, # ReadLine.pm Term::ProgressBar => 2.00, Term::ReadLine => 0, # DBD.pm List::MoreUtils => 0.22, # SQLite.pm DBD::SQLite => 1.29, # everywhere namespace::clean => 0.13, ## Pg/mysql: optional backends #DBD::mysql => 4.013, #DBD::Pg => 2.16.1, ## Test-requires File::Slurp => 9999.13, Test::Exception => 0.29, Test::More => 0.94, Test::Output => 0.16, Test::Script => 1.07, Test::Expect => 0.30, Test::Script::Run => 0.03, Test::Synopsis => 0.06, Data::Section => 0.100770, };
Download (untitled) / with headers
text/plain 116b
I have no objection to someone writing something to make this happen, but I have no plans to do it myself. -- rjbs


This service is sponsored and maintained by Best Practical Solutions and runs on Perl.org infrastructure.

Please report any issues with rt.cpan.org to rt-cpan-admin@bestpractical.com.