Chromium Code Reviews| Index: pylib/gyp/mac_tool.py |
| =================================================================== |
| --- pylib/gyp/mac_tool.py (revision 1212) |
| +++ pylib/gyp/mac_tool.py (working copy) |
| @@ -51,7 +51,7 @@ |
| shutil.rmtree(dest) |
| shutil.copytree(source, dest) |
| elif extension == '.xib': |
| - self._CopyXIBFile(source, dest) |
| + return self._CopyXIBFile(source, dest) |
| elif extension == '.strings': |
| self._CopyStringsFile(source, dest) |
| # TODO: Given that files with arbitrary extensions can be copied to the |
| @@ -70,7 +70,19 @@ |
| args = ['/Developer/usr/bin/ibtool', '--errors', '--warnings', |
| '--notices', '--output-format', 'human-readable-text', '--compile', |
| dest, source] |
| - subprocess.call(args) |
| + ibtool_section_re = re.compile(r'/\*.*\*/') |
| + ibtool_re = re.compile(r'.*note:.*is clipping its content') |
| + ibtoolout = subprocess.Popen(args, stdout=subprocess.PIPE) |
| + current_section_header = None |
| + for line in ibtoolout.stdout: |
| + if ibtool_section_re.match(line): |
| + current_section_header = line |
| + elif not ibtool_re.match(line): |
| + if current_section_header: |
| + sys.stdout.write(current_section_header) |
| + current_section_header = None |
|
Robert Sesek
2012/02/21 15:53:28
Can there be multiple lines of output under the sa
Nico
2012/02/21 16:23:46
Yes:
/* com.apple.ibtool.document.notices */
/b/b
|
| + sys.stdout.write(line) |
| + return ibtoolout.returncode |
| def _CopyStringsFile(self, source, dest): |
| """Copies a .strings file using iconv to reconvert the input into UTF-16.""" |