Bazel: Generate source dir for plugins in eclipse classpath

Change-Id: I9f71808b2ce6b29523143bcc98de4a5f50a5dc94
This commit is contained in:
David Ostrovsky 2016-11-23 22:07:09 +01:00 committed by David Ostrovsky
parent c04343eaad
commit 64e1aff339
3 changed files with 20 additions and 13 deletions

View File

@ -1,17 +1,9 @@
load('//tools/bzl:genrule2.bzl', 'genrule2')
CORE = [
'commit-message-length-validator',
'download-commands',
'hooks',
'replication',
'reviewnotes',
'singleusergroup'
]
load('//tools/bzl:plugins.bzl', 'CORE_PLUGINS')
genrule2(
name = 'core',
srcs = ['//plugins/%s:%s.jar' % (n, n) for n in CORE],
srcs = ['//plugins/%s:%s.jar' % (n, n) for n in CORE_PLUGINS],
cmd = 'mkdir -p $$TMP/WEB-INF/plugins;' +
'for s in $(SRCS) ; do ' +
'ln -s $$ROOT/$$s $$TMP/WEB-INF/plugins;done;' +

12
tools/bzl/plugins.bzl Normal file
View File

@ -0,0 +1,12 @@
CORE_PLUGINS = [
'commit-message-length-validator',
'download-commands',
'hooks',
'replication',
'reviewnotes',
'singleusergroup',
]
CUSTOM_PLUGINS = [
'cookbook-plugin',
]

View File

@ -1,5 +1,8 @@
load('//tools/bzl:pkg_war.bzl', 'LIBS', 'PGMLIBS')
load('//tools/bzl:classpath.bzl', 'classpath_collector')
load('//tools/bzl:plugins.bzl',
'CORE_PLUGINS',
'CUSTOM_PLUGINS')
PROVIDED_DEPS = [
'//lib/bouncycastle:bcprov',
@ -48,10 +51,10 @@ java_library(
classpath_collector(
name = 'main_classpath_collect',
deps = LIBS + PGMLIBS + DEPS + TEST_DEPS + PROVIDED_DEPS,
deps = LIBS + PGMLIBS + DEPS + TEST_DEPS + PROVIDED_DEPS +
['//plugins/%s:%s__plugin' % (n, n)
for n in CORE_PLUGINS + CUSTOM_PLUGINS],
testonly = 1,
# TODO(davido): Handle plugins
#scan_plugins(),
)
classpath_collector(