Skip to content

Create xcodeproj_extra_files aspect hint #3150

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

jflan-dd
Copy link

Create an aspect hint to allow dependencies to propagate up extra files that should be include in the Xcode navigator

@@ -34,6 +35,7 @@ project_options = _project_options
top_level_target = _top_level_target
top_level_targets = _top_level_targets
xcodeproj = _xcodeproj
xcodeproj_extra_files = _xcodeproj_extra_files
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We are moving away from a single file for loads, so let’s instead just have the aspect hint live one level up.

@@ -36,6 +37,7 @@ genrule(
":xcode_schemes",
":xcode_build_settings",
":providers",
":aspect_hints",
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is giving me an error. I tried to mimic the setup for the other sets of documentation, but I think the issues is that this is the first one where the implementation is at the root of xcodeproj/ rather than in xcodeproj/internal/

ERROR: /Users/johnflanagan/Projects/src/rules_xcodeproj/docs/BUILD:19:12: in deps attribute of starlark_doc_extract rule //docs:aspect_hints.extract: missing bzl_library targets for Starlark module(s) //xcodeproj:xcodeproj_extra_files.bzl. Since this rule was created by the macro 'stardoc', the error might have been caused by the macro implementation
ERROR: /Users/johnflanagan/Projects/src/rules_xcodeproj/docs/BUILD:19:12: Analysis of target '//docs:aspect_hints.extract' failed
ERROR: Analysis of target '//docs:update' failed; build aborted: Analysis failed


target_under_test = analysistest.target_under_test(env)

asserts.equals(env, depset(["BUILD"]), target_under_test[XcodeProjExtraFilesHintInfo].files)
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is failing with:

DEBUG: /Users/johnflanagan/Projects/src/rules_xcodeproj/bazel-output-base/external/bazel_skylib+/lib/unittest.bzl:465:10: In test _provider_contents_test_impl from //test/internal/xcodeproj_extra_files:xcodeproj_extra_files_tests.bzl: Expected "depset(["BUILD"])", but got "depset([<source file test/internal/xcodeproj_extra_files/BUILD>])"

@jflan-dd jflan-dd changed the title extra_files aspect hint Create xcodeproj_extra_files aspect hint Mar 27, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants