From 06d8295d0a43ac770aea13751585b8f13a58f90c Mon Sep 17 00:00:00 2001 From: Russell Hancox Date: Tue, 19 Feb 2019 12:20:30 -0500 Subject: [PATCH] Project: Use apple_resource_group for test resources. Fix bazelrc (#351) --- .bazelrc | 2 +- Source/SantaGUI/BUILD | 8 ++++---- helper.bzl | 10 ++++++++++ 3 files changed, 15 insertions(+), 5 deletions(-) diff --git a/.bazelrc b/.bazelrc index 3f6f0bbc..ff5190d9 100644 --- a/.bazelrc +++ b/.bazelrc @@ -1 +1 @@ -common --apple_generate_dsym --define=apple.propagate_embedded_extra_outputs=yes +build --apple_generate_dsym --define=apple.propagate_embedded_extra_outputs=yes diff --git a/Source/SantaGUI/BUILD b/Source/SantaGUI/BUILD index eb65b520..bde9f943 100644 --- a/Source/SantaGUI/BUILD +++ b/Source/SantaGUI/BUILD @@ -23,14 +23,14 @@ objc_library( "SNTNotificationManager.m", "main.m", ], + data = [ + "Resources/AboutWindow.xib", + "Resources/MessageWindow.xib", + ], sdk_frameworks = [ "IOKit", "SecurityInterface", ], - xibs = [ - "Resources/AboutWindow.xib", - "Resources/MessageWindow.xib", - ], deps = [ "//Source/common:SNTBlockMessage", "//Source/common:SNTConfigurator", diff --git a/helper.bzl b/helper.bzl index 7c536fa6..bd4c05d9 100644 --- a/helper.bzl +++ b/helper.bzl @@ -1,6 +1,7 @@ """This module defines some helper rules.""" load("@build_bazel_rules_apple//apple:macos.bzl", "macos_unit_test") +load("@build_bazel_rules_apple//apple:resources.bzl", "apple_resource_group") def run_command(name, cmd, **kwargs): """A rule to run a command.""" @@ -21,14 +22,23 @@ def santa_unit_test(name, deps = [], size = "medium", minimum_os_version = "10.9", + resources = [], + structured_resources = [], copts = [], **kwargs): + apple_resource_group( + name = "%s_resources" % name, + resources = resources, + structured_resources = structured_resources, + ) + native.objc_library( name = "%s_lib" % name, testonly = 1, srcs = srcs, deps = deps, copts = copts, + data = [":%s_resources" % name], **kwargs )