blob: d1c069345e39bdfa8990167d56934b8fddabe1f5 [file] [log] [blame]
load("@rules_java//java:defs.bzl", "java_library")
load("//tools/bzl:genrule2.bzl", "genrule2")
load("//tools/bzl:plugin.bzl", "gerrit_plugin")
gerrit_plugin(
name = "gitiles",
srcs = glob(["src/main/java/**/*.java"]),
manifest_entries = [
"Gerrit-PluginName: gitiles",
"Gerrit-Module: com.googlesource.gerrit.plugins.gitiles.Module",
"Gerrit-HttpModule: com.googlesource.gerrit.plugins.gitiles.HttpModule",
# Gitiles uses /repo to access a repo, so the default plugin layout would
# disallow repos named "static" or "Documentation". Paths starting with +
# are reserved by Gitiles and can't match repos.
"Gerrit-HttpStaticPrefix: +static",
"Gerrit-HttpDocumentationPrefix: +Documentation",
],
resource_jars = [":gitiles-servlet-resources"],
resources = glob(["src/main/resources/**/*"]),
deps = [":gitiles__plugin_deps"],
)
genrule2(
name = "gitiles-servlet-resources",
srcs = ["@gitiles-servlet//jar"],
outs = ["gitiles-servlet-resources.jar"],
cmd = " && ".join([
"unzip -qd $$TMP $(location @gitiles-servlet//jar) \"com/google/gitiles/static/*\"",
"cd $$TMP/com/google/gitiles",
"mv static +static",
"zip -qr $$ROOT/$@ .",
]),
)
java_library(
name = "gitiles__plugin_deps",
visibility = ["//visibility:public"],
exports = [
"@autolink//jar",
"@cm-autolink//jar",
"@commonmark//jar",
"@commons-lang3//jar",
"@gfm-strikethrough//jar",
"@gfm-tables//jar",
"@gitiles-servlet//jar",
"@prettify//jar",
],
)
java_library(
name = "gitiles__classpath_deps",
testonly = 1,
visibility = ["//visibility:public"],
exports = [
":gitiles__plugin",
":gitiles__plugin_deps",
],
)