Skip to content

Prepare and stage resource bundles for native Previews - #3354

Draft
karim-alweheshy wants to merge 1 commit into
preview-stack-native-previews-v2from
preview-stack-resources-v2
Draft

karim-alweheshy wants to merge 1 commit into
preview-stack-native-previews-v2from
preview-stack-resources-v2

Conversation

@karim-alweheshy

Copy link
Copy Markdown
Contributor

Summary

  • Track resource-bundle files and owners needed by native Xcode Previews.
  • Materialize and stage the selected Preview's owned resources across Bazel
    output locations, preserving bundle-relative paths for app- and
    library-owned Previews.
  • Make migrations ownership-aware: reject conflicting or unowned destinations
    and recover interrupted moves without deleting resources owned elsewhere.

Based on branch preview-stack-native-previews-v2. This adds resource-bundle
support to its resource-free native Preview opt-in without changing ordinary
Bazel-owned configurations.

Review order

  1. Resource discovery/materialization and dual-aspect tests: retain exact
    producers, nested paths, asset catalogs and localization inputs.
  2. Provider propagation, br output groups and generated bundle-path settings:
    check the contract for app, library and mixed-language targets.
  3. Copy/staging ownership and migration tests: check that conflicting producers
    and destinations fail without overwriting unowned files.

Validation

This resegmented branch has exactly the same Git tree as the previously
CLI-validated candidate. Root tests and lint are rerun at this head. The example
CLI/build/staging evidence below is reused from that identical tree, not claimed
as a new execution during this split.

  • All 140 root Bazel 9 test targets plus the generated-docs test pass at the
    proposed head on macOS with Xcode 27.0. Repository Buildifier passes.
  • Resource regressions cover dual-aspect discovery, generated and localized
    inputs, asset catalogs, output-group ownership, conflicts and interrupted
    migrations. Changed copy/staging shell scripts pass ShellCheck.
  • The checked-in example generates with rules_swift 3.5 and rules_apple 4.4.
    Previews-configuration CLI builds pass for library, framework, explicit-module,
    macOS app and generic iOS Simulator schemes with signing disabled.
  • The staged message matches its source in the macOS app resource directory,
    iOS app bundle, and library-product sibling bundle; each bundle plist validates.

These are build/staging checks. Fresh Canvas rendering, runtime resource lookup
and signed-runtime verification remain pending for this extracted stack.

Testing

  • Run the focused resource-bundle and migration tests, including conflict,
    ownership, and interrupted-migration cases.
  • Generate and build the example with a resource bundle used by an app-owned
    Preview and a library-owned Preview; verify staged bundle contents and runtime
    lookup at the intended bundle location.
  • When Canvas validation is available, request each affected Preview and confirm
    the expected view renders and loads its resource. A successful build or
    staged-file check alone does not establish Canvas rendering.

Signed-off-by: Karim Alweheshy <karim.alweheshy@reddit.com>
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.

1 participant