def _plugin_targets(self, compiler):
    """Returns a map from plugin name to the targets that build that plugin."""
    if compiler == 'javac':
      plugin_cls = JavacPlugin
    elif compiler == 'scalac':
      plugin_cls = ScalacPlugin
    else:
      raise TaskError('Unknown JVM compiler: {}'.format(compiler))
    plugin_tgts = self.context.targets(predicate=lambda t: isinstance(t, plugin_cls))
    return {t.plugin: t.closure() for t in plugin_tgts}
Returns a map from plugin name to the targets that build that plugin.