diff options
author | Rumou Duan <rduan@google.com> | 2017-01-09 20:33:33 +0000 |
---|---|---|
committer | Marcel Hlopko <hlopko@google.com> | 2017-01-10 10:22:15 +0000 |
commit | e7fd53927df37a55cf5a4337fabced828cda8109 (patch) | |
tree | 81426414846058343885b087f4f6dd7f2de2a17e /tools/objc | |
parent | b91d3922246310e5b2e8cde456d897611c571155 (diff) |
In the j2objc wrapper script, add the ability to process more than one source jars.
In the j2objc dead code removal script, quote the object file names when invoking ar. They may contain special shell characeters.
--
PiperOrigin-RevId: 143993977
MOS_MIGRATED_REVID=143993977
Diffstat (limited to 'tools/objc')
-rwxr-xr-x | tools/objc/j2objc_dead_code_pruner.py | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/tools/objc/j2objc_dead_code_pruner.py b/tools/objc/j2objc_dead_code_pruner.py index a5dac5c7c1..a5693fbaf6 100755 --- a/tools/objc/j2objc_dead_code_pruner.py +++ b/tools/objc/j2objc_dead_code_pruner.py @@ -378,8 +378,15 @@ def PruneArchiveFile(input_archive, output_archive, dummy_archive, # Remove the unreachable objects from the archive unreachable_object_names = MatchObjectNamesInArchive( xcrunwrapper, input_archive, unreachable_object_names) + # We need to quote the object names because they may contains special + # shell characters. + quoted_unreachable_object_names = [ + "'" + unreachable_object_name + "'" + for unreachable_object_name in unreachable_object_names] j2objc_cmd += '%s ar -d -s %s %s && ' % ( - xcrunwrapper, output_archive, ' '.join(unreachable_object_names)) + xcrunwrapper, + output_archive, + ' '.join(quoted_unreachable_object_names)) # Update the table of content of the archive file j2objc_cmd += '%s ranlib %s' % (xcrunwrapper, output_archive) # There are no unreachable objects, we just copy over the original archive |