mirror of https://github.com/apache/lucene.git
improved messages and bug fixes to stub generation
git-svn-id: https://svn.apache.org/repos/asf/lucene/solr/trunk@724624 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
d3f89a21ac
commit
4d0a1f76fc
|
@ -283,7 +283,7 @@
|
|||
</linecontainsregexp>
|
||||
<linecontainsregexp negate="true">
|
||||
<!-- no way to leverage these in Solr (yet) -->
|
||||
<regexp pattern="Sink\|Tee"/>
|
||||
<regexp pattern="Sink|Tee"/>
|
||||
</linecontainsregexp>
|
||||
<linecontainsregexp negate="true">
|
||||
<!-- Solr already has a different impl for this -->
|
||||
|
|
|
@ -43,6 +43,8 @@ use warnings;
|
|||
use File::Find;
|
||||
|
||||
|
||||
my $errors = 0;
|
||||
|
||||
my %classes = ();
|
||||
while (<STDIN>) {
|
||||
chomp;
|
||||
|
@ -106,13 +108,21 @@ sub wanted {
|
|||
} split /\s*,\s*/, $argline;
|
||||
|
||||
# wacky, doesn't use Reader or TokenStream ... skip (maybe a Sink?)
|
||||
return unless defined $mainArgType;
|
||||
unless (defined $mainArgType) {
|
||||
warn "$class doesn't have a constructor with a Reader or TokenStream\n";
|
||||
return;
|
||||
}
|
||||
|
||||
my $type = ("Reader" eq $mainArgType) ? "Tokenizer" : "TokenFilter";
|
||||
|
||||
my $facClass = "${class}Factory";
|
||||
my $facFile = "${facClass}.java";
|
||||
die "$facFile exists" if -e $facFile;
|
||||
|
||||
if (-e $facFile) {
|
||||
warn "$facFile already exists (maybe the return type isn't specific?)";
|
||||
$errors++;
|
||||
return;
|
||||
}
|
||||
open my $o, ">", $facFile
|
||||
or die "can't write to $facFile: $!";
|
||||
|
||||
|
@ -140,15 +150,17 @@ sub wanted {
|
|||
|
||||
delete $classes{$fullname}; # we're done with this one
|
||||
} else {
|
||||
print STDERR "can't stub $class\n";
|
||||
print STDERR "can't stub $class (no public constructor?)\n";
|
||||
$errors++;
|
||||
}
|
||||
}
|
||||
|
||||
if (keys %classes) {
|
||||
print STDERR "Can't find java files for...\n";
|
||||
print STDERR "Can't stub (or find java files) for...\n";
|
||||
foreach (keys %classes) {
|
||||
print STDERR "$_\n";
|
||||
}
|
||||
exit -1;
|
||||
$errors++;
|
||||
}
|
||||
exit -1 if $errors;
|
||||
|
||||
|
|
Loading…
Reference in New Issue