Bazel: Allow plugins to non-transitively depend on prolog rules
Some plugins, most notably owners-plugin, depend on prolog:common rule. Given that this rule transitively depends on gerrit-server:server rule, and this rule depends on virtually whole gerrit build graph, the final plugin artifact contains effectively the whole gerrit war file content. To fix that we expose prolog:common in plugin API. Moreover, adjust prolog_cafe_library to not transitively depend on prolog runtime library. We can do it, because gerrit-server already depends on it, so that it's included in gerrit war anyway. This change allows the owners-plugin to de-duplicate its size from 45 MB to 1.5 MB only. Change-Id: I8d7198a911c2da444c1822509988eda7d369af77
This commit is contained in:
parent
bc9ea8ce0b
commit
b9400254a6
|
@ -19,6 +19,7 @@ EXPORTS = [
|
||||||
"//gerrit-extension-api:api",
|
"//gerrit-extension-api:api",
|
||||||
"//gerrit-gwtexpui:server",
|
"//gerrit-gwtexpui:server",
|
||||||
"//gerrit-reviewdb:server",
|
"//gerrit-reviewdb:server",
|
||||||
|
"//gerrit-server/src/main/prolog:common",
|
||||||
"//lib/commons:lang",
|
"//lib/commons:lang",
|
||||||
"//lib/commons:lang3",
|
"//lib/commons:lang3",
|
||||||
"//lib/dropwizard:dropwizard-core",
|
"//lib/dropwizard:dropwizard-core",
|
||||||
|
|
|
@ -5,6 +5,13 @@ java_library(
|
||||||
exports = ["@prolog_runtime//jar"],
|
exports = ["@prolog_runtime//jar"],
|
||||||
)
|
)
|
||||||
|
|
||||||
|
java_library(
|
||||||
|
name = "runtime-neverlink",
|
||||||
|
data = ["//lib:LICENSE-prologcafe"],
|
||||||
|
visibility = ["//visibility:public"],
|
||||||
|
exports = ["@prolog_runtime//jar:neverlink"],
|
||||||
|
)
|
||||||
|
|
||||||
java_library(
|
java_library(
|
||||||
name = "compiler",
|
name = "compiler",
|
||||||
data = ["//lib:LICENSE-prologcafe"],
|
data = ["//lib:LICENSE-prologcafe"],
|
||||||
|
|
|
@ -31,6 +31,6 @@ def prolog_cafe_library(
|
||||||
native.java_library(
|
native.java_library(
|
||||||
name = name,
|
name = name,
|
||||||
srcs = [':' + name + '__pl2j'],
|
srcs = [':' + name + '__pl2j'],
|
||||||
deps = ['//lib/prolog:runtime'] + deps,
|
deps = ['//lib/prolog:runtime-neverlink'] + deps,
|
||||||
**kwargs
|
**kwargs
|
||||||
)
|
)
|
||||||
|
|
Loading…
Reference in New Issue