def _MakeCobaltArchiveFromSource(output_archive_path, platform_name, config, platform_sdk_version, additional_buildinfo_dict, include_black_box_tests): """Finds necessary files and makes an archive.""" _MakeDirs(os.path.dirname(output_archive_path)) out_directory = paths.BuildOutputDirectory(platform_name, config) root_dir = os.path.abspath( os.path.normpath(os.path.join(out_directory, '..', '..'))) flist = filelist.FileList() inc_paths = _GetDeployPaths(platform_name, config) logging.info('Adding binary files to bundle...') for path in inc_paths: path = os.path.join(out_directory, path) if not os.path.exists(path): logging.info('Skipping deploy path %s because it does not exist.', path) continue logging.info(' adding %s', os.path.abspath(path)) flist.AddAllFilesInPath(root_dir=root_dir, sub_path=path) logging.info('...done') launcher_tools_path = os.path.join( os.path.dirname(output_archive_path), '____app_launcher') if os.path.exists(launcher_tools_path): port_symlink.Rmtree(launcher_tools_path) logging.info('Adding app_launcher_files to bundle in %s', os.path.abspath(launcher_tools_path)) try: CopyAppLauncherTools(repo_root=paths.REPOSITORY_ROOT, dest_root=launcher_tools_path, additional_glob_patterns=[], include_black_box_tests=include_black_box_tests) flist.AddAllFilesInPath(root_dir=launcher_tools_path, sub_path=launcher_tools_path) logging.info('...done') MakeCobaltArchiveFromFileList( output_archive_path, input_file_list=flist, platform_name=platform_name, platform_sdk_version=platform_sdk_version, config=config, additional_buildinfo_dict=additional_buildinfo_dict) logging.info('...done') finally: port_symlink.Rmtree(launcher_tools_path)
def __init__(self, root_sub_dir='bundler'): root_sub_dir = os.path.normpath(root_sub_dir) self.root_tmp = os.path.join(tempfile.gettempdir(), root_sub_dir) if os.path.exists(self.root_tmp): port_symlink.Rmtree(self.root_tmp) self.root_in_tmp = os.path.join(self.root_tmp, 'in') self.sym_dir = os.path.join(self.root_in_tmp, 'from_dir_lnk') self.from_dir = os.path.join(self.root_in_tmp, 'from_dir') self.test_txt = os.path.join(self.from_dir, 'test.txt')
def _ClearDir(path): path = os.path.normpath(path) if not os.path.exists( path): # Works for symlinks for both *nix and Windows. return port_symlink.Rmtree(path)
def Clear(self): port_symlink.Rmtree(self.root_tmp)
def Rmtree(*args, **kwargs): return port_symlink.Rmtree(*args, **kwargs)