Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions base/cvd/cuttlefish/bazel/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,13 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

load("//cuttlefish/bazel:rules.bzl", "cf_build_test")

cf_build_test(
name = "cf_build_test",
srcs = [
"local.bzl",
"rules.bzl",
],
)
1 change: 0 additions & 1 deletion base/cvd/cuttlefish/bazel/local.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ def _common_attrs():
}

def _local_repository_impl(repository_ctx):

target = repository_ctx.path(repository_ctx.attr.path)
for child in target.readdir():
repository_ctx.symlink(child, repository_ctx.path(child.basename))
Expand Down
19 changes: 12 additions & 7 deletions base/cvd/cuttlefish/bazel/rules.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,11 @@
# See the License for the specific language governing permissions and
# limitations under the License.

"""
Macros wrapping executable, library, and test targets that generate linter
invocation targets.
"""

load("@aspect_rules_lint//format:defs.bzl", "format_test")
load("@cc_compatibility_proxy//:proxy.bzl", "cc_binary", "cc_library", "cc_test")
load("@rules_shell//shell:sh_binary.bzl", "sh_binary")
Expand All @@ -33,7 +38,7 @@ def _cf_build_test_implementation(name, srcs, **kwargs):
buildifier_test(
name = name + "_LINT_TEST",
srcs = [":" + name + "_LINT_TEST_starlark_files"],
**kwargs,
**kwargs
)

cf_build_test = macro(
Expand All @@ -42,7 +47,7 @@ cf_build_test = macro(
"srcs": attr.label_list(
configurable = False,
default = [],
)
),
},
implementation = _cf_build_test_implementation,
)
Expand All @@ -54,7 +59,7 @@ def _cf_cc_binary_implementation(name, clang_format_enabled, clang_tidy_enabled,
name = name,
copts = (copts or []) + COPTS,
linkopts = (linkopts or []) + LINKOPTS,
**kwargs,
**kwargs
)
if clang_format_enabled:
format_test(
Expand Down Expand Up @@ -89,7 +94,7 @@ def _cf_cc_library_implementation(name, clang_format_enabled, clang_tidy_enabled
cc_library(
name = name,
copts = (copts or []) + COPTS,
**kwargs,
**kwargs
)
if clang_format_enabled:
format_test(
Expand Down Expand Up @@ -127,7 +132,7 @@ def _cf_cc_test_implementation(name, clang_format_enabled, clang_tidy_enabled, c
"@googletest//:gtest",
"@googletest//:gtest_main",
],
**kwargs,
**kwargs
)
if clang_format_enabled:
format_test(
Expand Down Expand Up @@ -159,7 +164,7 @@ cf_cc_test = macro(
def _cf_sh_binary_implementation(name, shellcheck_enabled, **kwargs):
sh_binary(
name = name,
**kwargs,
**kwargs
)
if shellcheck_enabled:
shellcheck_test(
Expand All @@ -180,7 +185,7 @@ cf_sh_binary = macro(
def _cf_sh_library_implementation(name, shellcheck_enabled, **kwargs):
sh_library(
name = name,
**kwargs,
**kwargs
)
if shellcheck_enabled:
shellcheck_test(
Expand Down
Loading