Make source JARs for {extension,plugin}-api targets
BUCK is currently lacking native support for source jar generation. Generate sources JARs for the API manually, until BUCK supports it. Change-Id: I64fda0fdd82ca3ca37ac46d74e9550b2d9dddb39
This commit is contained in:
parent
e1f8288fc7
commit
df36b6a972
29
BUCK
29
BUCK
@ -8,11 +8,13 @@ gerrit_war(name = 'release', context = DOCS + ['//plugins:core.zip'])
|
||||
|
||||
genrule(
|
||||
name = 'api',
|
||||
cmd = 'echo',
|
||||
cmd = '',
|
||||
srcs = [],
|
||||
deps = [
|
||||
':extension-api',
|
||||
':extension-api-src',
|
||||
':plugin-api',
|
||||
':plugin-api-src',
|
||||
],
|
||||
out = '__fake.api__',
|
||||
)
|
||||
@ -29,18 +31,33 @@ java_library(
|
||||
export_deps = True,
|
||||
visibility = ['PUBLIC'],
|
||||
)
|
||||
genrule(
|
||||
name = 'extension-api-src',
|
||||
cmd = 'ln -s $DEPS $OUT',
|
||||
srcs = [],
|
||||
deps = ['//gerrit-extension-api:api-src'],
|
||||
out = 'extension-api-src.jar',
|
||||
)
|
||||
|
||||
PLUGIN_API = [
|
||||
'//gerrit-server:server',
|
||||
'//gerrit-sshd:sshd',
|
||||
'//gerrit-httpd:httpd',
|
||||
]
|
||||
|
||||
java_binary(name = 'plugin-api', deps = [':plugin-lib'])
|
||||
java_library(
|
||||
name = 'plugin-lib',
|
||||
deps = [
|
||||
'//gerrit-server:server',
|
||||
'//gerrit-sshd:sshd',
|
||||
'//gerrit-httpd:httpd',
|
||||
],
|
||||
deps = PLUGIN_API,
|
||||
export_deps = True,
|
||||
visibility = ['PUBLIC'],
|
||||
)
|
||||
java_binary(
|
||||
name = 'plugin-api-src',
|
||||
deps = [
|
||||
'//gerrit-extension-api:api-src',
|
||||
] + [d + '-src' for d in PLUGIN_API],
|
||||
)
|
||||
|
||||
genrule(
|
||||
name = 'download',
|
||||
|
@ -1,6 +1,14 @@
|
||||
SRCS = glob(['src/main/java/com/google/gerrit/extensions/**/*.java'])
|
||||
|
||||
java_library2(
|
||||
name = 'api',
|
||||
srcs = glob(['src/main/java/com/google/gerrit/extensions/**/*.java']),
|
||||
srcs = SRCS,
|
||||
compile_deps = ['//lib/guice:guice'],
|
||||
visibility = ['PUBLIC'],
|
||||
)
|
||||
|
||||
java_sources(
|
||||
name = 'api-src',
|
||||
srcs = SRCS,
|
||||
visibility = ['PUBLIC'],
|
||||
)
|
||||
|
@ -1,7 +1,10 @@
|
||||
SRCS = glob(['src/main/java/**/*.java'])
|
||||
RESOURCES = glob(['src/main/resources/**/*'])
|
||||
|
||||
java_library2(
|
||||
name = 'httpd',
|
||||
srcs = glob(['src/main/java/**/*.java']),
|
||||
resources = glob(['src/main/resources/**/*']),
|
||||
srcs = SRCS,
|
||||
resources = RESOURCES,
|
||||
deps = [
|
||||
'//gerrit-antlr:query_exception',
|
||||
'//gerrit-common:server',
|
||||
@ -33,6 +36,12 @@ java_library2(
|
||||
visibility = ['PUBLIC'],
|
||||
)
|
||||
|
||||
java_sources(
|
||||
name = 'httpd-src',
|
||||
srcs = SRCS + RESOURCES,
|
||||
visibility = ['PUBLIC'],
|
||||
)
|
||||
|
||||
java_test(
|
||||
name = 'httpd_tests',
|
||||
srcs = glob(['src/test/java/**/*.java']),
|
||||
|
@ -1,10 +1,13 @@
|
||||
include_defs('//lib/prolog/DEFS')
|
||||
|
||||
SRCS = glob(['src/main/java/**/*.java'])
|
||||
RESOURCES = glob(['src/main/resources/**/*'])
|
||||
|
||||
# TODO(sop) break up gerrit-server java_library(), its too big
|
||||
java_library2(
|
||||
name = 'server',
|
||||
srcs = glob(['src/main/java/**/*.java']),
|
||||
resources = glob(['src/main/resources/**/*']),
|
||||
srcs = SRCS,
|
||||
resources = RESOURCES,
|
||||
deps = [
|
||||
'//gerrit-antlr:query_exception',
|
||||
'//gerrit-antlr:query_parser',
|
||||
@ -51,6 +54,12 @@ java_library2(
|
||||
visibility = ['PUBLIC'],
|
||||
)
|
||||
|
||||
java_sources(
|
||||
name = 'server-src',
|
||||
srcs = SRCS + RESOURCES,
|
||||
visibility = ['PUBLIC'],
|
||||
)
|
||||
|
||||
prolog_cafe_library(
|
||||
name = 'common_rules',
|
||||
srcs = ['src/main/prolog/gerrit_common.pl'],
|
||||
|
@ -1,6 +1,8 @@
|
||||
SRCS = glob(['src/main/java/**/*.java'])
|
||||
|
||||
java_library2(
|
||||
name = 'sshd',
|
||||
srcs = glob(['src/main/java/**/*.java']),
|
||||
srcs = SRCS,
|
||||
deps = [
|
||||
'//gerrit-extension-api:api',
|
||||
'//gerrit-cache-h2:cache-h2',
|
||||
@ -29,3 +31,9 @@ java_library2(
|
||||
],
|
||||
visibility = ['PUBLIC'],
|
||||
)
|
||||
|
||||
java_sources(
|
||||
name = 'sshd-src',
|
||||
srcs = SRCS,
|
||||
visibility = ['PUBLIC'],
|
||||
)
|
||||
|
11
tools/DEFS
11
tools/DEFS
@ -156,3 +156,14 @@ def gerrit_plugin(
|
||||
],
|
||||
visibility = visibility,
|
||||
)
|
||||
|
||||
def java_sources(
|
||||
name,
|
||||
srcs,
|
||||
visibility = []
|
||||
):
|
||||
java_library(
|
||||
name = name,
|
||||
resources = srcs,
|
||||
visibility = visibility,
|
||||
)
|
||||
|
Loading…
x
Reference in New Issue
Block a user