Dist::Zilla::Plugin::Version::FromSubversion - Use the revision of the working directory
version 1.000019
In dist.ini:
[Version::FromSubversion] ; optional, default is 1 major = 0 ; optional, default is something like sprintf('%u.%06u', $major, $revision) format = {{ $major }}.{{ sprintf('%06u', $revision) }} ; optional. The svn:keywords property must be set to 'Revision' on dist.ini fallback_revision = $Revision: $
To do a release:
$ svn update . $ dzil release
Using revision numbers of the versioning system is a *really bad* idea: that will not scale. For example, it will not work if you start to use branches and want to make releases from them because revision numbers are global, and not per branch. So keep this only for small projects and be prepared to change you version scheme if that goes wrong!
This plugin build a version number for a release from the Subversion revision number of the current directory.
The fallback_revision option can be used for the cases where the distribution is not built from a working copy but from an export (svn export). For example, integration tools such as Jenkins. For this case we are using the svn:keywords property on dist.ini to be able to retrieve the revision number from a known place.
fallback_revision
svn:keywords
Notes:
It is the user responsability to keep the directory up to date (with "svn update ."). The plugin currently does not even warn if the release is made from a directory which is not clean (everything committed).
svn update .
This distribution is built with itself. You can checkout its Subversion repository from Google Code:
svn checkout http://dist-zilla-plugin-version-fromsubversion.googlecode.com/svn/trunk/ DZ-P-Version-FromSubversion
Some suggestions of plugins to use in combination with this one:
Dist::Zilla::Plugin::NextRelease
Dist::Zilla::Plugin::PkgVersion
Olivier Mengué, mailto:dolmen@cpan.org.
Some code from Dist::Zilla::Plugin::AutoVersion by Ricardo Signes has been reused here.
Copyright © 2011 Olivier Mengué.
This library is free software; you can redistribute it and/or modify it under the same terms as Perl 5 itself.
To install Dist::Zilla::Plugin::Version::FromSubversion, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Dist::Zilla::Plugin::Version::FromSubversion
CPAN shell
perl -MCPAN -e shell install Dist::Zilla::Plugin::Version::FromSubversion
For more information on module installation, please visit the detailed CPAN module installation guide.