blob: b866bf6b15e19c8aac34128cfa35cc8d6d3c0f5e [file] [log] [blame]
gerrit_plugin(
name = 'its-bugzilla',
srcs = glob(['src/main/java/**/*.java']),
resources = glob(['src/main/resources/**/*']),
manifest_entries = [
'Gerrit-Module: com.googlesource.gerrit.plugins.hooks.bz.BugzillaModule',
'Gerrit-InitStep: com.googlesource.gerrit.plugins.hooks.bz.InitBugzilla',
'Gerrit-ReloadMode: reload',
'Implementation-Title: Bugzilla ITS Plugin',
'Implementation-URL: https://www.wikimediafoundation.org',
],
deps = [
':its-base_stripped',
'//plugins/its-bugzilla/lib:j2bugzilla',
],
)
def strip_jar(
name,
src,
excludes = [],
visibility = [],
):
name_zip = name + '.zip'
genrule(
name = name_zip,
cmd = 'cp $SRCS $OUT && zip -qd $OUT ' + ' '.join(excludes),
srcs = [ src ],
deps = [ src ],
out = name_zip,
visibility = visibility,
)
prebuilt_jar(
name = name,
binary_jar = ':' + name_zip,
visibility = visibility,
)
strip_jar(
name = 'its-base_stripped',
src = '//plugins/its-base:its-base',
excludes = [
'Documentation/about.md',
'Documentation/build.md',
'Documentation/config-connectivity.md',
'Documentation/config-rulebase-plugin-actions.md',
]
)
TEST_UTIL_SRC = glob(['src/test/java/com/googlesource/gerrit/plugins/hooks/testutil/**/*.java'])
java_library(
name = 'its-bugzilla_tests-utils',
srcs = TEST_UTIL_SRC,
deps = [
'//lib:guava',
'//lib/easymock:easymock',
'//lib/log:impl_log4j',
'//lib/log:log4j',
'//lib:junit',
'//lib/powermock:powermock-api-easymock',
'//lib/powermock:powermock-api-support',
'//lib/powermock:powermock-core',
'//lib/powermock:powermock-module-junit4',
'//lib/powermock:powermock-module-junit4-common',
],
)
java_test(
name = 'its-bugzilla_tests',
srcs = glob(
['src/test/java/**/*.java'],
excludes = TEST_UTIL_SRC
),
labels = ['its-bugzilla'],
source_under_test = [':its-bugzilla__plugin'],
deps = [
':its-bugzilla__plugin',
':its-bugzilla_tests-utils',
'//gerrit-plugin-api:lib',
'//lib/easymock:easymock',
'//lib:guava',
'//lib/guice:guice',
'//lib/jgit:jgit',
'//lib:junit',
'//lib/log:api',
'//lib/log:impl_log4j',
'//lib/log:log4j',
'//lib/powermock:powermock-api-easymock',
'//lib/powermock:powermock-api-support',
'//lib/powermock:powermock-core',
'//lib/powermock:powermock-module-junit4',
],
)