SwiftGenPlugin icon indicating copy to clipboard operation
SwiftGenPlugin copied to clipboard

Plugin fails in SPM Package: You don’t have permission to save the file “Assets+Generated.swift” in the folder “Resources”

Open Gob-Lin opened this issue 1 year ago • 1 comments

Hello there.

I have a project with a single package and several modules. If I let the plugin run as a prebuild, I get You don’t have permission to save the file “Assets+Generated.swift” in the folder “Resources” while if I useit as a command it builds ok.

I am using 6.6.2+deriveddatafix, am I doing anything wrong or is it a known issue? If it is, any plans to fix it? :-)

Thanks.

Gob-Lin avatar Jan 22 '25 17:01 Gob-Lin

Been there, done that, check docs ;) https://github.com/SwiftGen/SwiftGenPlugin#add-a-swiftgen-config You need to define output dir as: ${DERIVED_SOURCES_DIR} otherwise it will fail due to lack of write access (plugins are sandboxed and can only create build time artifacts).

TomaszLizer avatar May 11 '25 18:05 TomaszLizer