forked from SeleniumHQ/selenium
-
Notifications
You must be signed in to change notification settings - Fork 0
/
library.bzl
38 lines (32 loc) · 1.03 KB
/
library.bzl
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
load("@apple_rules_lint//lint:defs.bzl", "get_lint_config")
load(
"@rules_java//java:defs.bzl",
_java_binary = "java_binary",
_java_library = "java_library",
_java_test = "java_test")
load(":export.bzl", _java_export = "java_export")
load(":spotbugs.bzl", "spotbugs_test")
def _add_lint_tests(name, **kwargs):
srcs = kwargs.get("srcs", [])
if len(srcs) == 0:
return
tags = kwargs.get("tags", [])
spotbugs = get_lint_config("java-spotbugs", tags)
if spotbugs != None:
spotbugs_test(
name = "%s-spotbugs" % name,
config = spotbugs,
only_output_jars = True,
deps = [
":%s" % name,
],
tags = tags + ["lint", "java-spotbugs"],
size = "small",
timeout = "moderate",
)
def java_export(name, **kwargs):
_add_lint_tests(name, **kwargs)
_java_export(name = name, **kwargs)
def java_library(name, **kwargs):
_add_lint_tests(name, **kwargs)
_java_library(name = name, **kwargs)