Exemplo n.º 1
0
 def _invoke_tool(self, target_sources):
     buildroot = get_buildroot()
     toolroot = buildroot
     if self.sideeffecting and self.get_options().output_dir:
         toolroot = self.get_options().output_dir
         new_sources = [(target,
                         os.path.join(toolroot,
                                      fast_relpath(source, buildroot)))
                        for target, source in target_sources]
         old_file_paths = [source for _, source in target_sources]
         new_file_paths = [source for _, source in new_sources]
         safe_mkdir_for_all(new_file_paths)
         for old, new in zip(old_file_paths, new_file_paths):
             shutil.copyfile(old, new)
         target_sources = new_sources
     result = self.invoke_tool(toolroot, target_sources)
     self.process_result(result)
     return result
Exemplo n.º 2
0
 def _invoke_tool(self, target_sources):
   buildroot = get_buildroot()
   toolroot = buildroot
   if self.sideeffecting and self.get_options().output_dir:
     toolroot = self.get_options().output_dir
     new_sources = [
       (target, os.path.join(toolroot, fast_relpath(source, buildroot)))
       for target, source in target_sources
     ]
     old_file_paths = [source for _, source in target_sources]
     new_file_paths = [source for _, source in new_sources]
     safe_mkdir_for_all(new_file_paths)
     for old, new in zip(old_file_paths, new_file_paths):
       shutil.copyfile(old, new)
     target_sources = new_sources
   result = self.invoke_tool(toolroot, target_sources)
   self.process_result(result)
   return result