Buck: Add support for non transitive plugin dependencies

In some cases it might be useful to be able to pass dependencies as non
transitive dependencies, that not included in final plugin binary.

Why? When plugin dependencies are needed in both bootstrap classpath and
in plugin then they must be put in $gerrit_path/lib dir. Having them in lib
and inside the plugin doesn't make much sense.

This change exposes compile_deps parameter to the gerrit_{plugin|extension}
methods. It is possible to create both versions of the plugin: with and without
dependencies.

  gerrit_plugin(
    name = 'javamelody',
    srcs = glob(['src/main/java/**/*.java']),
    resources = glob(['src/main/resources/**/*']),
    manifest_entries = [
      'Gerrit-PluginName: javamelody',
      'Gerrit-Module: com.googlesource.gerrit.plugins.javamelody.Module',
      'Gerrit-HttpModule: com.googlesource.gerrit.plugins.javamelody.HttpModule',
    ],
    deps = [
      '//plugins/javamelody/lib:javamelody',
      '//plugins/javamelody/lib:jrobin',
    ],
  )

  gerrit_plugin(
    name = 'javamelody-no-deps',
    srcs = glob(['src/main/java/**/*.java']),
    resources = glob(['src/main/resources/**/*']),
    manifest_entries = [
      'Gerrit-PluginName: javamelody',
      'Gerrit-Module: com.googlesource.gerrit.plugins.javamelody.Module',
      'Gerrit-HttpModule: com.googlesource.gerrit.plugins.javamelody.HttpModule',
    ],
    compile_deps = [
      '//plugins/javamelody/lib:javamelody',
      '//plugins/javamelody/lib:jrobin',
    ],
  )

Change-Id: Ia274dbeb18de8807f0ab1edf7144f12ff0d02d74
1 file changed