diff options
author | Rumou Duan <rduan@google.com> | 2016-10-13 21:14:24 +0000 |
---|---|---|
committer | Yue Gan <yueg@google.com> | 2016-10-14 09:33:11 +0000 |
commit | 3507f4947b939b3eae37c0dd04c76a80e7923aca (patch) | |
tree | ff6f8f1e91e42e1a41cf9210f2637027f1069022 /tools/j2objc | |
parent | 2988e10c32eeff702139b1776178aff283ebfe51 (diff) |
RELNOTES: Remove flag --experimental_zip_tree_artifact from j2objc Java annotation processing support.
--
MOS_MIGRATED_REVID=136084697
Diffstat (limited to 'tools/j2objc')
-rwxr-xr-x | tools/j2objc/j2objc_wrapper.py | 70 |
1 files changed, 0 insertions, 70 deletions
diff --git a/tools/j2objc/j2objc_wrapper.py b/tools/j2objc/j2objc_wrapper.py index 58fe587478..800cac3ed0 100755 --- a/tools/j2objc/j2objc_wrapper.py +++ b/tools/j2objc/j2objc_wrapper.py @@ -181,47 +181,6 @@ def WriteArchiveSourceMappingFile(compiled_archive_file_path, f.write(compiled_archive_file_path + ':' + objc_file + '\n') -def GenerateZipAndManifestForObjcFiles(objc_files, - tmp_objc_file_root, - zip_path, - suffix, - zip_factory=zipfile.ZipFile, - file_open=open): - """Zips up the ObjC sources from gen jar and writes a manifest file. - - Args: - objc_files: The list of ObjC sources to zip up. - tmp_objc_file_root: The temporary directory that contains the ObjC files - to zip. - zip_path: The output path of the zip file. - suffix: The suffix of the files to zip. Can be either .m or .h. - zip_factory: The factory method to create zip file objects. - file_open: The method to open a file. - Returns: - None. - """ - # We use zipfile.ZIP_STORED to create a zip file without compression. - zf = zip_factory(zip_path, 'w', zipfile.ZIP_STORED) - files_zip = [os.path.splitext(objc_file)[0] + suffix - for objc_file in objc_files] - - for file_to_zip in files_zip: - file_path = os.path.join(tmp_objc_file_root, file_to_zip) - with file_open(file_path, 'r') as opened_file: - file_content = opened_file.read() - # We set the entry modification time to the first day of 1980, to avoid - # zip output indeterminism. Also note that the zip format does not allow - # entry timestamp before 1980. - zip_entry_info = zipfile.ZipInfo(file_to_zip, _CONST_DATE_TIME) - zf.writestr(zip_entry_info, file_content) - zf.close() - - manifest_file = os.path.splitext(zip_path)[0] + '.txt' - with file_open(manifest_file, 'w') as f: - for file_to_zip in files_zip: - f.write(file_to_zip + '\n') - - def _ParseArgs(j2objc_args): """Separate arguments passed to J2ObjC into source files and J2ObjC flags. @@ -361,7 +320,6 @@ def CopyObjcFileToFinalOutputRoot(objc_files, def PostJ2ObjcFileProcessing(normal_objc_files, genjar_objc_files, tmp_objc_file_root, final_objc_file_root, j2objc_source_paths, gen_src_jar, - output_gen_source_zip, output_gen_header_zip, output_gen_source_dir, output_gen_header_dir): """Performs cleanups on ObjC files and moves them to final output location. @@ -372,10 +330,6 @@ def PostJ2ObjcFileProcessing(normal_objc_files, genjar_objc_files, final_objc_file_root: The final output root. j2objc_source_paths: The source paths used by J2ObjC. gen_src_jar: The path of the gen srcjar. - output_gen_source_zip: The final output zip of ObjC source files generated - from gen srcjar. Maybe null. - output_gen_header_zip: The final output zip of ObjC header files generated - from gen srcjar. Maybe null. output_gen_source_dir: The final output directory of ObjC source files translated from gen srcjar. Maybe null. output_gen_header_dir: The final output directory of ObjC header files @@ -396,20 +350,6 @@ def PostJ2ObjcFileProcessing(normal_objc_files, genjar_objc_files, final_objc_file_root, '.h') - if output_gen_source_zip: - GenerateZipAndManifestForObjcFiles( - genjar_objc_files, - tmp_objc_file_root, - output_gen_source_zip, - '.m') - - if output_gen_header_zip: - GenerateZipAndManifestForObjcFiles( - genjar_objc_files, - tmp_objc_file_root, - output_gen_header_zip, - '.h') - if output_gen_source_dir: CopyObjcFileToFinalOutputRoot( genjar_objc_files, @@ -503,14 +443,6 @@ def main(): required=False, help='The jar containing Java sources generated by annotation processor.') parser.add_argument( - '--output_gen_source_zip', - required=False, - help='The output zip of ObjC source files translated from the gen srcjar') - parser.add_argument( - '--output_gen_header_zip', - required=False, - help='The output zip of ObjC header files translated from the gen srcjar') - parser.add_argument( '--output_gen_source_dir', required=False, help='The output directory of ObjC source files translated from the gen' @@ -567,8 +499,6 @@ def main(): args.objc_file_path, j2objc_source_paths, args.gen_src_jar, - args.output_gen_source_zip, - args.output_gen_header_zip, args.output_gen_source_dir, args.output_gen_header_dir) |