From 5f4f2a4d54e4f0e2aabedd9ab1b5483c503204e6 Mon Sep 17 00:00:00 2001 From: Daniel Friesel Date: Sun, 12 Dec 2010 17:41:50 +0100 Subject: Build.PL: Get version from git. Still need to get it into the .pl file, tho --- Build.PL | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/Build.PL b/Build.PL index 2c4cdba..3fa2b19 100644 --- a/Build.PL +++ b/Build.PL @@ -4,7 +4,7 @@ use strict; use warnings; use Module::Build; -my $build = Module::Build->new( +my %opts = ( build_requires => { 'Test::More' => 0, 'Test::Compile' => 0, @@ -21,4 +21,11 @@ my $build = Module::Build->new( 'WWW::Mechanize' => 0, }, ); + +if (-d '.git' and qx{which git} =~ qr{/git$}) { + $opts{'dist_version'} = qx{git describe}; + chomp $opts{'dist_version'}; +} + +my $build = Module::Build->new(%opts); $build->create_build_script; -- cgit v1.2.3