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

Rswift 7 using generators with SPM

Open muratyilmaz opened this issue 2 years ago • 5 comments

Can I use specific generators with RswiftGeneratePublicResources/RswiftGenerateInternalResources?

muratyilmaz avatar Dec 27 '22 12:12 muratyilmaz

Unfortunately no. When using these plugins, all generators are always used. If you want to only use specific generators, you'll need to use the command line version.

tomlokhorst avatar Dec 27 '22 15:12 tomlokhorst

Thank you for your answer. If I use RswiftGenerateResourcesCommand from Xcode, the generators work. But, with RswiftModifyXcodePackages, it does not. Could you let me know if you meant this?

Screen Shot 2022-12-27 at 20 03 50

muratyilmaz avatar Dec 27 '22 17:12 muratyilmaz

Oh right, I forgot about the RswiftGenerateResourcesCommand 😆 Yes, you can use that, it should work correctly. You will need to run that again, each time you add or remove resources.

RswiftModifyXcodePackages is only meant to be run once, when adding a Build Tool Plug-in. It modifies the Xcode project, it does not itself run R.swift.

tomlokhorst avatar Dec 27 '22 17:12 tomlokhorst

Yep, like you said I need to run that again each time I add resources, and also I need to specify generators as arguments. Is there any way to automate this?

muratyilmaz avatar Dec 27 '22 18:12 muratyilmaz

Another question is that you said you can use commandline version. How can I use it with SPM? Do I need to add it to build phase?

muratyilmaz avatar Dec 27 '22 18:12 muratyilmaz