liamnichols / xcstrings-tool

A plugin to generate Swift constants for your Strings Catalogs.

Home Page:https://swiftpackageindex.com/liamnichols/xcstrings-tool/documentation/documentation

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Better support for use in open source libraries

liamnichols opened this issue · comments

Currently, we direct you to use XCStrings Tool as a Build Tool plugin, which requires the plugin to be invoked whenever the target is compiled (if the catalog is modified).

This is great for direct use in your own projects as it keeps the generated source up-to-date automatically however it became clear that this is a bit problematic when used internally in an open source library that is offered to other developers because it requires them to trust the plugin before it runs yet the plugin itself is an implementation detail and that might confuse the developer who is adopting the open source library.

To overcome this, we can offer ways to generate the source code on-demand so that it can be bundled in the library release instead of being generated at compile time.

This can be made possible in two ways:

  1. Document the CLI so that it can be invoked manually
  2. Add a Command Plugin that replicates the Build Tool plugin by detecting the Strings Catalogs automatically

The first approach is just a case of adding documentation, but the second is a much friendlier user experience

+1 for this as an app dev too, I think it'd be useful to check in the generated Swift code so it's easier to diff things when something changes