R.swift icon indicating copy to clipboard operation
R.swift copied to clipboard

Invalid redeclaration of 'bundle' on v7.x

Open ilkerc opened this issue 3 years ago • 1 comments

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

ilkerc avatar Nov 30 '22 15:11 ilkerc

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.

tomlokhorst avatar Nov 30 '22 16:11 tomlokhorst