Introduce xcstrings-tool-config.yaml configuration file as an alternative to using build settings in Xcode 16.3+
#125
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Starting in Xcode 16.3, build settings are no longer available in the environment when running a Build Tool plugin executable. This trick is what XCStrings Tool relied on to configure access level or development language (used for legacy .strings files) to generate the correct code.
https://swift-open-source.slack.com/archives/C04MQHWCQKW/p1740417669770009
Since we can no longer use this trick, we need an alternative approach. This change introduces the concept of the
xcstrings-tool-config.{yml,yaml,json}file.It is a regression in friendliness of the plugin, but at least we have a path forward. When using the Build Tool plugin, this file must be placed within the target source files.
The file must have one of the following names:
xcstrings-tool-config.ymlxcstrings-tool-config.yamlxcstrings-tool-config.jsonThe file can be either YAML or JSON and has two optional properties:
accessLevel- Eitherinternal,publicorpackagedevelopmentLanguage- The value defined in the Package.swiftdefaultLocalizationor XcodeDEVELOPMENT_LANGUAGEbuild settingverbose- For loggingIn an Xcode project, the file must have target membership for the target that the build plugin is assigned to.