Add "additional_contents" to the list of attributes that the output aspect should propagate to. This should cause the output aspect to pick up macos_application dependencies that were being missed.
PiperOrigin-RevId: 235602496
diff --git a/src/TulsiGenerator/Bazel/tulsi/tulsi_aspects.bzl b/src/TulsiGenerator/Bazel/tulsi/tulsi_aspects.bzl
index a494841..8471985 100644
--- a/src/TulsiGenerator/Bazel/tulsi/tulsi_aspects.bzl
+++ b/src/TulsiGenerator/Bazel/tulsi/tulsi_aspects.bzl
@@ -57,6 +57,7 @@
"_implicit_tests", # test_suites without a `tests` attr have an '$implicit_tests' attr instead.
"test_bundle",
"test_host",
+ "additional_contents", # macos_application can specify a dict with supported rules as keys.
# Special attribute name which serves as an escape hatch intended for custom
# rule creators who use non-standard attribute names for rule dependencies
# and want those dependencies to show up in Xcode.
@@ -459,6 +460,8 @@
if type(val) == "list":
return val
+ elif type(val) == "dict":
+ return val.keys()
return [val]
def _extract_defines_from_option_list(lst):
diff --git a/src/TulsiGeneratorIntegrationTests/Resources/Mac.BUILD b/src/TulsiGeneratorIntegrationTests/Resources/Mac.BUILD
index 55f100e..5b74f43 100644
--- a/src/TulsiGeneratorIntegrationTests/Resources/Mac.BUILD
+++ b/src/TulsiGeneratorIntegrationTests/Resources/Mac.BUILD
@@ -21,11 +21,15 @@
"macos_extension",
"macos_unit_test",
"macos_ui_test",
+ "macos_bundle",
)
load("@build_bazel_rules_apple//apple:versioning.bzl", "apple_bundle_version")
macos_application(
name = "MyMacOSApp",
+ additional_contents = dict({
+ "MyPlugin": "PlugIns",
+ }.items()),
app_icons = [":MacAppIcon.xcassets"],
bundle_id = "com.example.mac-app",
extensions = [
@@ -73,11 +77,29 @@
deps = [":MyTodayExtensionSources"],
)
+macos_bundle(
+ name = "MyPlugin",
+ bundle_extension = "bundle",
+ bundle_id = "com.example.mac-app.plugin",
+ bundle_name = "MyPlugin",
+ infoplists = [":MyPlugin_Info.plist"],
+ minimum_os_version = "10.13",
+ version = ":MyPlugInVersion",
+ deps = [
+ ":MyPluginSources",
+ ],
+)
+
apple_bundle_version(
name = "MyTodayExtensionVersion",
build_version = "1.0",
)
+apple_bundle_version(
+ name = "MyPlugInVersion",
+ build_version = "1.0",
+)
+
objc_library(
name = "MyTodayExtensionSources",
srcs = [
@@ -92,6 +114,20 @@
],
)
+objc_library(
+ name = "MyPluginSources",
+ srcs = [
+ "src/plugin/PluginViewController.h",
+ "src/plugin/PluginViewController.m",
+ ],
+ resources = [
+ "Resources/plugin/PluginViewController.xib",
+ ],
+ sdk_frameworks = [
+ "NotificationCenter",
+ ],
+)
+
macos_command_line_application(
name = "MyCommandLineApp",
bundle_id = "com.example.command-line",