Commits

Anonymous committed 2f44e57

Add the tag-release and bump-version-number maintenance scripts.

  • Participants
  • Parent commits 33289bd

Comments (0)

Files changed (3)

File abc-path/Games-ABC_Path-Generator/MANIFEST

 Build.PL
 Changes
+lib/Games/ABC_Path/Generator/App.pm
 lib/Games/ABC_Path/Generator.pm
-lib/Games/ABC_Path/Generator/App.pm
 lib/Games/ABC_Path/MicrosoftRand.pm
+Makefile.PL
 MANIFEST			This list of files
+META.yml
 README
+scripts/bump-version-number.pl
+scripts/tag-release.pl
 t/00-load.t
 t/manifest.t
 t/pod-coverage.t
 t/pod.t
-Makefile.PL
-META.yml

File abc-path/Games-ABC_Path-Generator/scripts/bump-version-number.pl

+#!/usr/bin/perl
+
+use strict;
+use warnings;
+
+use File::Find::Object;
+use IO::All;
+
+my $tree = File::Find::Object->new({}, 'lib/');
+
+my $version_n = shift(@ARGV);
+
+if (!defined($version_n))
+{
+    die "Specify version number as an argument! bump-version-number.pl '0.0.1'";
+}
+
+while (my $r = $tree->next()) {
+    if ($r =~ m{/\.svn\z})
+    {
+        $tree->prune();
+    }
+    elsif ($r =~ m{\.pm\z})
+    {
+        my @lines = io->file($r)->getlines();
+        foreach (@lines)
+        {
+            s#(\$VERSION = '|^Version )\d+\.\d+(?:\.\d+)?('|)#$1 . $version_n . $2#e;
+        }
+        io->file($r)->print(
+            @lines
+        );
+    }
+}
+

File abc-path/Games-ABC_Path-Generator/scripts/tag-release.pl

+#!/usr/bin/perl
+
+use strict;
+use warnings;
+
+use IO::All;
+
+my ($version) = 
+    (map { m{\$VERSION *= *'([^']+)'} ? ($1) : () } 
+    io->file('lib/Games/ABC_Path/Generator.pm')->getlines()
+    )
+    ;
+
+if (!defined ($version))
+{
+    die "Version is undefined!";
+}
+
+my $mini_repos_base = 'https://svn.berlios.de/svnroot/repos/fc-solve/abc-path';
+
+my @cmd = (
+    "svn", "copy", "-m",
+    "Tagging the XML-Grammar-Fiction release as $version",
+    "$mini_repos_base/trunk",
+    "$mini_repos_base/tags/Games-ABC_Path-Generator-cpan-releases/$version",
+);
+
+print join(" ", map { /\s/ ? qq{"$_"} : $_ } @cmd), "\n";
+exec(@cmd);
+