forked from ray-project/ray
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathray.bzl
54 lines (51 loc) · 1.99 KB
/
ray.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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
load("@com_github_google_flatbuffers//:build_defs.bzl", "flatbuffer_library_public")
load("@com_github_checkstyle_java//checkstyle:checkstyle.bzl", "checkstyle_test")
def flatbuffer_py_library(name, srcs, outs, out_prefix, includes = [], include_paths = []):
flatbuffer_library_public(
name = name,
srcs = srcs,
outs = outs,
language_flag = "-p",
out_prefix = out_prefix,
include_paths = include_paths,
includes = includes,
)
def flatbuffer_java_library(name, srcs, outs, out_prefix, includes = [], include_paths = []):
flatbuffer_library_public(
name = name,
srcs = srcs,
outs = outs,
language_flag = "-j",
out_prefix = out_prefix,
include_paths = include_paths,
includes = includes,
)
def define_java_module(name, additional_srcs = [], additional_resources = [], define_test_lib = False, test_deps = [], **kwargs):
native.java_library(
name = "org_ray_ray_" + name,
srcs = additional_srcs + native.glob([name + "/src/main/java/**/*.java"]),
resources = native.glob([name + "/src/main/resources/**"]) + additional_resources,
**kwargs
)
checkstyle_test(
name = "org_ray_ray_" + name + "-checkstyle",
target = "//java:org_ray_ray_" + name,
config = "//java:checkstyle.xml",
suppressions = "//java:checkstyle-suppressions.xml",
size = "small",
tags = ["checkstyle"],
)
if define_test_lib:
native.java_library(
name = "org_ray_ray_" + name + "_test",
srcs = native.glob([name + "/src/test/java/**/*.java"]),
deps = test_deps,
)
checkstyle_test(
name = "org_ray_ray_" + name + "_test-checkstyle",
target = "//java:org_ray_ray_" + name + "_test",
config = "//java:checkstyle.xml",
suppressions = "//java:checkstyle-suppressions.xml",
size = "small",
tags = ["checkstyle"],
)