Revision: 92
Author: tim.bunce
Date: Tue Aug 11 06:35:12 2009
Log: Added pod docs to mkjdbc.pl.
Added 'java.math.BigDecimal' => 'Rat' to TypeCast.
Removed -c from --check perl6 call as it's noisy and not needed.
http://code.google.com/p/java2perl6/source/detail?r=92
Modified:
/trunk/bin/java2perl6
/trunk/lib/Java/Javap/TypeCast.pm
/trunk/mkjdbc.pl
=======================================
--- /trunk/bin/java2perl6 Tue Aug 11 06:10:39 2009
+++ /trunk/bin/java2perl6 Tue Aug 11 06:35:12 2009
@@ -128,7 +128,9 @@
if ($opt_check && $file_name) {
warn "$pad$kind $class: checking $file_name\n";
(my $pirfile = $file_name) =~ s/\.pm$/.pir/;
- my @perl6cmd =
("perl6", "-c", "--target=PIR", "--output=$pirfile", $file_name);
+ # we're effectively doing perl6 -c here but we don't use -c
+ # because it's noisy and we know we're only compiling modules
+ my @perl6cmd = ("perl6", "--target=PIR", "--output=$pirfile",
$file_name);
local $ENV{PERL6LIB} = join(":",grep { $_ }
$outdir,$ENV{PERL6LIB});
$check_status{$file_name} = (system(@perl6cmd) == 0);
}
=======================================
--- /trunk/lib/Java/Javap/TypeCast.pm Tue Aug 11 03:11:17 2009
+++ /trunk/lib/Java/Javap/TypeCast.pm Tue Aug 11 06:35:12 2009
@@ -19,7 +19,8 @@
'java.lang.Appendable' => 'Object',
'java.math.BigInteger' => 'Int',
- 'java.math.BigNumber' => 'Int',
+ 'java.math.BigNumber' => 'Num',
+ 'java.math.BigDecimal' => 'Rat',
'java.net.URI' => 'Str',
'java.net.URL' => 'Str',
=======================================
--- /trunk/mkjdbc.pl Tue Aug 11 06:11:40 2009
+++ /trunk/mkjdbc.pl Tue Aug 11 06:35:12 2009
@@ -1,6 +1,26 @@
#!/usr/bin/env perl
-# process and check the classes related to JDBC (listed in
jdbc_classes.txt)
+=head1 NAME
+
+mkjdbc.pl - generate the perl6 translation of the classes related to JDBC
+
+=head1 SYNOPSIS
+
+ perl mkjdbc.pl
+
+=head
+
+This is just a quick hack to exercise java2perl6 with the use case that
+interests us most: JDBC.
+
+The jdbc_classes.txt class file lists the Java classes related to JDBC.
+This script translates those classes into the corresponding perl6 classes
and
+roles in the jdbclib directory.
+
+If a jdbclib directory already exists it's renamed to jdbclib.prev and, at
the
+end of the run, the contents of the directory are compared.
+
+=cut
use strict;
use warnings;
@@ -17,5 +37,6 @@
system qq{time perl -Mblib blib/script/java2perl6 --outdir $outdir
--recurse --nest --check @ARGV `cat jdbc_classes.txt`};
-system qq{diff -r -u $outdir.prev $outdir} if -d "$outdir.prev";
-
+system qq{diff -r -u $outdir.prev $outdir} || warn "Output differs\n"
+ if -d "$outdir.prev";
+