Unable to find Bundle in package target tests when package depends on another package containing resources accessed via Bundle.module

I also use SwiftGen. Just write script for fixing result swift file

swiftgen config run --config swiftgen.yml

sed -i '' "s/Bundle.module/Bundle.myModule/" "Modules/CoreLib/Sources/Resources/XCAssets+Generated.swift"
sed -i '' "s/Bundle.module/Bundle.myModule/" "Modules/CoreLib/Sources/Resources/Strings+Generated.swift"

"sed -i" is just replaces Bundle.module with Bundle.myModule
Also, you can use your own templace for codogeneration. But just replace one with another is simpler (its just temporary workaround anyway)

1 Like