Skip to content
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

Invalid redeclaration of 'bundle' on v7.x #771

Open
ilkerc opened this issue Nov 30, 2022 · 1 comment
Open

Invalid redeclaration of 'bundle' on v7.x #771

ilkerc opened this issue Nov 30, 2022 · 1 comment

Comments

@ilkerc
Copy link

ilkerc commented Nov 30, 2022

Due to some constraints on our CICD, we need a folder reference inside the xCode project with name bundle. R.swift generates a bundle reference as a file which conflicts with the actual bundle

  /// This `_R.file` struct is generated, and contains static references to 32 resource files.
  struct file {
    let bundle: Foundation.Bundle
 
 ....
     /// Resource file `bundle`.
    var bundle: RswiftResources.FileResource { .init(name: "bundle", pathExtension: "", bundle: bundle, locale: LocaleReference.none) }
  }

bundle is actually a non empty folder. Shouldn't even be generated as a file. My current solution is to just skip file generation:
"$PODS_ROOT/R.swift/rswift" generate --generators image,string,color,font "$SRCROOT/R.generated.swift"

Screenshot 2022-11-30 at 18 05 13

@tomlokhorst
Copy link
Collaborator

Thanks for the report.

I thought of this issue when building this feature, then promptly forgot about it again. 🤦‍♂️

The name "bundle" (and other names conflicting with pre-defined members) should never be generated.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants