def check_artifact_cache(self, vts): # Special handling for scala analysis files. Class files are retrieved directly into their # final locations in the global classes dir. def post_process_cached_vts(cached_vts): # Merge the localized analysis with the global one (if any). analyses_to_merge = [] for vt in cached_vts: for target in vt.targets: analysis_file = JvmCompile._analysis_for_target(self._analysis_tmpdir, target) portable_analysis_file = JvmCompile._portable_analysis_for_target(self._analysis_tmpdir, target) if os.path.exists(portable_analysis_file): self._analysis_tools.localize(portable_analysis_file, analysis_file) if os.path.exists(analysis_file): analyses_to_merge.append(analysis_file) if len(analyses_to_merge) > 0: if os.path.exists(self._analysis_file): analyses_to_merge.append(self._analysis_file) with contextutil.temporary_dir() as tmpdir: tmp_analysis = os.path.join(tmpdir, 'analysis') self._analysis_tools.merge_from_paths(analyses_to_merge, tmp_analysis) self.move(tmp_analysis, self._analysis_file) self._ensure_analysis_tmpdir() return Task.do_check_artifact_cache(self, vts, post_process_cached_vts=post_process_cached_vts)
def check_artifact_cache(self, vts): # Special handling for java artifacts. cached_vts, uncached_vts = Task.check_artifact_cache(self, vts) for vt in cached_vts: self.split_depfile(vt) return cached_vts, uncached_vts
def check_artifact_cache(self, vts): # Special handling for java artifacts. cached_vts, uncached_vts = Task.check_artifact_cache(self, vts) if cached_vts: with self.context.new_workunit('split'): for vt in cached_vts: self.split_depfile(vt) return cached_vts, uncached_vts
def check_artifact_cache(self, vts): # Special handling for java depfiles. Class files are retrieved directly into their # final locations in the global classes dir. def post_process_cached_vts(cached_vts): # Merge the cached analyses into the existing global one. if cached_vts: with self.context.new_workunit(name='merge-dependencies'): global_deps = Dependencies(self._classes_dir) if os.path.exists(self._depfile): global_deps.load(self._depfile) for vt in cached_vts: for target in vt.targets: depfile = JavaCompile.create_depfile_path(self._depfile_tmpdir, [target]) if os.path.exists(depfile): deps = Dependencies(self._classes_dir) deps.load(depfile) global_deps.merge(deps) global_deps.save(self._depfile) self._ensure_depfile_tmpdir() return Task.do_check_artifact_cache(self, vts, post_process_cached_vts=post_process_cached_vts)