facebookarchive / xcbuild

Xcode-compatible build tool.
Other
2k stars 190 forks source link

Missing inputencoding parameter for CopyStringsFile #45

Closed IngmarStein closed 8 years ago

IngmarStein commented 8 years ago

When building this project with xcbuild using xcbuild -project Kraftstoff.xcodeproj -target Kraftstoff -sdk iphonesimulator build, the build fails with

CopyStringsFile …/Library/Developer/Xcode/DerivedData/Kraftstoff-gaytkgpjvvldifdisonxedsdxode/Build/Products/Release-iphonesimulator/kraftstoff.app/fr.lproj/Localizable.stringsdict fr.lproj/Localizable.stringsdict
    builtin-copyStrings --validate --outputencoding binary --outdir …/Library/Developer/Xcode/DerivedData/Kraftstoff-gaytkgpjvvldifdisonxedsdxode/Build/Products/Release-iphonesimulator/kraftstoff.app/fr.lproj -- fr.lproj/Localizable.stringsdict
error: fr.lproj/Localizable.stringsdict: strings key 'Imported %d car(s) with %d fuel event(s).' is not a string

** BUILD FAILED **

The same build succeeds with xcodebuild. The only difference I can spot is that xcodebuild adds the inputencoding parameter for the CopyStringsFile task:

CopyStringsFile build/Release-iphonesimulator/kraftstoff.app/fr.lproj/Localizable.stringsdict fr.lproj/Localizable.stringsdict
    export PATH="/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin:/Applications/Xcode.app/Contents/Developer/usr/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin"
    builtin-copyStrings --validate --inputencoding utf-8 --outputencoding binary --outdir …/Kraftstoff/build/Release-iphonesimulator/kraftstoff.app/fr.lproj -- fr.lproj/Localizable.stringsdict

This error seems to only occur for stringsdict files, other .strings files are processed just fine.

grp commented 8 years ago

It looks like this is because xcbuild's implementation of builtin-copyStrings doesn't support .stringsdict files.

grp commented 8 years ago

Pushed a fix. With it, I was able to build the project you linked. Thanks for reporting!