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.
Fixes #264
Proposed Changes
I have adjusted the logic of
incrementalCodeUpdate
method to properly handle extracting strings from source files specified via multiple entries inupdate.code.codePaths
option.In the past, the logic was to walk all
codePaths
directories. For each directory create a temporary.strings
file. Merge all entries from the temporary.strings
file into output. Invoking this logic for multiplecodePaths
inadditive=false
mode would repeatedly overwrite the outputLocalized.strings
file with only the entries extracted from currently processed directory and would remove everything else.The new logic uses only one temporary
.strings
file into which all entries from allcodePaths
are extracted by usingextractLocStrings -a
(the append mode) and only after that are all strings from the temporary.strings
file merged into the outputLocalizable.strings
.Changes
extractLocStrings
specify the-a
option to append extracted strings into temporary.strings
file instead of replacing them..strings
file for all strings extracted duringcode.update
Testing
I have a testing project with the following
.bartycrouch.toml
Multiple entries via
update.code.codePaths
, andupdate.code.additive=false
Each subdirectory contains one
NSLocalizedString
entry.Invoking published release against this project results in only one entry detected:
Invoking version with the new logic results in: