Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(827)

Unified Diff: generate_localizer

Issue 11026078: ibtool SDKROOT (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/chrome/tools/build/mac/
Patch Set: Created 8 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: generate_localizer
===================================================================
--- generate_localizer (revision 160459)
+++ generate_localizer (working copy)
@@ -42,8 +42,19 @@
"""Runs ibtool to extract the localizable strings data from the xib."""
tools_dir = os.environ.get('DEVELOPER_BIN_DIR', '/usr/bin')
tool_path = os.path.join(tools_dir, 'ibtool')
+
+ # Take SDKROOT out of the environment passed to ibtool. ibtool itself has
+ # no need for it, but when ibtool runs via xcrun and Xcode isn't aware of
+ # the SDK in use, its presence causes an error.
+ if 'SDKROOT' in os.environ:
+ ibtool_env = os.environ.copy()
+ del ibtool_env['SDKROOT']
+ else:
+ ibtool_env = os.environ
+
ibtool_cmd = subprocess.Popen([tool_path, '--localizable-strings', xib_path],
- stdout=subprocess.PIPE, stderr=subprocess.PIPE)
+ stdout=subprocess.PIPE, stderr=subprocess.PIPE,
+ env=ibtool_env)
(cmd_out, cmd_err) = ibtool_cmd.communicate()
if ibtool_cmd.returncode:
sys.stderr.write('%s:0: error: ibtool on "%s" failed (%d):\n%s\n' %
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698