-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathjava_rule_factory.bzl
More file actions
52 lines (45 loc) · 1.57 KB
/
Copy pathjava_rule_factory.bzl
File metadata and controls
52 lines (45 loc) · 1.57 KB
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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
load(
"@rules_java//java:defs.bzl",
_java_binary = "java_binary",
_java_import = "java_import",
_java_library = "java_library",
_java_test = "java_test",
)
def make_java_rules(java_common_opts,
common_java_binary_runtime_deps,
common_java_test_runtime_deps):
def java_binary(javacopts = [], runtime_deps = [], ignore_common_runtime_deps = False, **kwargs):
runtime_deps_combined = []
if (not ignore_common_runtime_deps):
runtime_deps_combined += common_java_binary_runtime_deps
runtime_deps_combined += runtime_deps
_java_binary(
javacopts = java_common_opts + javacopts,
runtime_deps = runtime_deps_combined,
**kwargs
)
def java_library(javacopts = [], **kwargs):
_java_library(
javacopts = java_common_opts + javacopts,
**kwargs
)
def java_test(javacopts = [], runtime_deps = [], ignore_common_runtime_deps = False, **kwargs):
runtime_deps_combined = []
if (not ignore_common_runtime_deps):
runtime_deps_combined += common_java_test_runtime_deps
runtime_deps_combined += runtime_deps
_java_test(
javacopts = java_common_opts + javacopts,
runtime_deps = runtime_deps_combined,
**kwargs
)
def java_import(**kwargs):
_java_import(
**kwargs
)
return struct(
java_library = java_library,
java_binary = java_binary,
java_test = java_test,
java_import = java_import,
)