Пример #1
0
def calculate_package_search_path(jvm_package_name, source_roots):
  """Return Paths for directories where the given JVMPackageName might exist."""
  rel_package_dir = jvm_package_name.name.replace('.', os_sep)
  if not rel_package_dir.endswith(os_sep):
    rel_package_dir += os_sep
  specs = [os_path_join(srcroot, rel_package_dir) for srcroot in source_roots.srcroots]
  return PathGlobs.create_from_specs('', specs)
Пример #2
0
def calculate_package_search_path(jvm_package_name, source_roots):
    """Return Paths for directories where the given JVMPackageName might exist."""
    rel_package_dir = jvm_package_name.name.replace('.', os_sep)
    if not rel_package_dir.endswith(os_sep):
        rel_package_dir += os_sep
    specs = [
        os_path_join(srcroot, rel_package_dir)
        for srcroot in source_roots.srcroots
    ]
    return PathGlobs.create_from_specs('', specs)
Пример #3
0
  def to_fileset_with_spec(self, engine, scheduler, relpath):
    """Return a `FilesetWithSpec` object for these files, computed using the given engine.

    TODO: Simplify the engine API. See: https://github.com/pantsbuild/pants/issues/3070
    """
    filespecs = self.legacy_globs_class.to_filespec(self.patterns)
    pathglobs = PathGlobs.create_from_specs(relpath, filespecs.get('globs', []))
    lfc = LazyFilesContent(engine, scheduler, pathglobs)
    return wrapped_globs.FilesetWithSpec('',
                                         filespecs,
                                         files_calculator=lfc.files,
                                         file_content_calculator=lfc.file_content)
Пример #4
0
    def to_fileset_with_spec(self, engine, scheduler, relpath):
        """Return a `FilesetWithSpec` object for these files, computed using the given engine.

    TODO: Simplify the engine API. See: https://github.com/pantsbuild/pants/issues/3070
    """
        filespecs = self.legacy_globs_class.to_filespec(self.patterns)
        pathglobs = PathGlobs.create_from_specs(FSFiles, relpath,
                                                filespecs.get('globs', []))
        lfc = LazyFilesContent(engine, scheduler, pathglobs)
        return wrapped_globs.FilesetWithSpec(
            '',
            filespecs,
            files_calculator=lfc.files,
            file_content_calculator=lfc.file_content)
Пример #5
0
 def specs(self, relative_to, *filespecs):
     return PathGlobs.create_from_specs(relative_to, filespecs)
Пример #6
0
def calculate_package_search_path(jvm_package_name, source_roots):
  """Return PathGlobs to match directories where the given JVMPackageName might exist."""
  rel_package_dir = jvm_package_name.name.replace('.', os_sep)
  specs = [os_path_join(srcroot, rel_package_dir) for srcroot in source_roots.srcroots]
  return PathGlobs.create_from_specs(Dirs, '', specs)
Пример #7
0
 def assert_pg_equals(self, ftype, pathglobs, relative_to, filespecs):
   self.assertEquals(PathGlobs(ftype, tuple(pathglobs)), PathGlobs.create_from_specs(ftype, relative_to, filespecs))
Пример #8
0
 def specs(self, relative_to, *filespecs):
   return PathGlobs.create_from_specs(relative_to, filespecs)