R.swift
R.swift copied to clipboard
Invalid redeclaration of 'bundle' on v7.x
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"
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.