Merge "Extend gerrit_plugin() with manifest_entries"

This commit is contained in:
Shawn Pearce 2013-06-03 12:16:43 +00:00 committed by Gerrit Code Review
commit cd9b933274

View File

@ -118,6 +118,7 @@ def gerrit_extension(
srcs = [],
resources = [],
manifest_file = None,
manifest_entries = [],
visibility = ['PUBLIC']):
gerrit_plugin(
name = name,
@ -125,6 +126,7 @@ def gerrit_extension(
srcs = srcs,
resources = resources,
manifest_file = manifest_file,
manifest_entries = manifest_entries,
type = 'extension',
visibility = visibility,
)
@ -135,6 +137,7 @@ def gerrit_plugin(
srcs = [],
resources = [],
manifest_file = None,
manifest_entries = [],
type = 'plugin',
visibility = ['PUBLIC']):
mf_cmd = 'v=$(git describe HEAD);'
@ -146,6 +149,8 @@ def gerrit_plugin(
mf_cmd += 'echo "Manifest-Version: 1.0" >$OUT;'
mf_cmd += 'echo "Gerrit-ApiType: %s" >>$OUT;' % type
mf_cmd += 'echo "Implementation-Version: $v" >>$OUT'
for line in manifest_entries:
mf_cmd += ';echo "%s" >> $OUT' % line
genrule(
name = name + '__manifest',
cmd = mf_cmd,