1 # This file is part of the DEPS/graph-includes package
3 # (c) 2009 Yann Dirson <ydirson@altern.org>
4 # Distributed under version 2 of the GNU GPL.
6 package graphincludes
::extractor
::java
;
10 use File
::Spec
::Functions
qw(catfile);
12 use base
qw(graphincludes::extractor);
14 use graphincludes
::params
;
16 # This is only a preliminary extractor for java dependencies.
17 # Does not try to do anything with .class
19 # sub get_default_sysincludes {
20 # # since this program does mess wih @INC, we must ask another perl
21 # # what it thinks @INC is
22 # open INC, 'perl -e \'print join "\n", @INC\' |';
33 sub pattern
{ '\.java$' }
39 @ARGV = map {$_->{LABEL
}} $graph->get_nodes();
42 if (m/^\s*import\s+(\S+);/) {
43 print STDERR
"Found import: $_" if $graphincludes::params
::debug
;
46 $dstfile = $self->locatefile ($import . '.java', @graphincludes::params
::inclpath
);
52 if (defined $dstfile) {
53 $graph->record_edge ($ARGV, $dstfile);
55 $self->record_missed_dep ($ARGV, catfile
(split(/\./, $1)) . '.java');