gerrit/lib/local.defs
David Ostrovsky 188bd78785 Buck: Align gerrit build interface to bucklets
Bucklets are reusable building blocks for buck driven build. Many
bucklets match Gerrit's own methods and were derived from them. To
enable buck driven build of gerrit plugins bucklets, are used. This
simplifies the implementation without need of code duplication. The
problem is however, that unlike maven driven build, in gerrit tree
build mode is supported for plugins.  Because of mismatch of buck
build interface between gerrit core and bucklets this currently can
not be done. This change synchronizes the interfaces between gerrit
and bucklets by exposing building blocks that are shared between gerrit
and bucklets in own files and linking them from bucklets directory.
That way bucklets can be (re-)used from both build modes: in gerrit
tree and standalone.

Change-Id: I8457b99936f009b4bc531f3b5633e4f19cb3b676
2014-09-09 13:20:47 +00:00

34 lines
704 B
Plaintext

def local_jar(
name,
jar,
src = None,
deps = [],
visibility = ['PUBLIC']):
binjar = name + '.jar'
srcjar = name + '-src.jar'
genrule(
name = '%s__local_bin' % name,
cmd = 'ln -s %s $OUT' % jar,
out = binjar)
if src:
genrule(
name = '%s__local_src' % name,
cmd = 'ln -s %s $OUT' % src,
out = srcjar)
prebuilt_jar(
name = '%s_src' % name,
binary_jar = ':%s__local_src' % name,
visibility = visibility,
)
else:
srcjar = None
prebuilt_jar(
name = name,
deps = deps,
binary_jar = ':%s__local_bin' % name,
source_jar = ':%s__local_src' % name if srcjar else None,
visibility = visibility,
)