summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Friesel <derf@finalrewind.org>2010-12-12 17:41:50 +0100
committerDaniel Friesel <derf@finalrewind.org>2010-12-12 17:41:50 +0100
commit5f4f2a4d54e4f0e2aabedd9ab1b5483c503204e6 (patch)
tree029e530000eca81d32bb2c215fc80429762d588d
parent404dff939c881a403f7bd7a7c4827cdc476a477a (diff)
Build.PL: Get version from git. Still need to get it into the .pl file, tho
-rw-r--r--Build.PL9
1 files changed, 8 insertions, 1 deletions
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;