mac-cain13 / R.swift

Strong typed, autocompleted resources like images, fonts and segues in Swift projects
MIT License
9.5k stars 764 forks source link

Add support for `rswift.json` config to BuildToolPlugin #896

Closed TheNightmanCodeth closed 1 week ago

TheNightmanCodeth commented 4 months ago

I noticed there was no way to set custom arguments to the generation command when using SPM or Xcode BuildToolPlugin

This just allows for configuration via a rswift.json file placed at the project root (or elsewhere if it is added manually to the Xcode project)

The config json would look like:

{
    "generators": ["image", "string"],
    "rswiftignorePath": "/Users/TheNightmanCodeth/project/other/.rswiftignore",
    "additionalArguments": ["--somethingelse", "value"]
}

or any variation (ie. only additionalArguments, only generators and rswiftignorePath, etc.)

Addresses #860 (among others)

fthdgn commented 2 weeks ago

This config file is used only by RswiftGenerateInternalResources plugin. There are also RswiftGenerateResourcesCommand and RswiftGeneratePublicResources plugins.

TheNightmanCodeth commented 1 week ago

Yeah good call this was a quick solution for a narrow use-case. There's another MR #899 raised just after this that, at a quick glance, appears to fill in those gaps.

I'm going to go ahead and close this since I'm no longer using R.swift and don't plan on coming back to finish this out. If someone else would like to take what I've done and finish it in another MR that's fine with me.