about summary refs log tree commit diff
path: root/scripts
diff options
context:
space:
mode:
authorJonathan "Duke" Leto <jonathan@leto.net>2011-04-30 12:41:40 -0700
committerJonathan "Duke" Leto <jonathan@leto.net>2011-04-30 12:41:40 -0700
commit8b584aeea82959915891f5c4974d24f8c5dc7b86 (patch)
treefa5e03c6d800af5f0a7aa5e9d3ff3a07cb7172e8 /scripts
parentStart converting capsule.sh to perl (diff)
downloadjitterbug-convert_capsule.tar.gz
Finish creating a dispatch table for detecting how to build/test a project convert_capsule
Diffstat (limited to 'scripts')
-rw-r--r--scripts/capsule.pl57
1 files changed, 54 insertions, 3 deletions
diff --git a/scripts/capsule.pl b/scripts/capsule.pl
index 38463da..02ca8e1 100644
--- a/scripts/capsule.pl
+++ b/scripts/capsule.pl
@@ -11,9 +11,60 @@ my $build_dispatch = {
     'dist.ini' => sub {
         print "Found dist.ini, using Dist::Zilla\n";
         my $cmd =<<CMD;
-        dzil authordeps | cpanm >> $logfile 2>&1
-        cpanm --installdeps . >> $logfile 2>&1
-        HARNESS_VERBOSE=1 dzil test >> $logfile  2>&1
+dzil authordeps | cpanm >> $logfile 2>&1
+cpanm --installdeps . >> $logfile 2>&1
+HARNESS_VERBOSE=1 dzil test >> $logfile  2>&1
+CMD
+    },
+    'Build.PL' => sub {
+        print "Found Build.PL, using Build.PL\n";
+        my $cmd =<<CMD;
+perl Build.PL >> $logfile 2>&1
+# ./Build installdeps is not available in older Module::Build's
+cpanm --installdeps . >> $logfile 2>&1
+# Run this again in case our Build is out of date (suboptimal)
+perl Build.PL >> $logfile 2>&1
+HARNESS_VERBOSE=1 ./Build test --verbose >> $logfile 2>&1
+CMD
+    },
+    'Makefile.PL' => sub {
+        print "Found Makefile.PL\n";
+        my $cmd =<<CMD;
+perl Makefile.PL >> $logfile 2>&1
+cpanm --installdeps . >> $logfile 2>&1
+HARNESS_VERBOSE=1 make test >> $logfile 2>&1
+CMD
+    },
+    'setup.pir' => sub {
+        print "Found setup.pir\n";
+        my $cmd =<<CMD;
+HARNESS_VERBOSE=1 parrot setup.pir test >> $logfile 2>&1
+CMD
+    },
+    'setup.nqp' => sub {
+        print "Found setup.nqp\n";
+        my $cmd =<<CMD;
+HARNESS_VERBOSE=1 parrot-nqp setup.nqp test >> $logfile 2>&1
+CMD
+    },
+    'Configure.pl' => sub {
+        print "Found Configure.pl\n";
+        my $cmd =<<CMD;
+perl Configure.pl >> $logfile 2>&1
+cpanm --installdeps . >> $logfile 2>&1
+HARNESS_VERBOSE=1 make test >> $logfile 2>&1
+CMD
+    },
+    'Makefile' => sub {
+        print "Found a Makefile\n";
+        my $cmd =<<CMD;
+make test >> $logfile 2>&1
+CMD
+    },
+    'Rakefile' => sub {
+        print "Found a Rakefile\n";
+        my $cmd =<<CMD;
+rake test >> $logfile 2>&1
 CMD
     },
 };