dagolden/Dist-Zilla-Plugin-BumpVersionAfterRelease — pull request #4 by kentfredric (2014-09-13 13:09:09+00:00)
Title: Add test for dist.ini propagating to PM files

This test demonstrates that it is presently not possible to do set `version = ` in dist.ini and have it spread to the `.pm` files.

This is basically the downside by running in multiple phases, and by being a version provider in addition to a version munger :anguished:

This approach is useful if:

- You want to set version from dist.ini instead of the mainmodule.pm
- You want mainmodule.pm to have a usable `$VERSION` in it ( ruling out PkgVersion and OurPkgVersion )
- You want `dzil build` to emit a built dist with `mainmodule.pm` having the version in `dist.ini` ( Not possible with PkgVersion, just warns/dies , OurPkgVersion blindly replaces a magic comment and produces invalid code )
- You *WANT* to be setting `version = ` in dist.ini manually ( @ambs )

This would already be possible with `RewriteVersion` if not for RewriteVersions being a `-VersionProvider`, because that of course trips up here:

https://metacpan.org/source/RJBS/Dist-Zilla-5.020/lib/Dist/Zilla.pm#L107

```perl
my $version = $self->_version_override;
for my $plugin ($self->plugins_with(-VersionProvider)->flatten) {
next unless defined(my $this_version = $plugin->provide_version);

$self->log_fatal('attempted to set version twice') if defined $version; ## BANG
```

And so yes, your comments an aeon ago with regards to "Plugins should only have one phase" and "Plugins should be named after their phase" I agree more and more with every day. :smile: