Static framework resources in tests and Metal embedding
This example reproduces two issues that can happen after stopping bundle generation for static frameworks and validates the fixes:
- Unit tests that depend on a static framework with resources should resolve
Bundle.modulewhen running underxctesteven if the app target does not link XCTest. - A static framework that only contains Metal sources should still be embedded so the generated
default.metallibis available at runtime.
Structure
StaticResourcesFrameworkis a static framework with a bundledMessage.txtresource.StaticMetalFrameworkis a static framework that only contains a.metalfile.AppTestsreads the resource viaBundle.modulefromStaticResourcesFramework.Appis a SwiftUI app that should embedStaticMetalFramework.frameworksodefault.metallibis present.
Run
From this directory:
tuist generateOptionally run tests on a simulator:
tuist test App --device "<available simulator name>"