当前位置: 首页>>代码示例>>Python>>正文


Python Dependencies.split方法代码示例

本文整理汇总了Python中twitter.pants.tasks.jvm_compiler_dependencies.Dependencies.split方法的典型用法代码示例。如果您正苦于以下问题:Python Dependencies.split方法的具体用法?Python Dependencies.split怎么用?Python Dependencies.split使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在twitter.pants.tasks.jvm_compiler_dependencies.Dependencies的用法示例。


在下文中一共展示了Dependencies.split方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: _write_to_artifact_cache

# 需要导入模块: from twitter.pants.tasks.jvm_compiler_dependencies import Dependencies [as 别名]
# 或者: from twitter.pants.tasks.jvm_compiler_dependencies.Dependencies import split [as 别名]
  def _write_to_artifact_cache(self, vts, sources_by_target):
    self._ensure_depfile_tmpdir()
    vt_by_target = dict([(vt.target, vt) for vt in vts.versioned_targets])

    # This work can happen in the background, if there's a measurable benefit to that.

    # Split the depfile into per-target files.
    splits = [(sources, JavaCompile.create_depfile_path(self._depfile_tmpdir, [target]))
              for target, sources in sources_by_target.items()]
    deps = Dependencies(self._classes_dir)
    if os.path.exists(self._depfile):
      deps.load(self._depfile)
    deps.split(splits)

    # Gather up the artifacts.
    vts_artifactfiles_pairs = []
    for target, sources in sources_by_target.items():
      artifacts = [JavaCompile.create_depfile_path(self._depfile_tmpdir, [target])]
      for source in sources:
        for cls in deps.classes_by_source.get(source, []):
          artifacts.append(os.path.join(self._classes_dir, cls))
      vt = vt_by_target.get(target)
      if vt is not None:
        vts_artifactfiles_pairs.append((vt, artifacts))

    # Write to the artifact cache.
    self.update_artifact_cache(vts_artifactfiles_pairs)
开发者ID:bollwang,项目名称:commons,代码行数:29,代码来源:java_compile.py


注:本文中的twitter.pants.tasks.jvm_compiler_dependencies.Dependencies.split方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。