Skip to content

Commit

Permalink
Merge pull request #306 from mitza-oci/master
Browse files Browse the repository at this point in the history
TYPESUPPORTHelper (for Java bindings): provide extra dependency info to MPC
  • Loading branch information
mitza-oci committed Sep 23, 2016
2 parents 6c2f4b1 + 254726f commit ef15f57
Showing 1 changed file with 12 additions and 5 deletions.
17 changes: 12 additions & 5 deletions MPC/modules/TYPESUPPORTHelper.pm
Expand Up @@ -23,10 +23,10 @@ sub get_output {
$tsidl =~ s/\.idl$/TypeSupport.idl/;
push(@out, $dir . basename($tsidl));

my $i2j = CommandHelper::get('idl2jni_files');

my $deps;
if ($flags =~ /-Wb,java/) {

my $i2j = CommandHelper::get('idl2jni_files');
$i2j->do_cached_parse($file, $flags);

my $tsfile = $tsidl;
Expand All @@ -36,8 +36,14 @@ sub get_output {
if (defined $tsinfo) {
my @types = split /;/, $tsinfo;
foreach my $type (@types) {
$type =~ s/::/\//g;
push(@out, $dir . $type . 'TypeSupportImpl.java');
my @parts = split /::/, $type;
my $tsimpl = $dir . join('/', @parts) . 'TypeSupportImpl.java';
push(@out, $tsimpl);
my $peer_base = pop @parts;
my $peer = $dir . join('/', @parts);
$peer .= '/' if length $peer;
$peer .= '_' . $peer_base . 'TypeSupportTAOPeer.java';
$deps->{'java_files'}->{$tsimpl} = [$peer];
}
}
}
Expand All @@ -49,7 +55,8 @@ sub get_output {
}
}

return \@out;
# check for list context for compatibility with older MPC
return wantarray ? (\@out, $deps) : \@out;
}

sub get_outputexts {
Expand Down

0 comments on commit ef15f57

Please sign in to comment.