forked from wix/greyhound
-
Notifications
You must be signed in to change notification settings - Fork 0
/
macros.bzl
26 lines (21 loc) · 860 Bytes
/
macros.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
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
def resources(name = "resources", runtime_deps=[], testonly = 0, tags = [], visibility=None):
native.java_library(
name = name,
resources = native.glob(["**"],exclude=["BUILD"]),
resource_strip_prefix = "%s/" % native.package_name(),
runtime_deps = runtime_deps,
testonly = testonly,
tags = tags,
visibility = visibility
)
def _package_visibility(pacakge_name):
return ["//{p}:__pkg__".format(p=pacakge_name)]
def sources(visibility = None):
if visibility == None:
visibility = _package_visibility(native.package_name())
native.filegroup(
name = "sources",
srcs = native.glob(["*.java"], allow_empty=True) + native.glob(["*.scala"], allow_empty=True),
visibility = visibility,
)