コード例 #1
0
ファイル: visualizer.py プロジェクト: wolframarnold/pants
def main_filespecs():
    build_root, goals, args = pop_build_root_and_goals(
        '[build root path] [filespecs]*', sys.argv[1:])

    # Create PathGlobs for each arg relative to the buildroot.
    path_globs = [PathGlobs.create(Files, '', globs=[arg]) for arg in args]
    visualize_build_request(build_root, goals, path_globs)
コード例 #2
0
ファイル: planners.py プロジェクト: matthewrainville/pants
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
ファイル: visualizer.py プロジェクト: cheister/pants
def main_filespecs():
    build_root, goals, args = pop_build_root_and_goals(
        '[build root path] [filespecs]*', sys.argv[1:])

    # Create a PathGlobs object relative to the buildroot.
    path_globs = PathGlobs.create('', globs=args)
    visualize_build_request(build_root,
                            BuildRequest(goals=goals, subjects=[path_globs]))
コード例 #4
0
ファイル: sources.py プロジェクト: ahamilton55/pants
  def path_globs(self):
    """Creates a `PathGlobs` object for the files held by these Sources.

    This field may be projected to request the content of the files for this Sources object.
    """
    return PathGlobs.create(self.spec_path,
                            files=self.files,
                            globs=self.globs,
                            rglobs=self.rglobs,
                            zglobs=self.zglobs)
コード例 #5
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)
コード例 #6
0
    def path_globs(self):
        """Creates a `PathGlobs` object for the files held by these Sources.

    This field may be projected to request the content of the files for this Sources object.
    """
        return PathGlobs.create(self.spec_path,
                                files=self.files,
                                globs=self.globs,
                                rglobs=self.rglobs,
                                zglobs=self.zglobs)
コード例 #7
0
ファイル: globs.py プロジェクト: Gointer/pants
  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)
コード例 #8
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)
コード例 #9
0
ファイル: test_fs.py プロジェクト: dbentley/pants
 def pg(self, *pathglobs):
     return PathGlobs(pathglobs)
コード例 #10
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)
コード例 #11
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))
コード例 #12
0
ファイル: graph.py プロジェクト: aaronmitchell/pants
def descendant_addresses_to_globs(descendant_addresses):
  """Given a DescendantAddresses object, return a PathGlobs object for matching directories."""
  return PathGlobs.create(Dirs, descendant_addresses.directory, globs=['.', '*', '**/*'])
コード例 #13
0
ファイル: visualizer.py プロジェクト: cheister/pants
def main_filespecs():
  build_root, goals, args = pop_build_root_and_goals('[build root path] [filespecs]*', sys.argv[1:])

  # Create a PathGlobs object relative to the buildroot.
  path_globs = PathGlobs.create('', globs=args)
  visualize_build_request(build_root, BuildRequest(goals=goals, subjects=[path_globs]))
コード例 #14
0
ファイル: visualizer.py プロジェクト: Gointer/pants
def main_filespecs():
  build_root, goals, args = pop_build_root_and_goals('[build root path] [filespecs]*', sys.argv[1:])

  # Create PathGlobs for each arg relative to the buildroot.
  path_globs = [PathGlobs.create('', globs=[arg]) for arg in args]
  visualize_build_request(build_root, goals, path_globs)
コード例 #15
0
ファイル: test_fs.py プロジェクト: Gointer/pants
 def specs(self, relative_to, *filespecs):
   return PathGlobs.create_from_specs(relative_to, filespecs)
コード例 #16
0
ファイル: test_fs.py プロジェクト: dbentley/pants
 def specs(self, relative_to, *filespecs):
     return PathGlobs.create_from_specs(relative_to, filespecs)
コード例 #17
0
ファイル: visualizer.py プロジェクト: ahamilton55/pants
def main_filespecs():
    build_root, goals, args = pop_build_root_and_goals("[build root path] [filespecs]*", sys.argv[1:])

    # Create a PathGlobs object relative to the buildroot.
    path_globs = PathGlobs.create("", globs=args)
    visualize_build_request(build_root, goals, [path_globs])
コード例 #18
0
def descendant_addresses_to_globs(descendant_addresses):
    """Given a DescendantAddresses object, return a PathGlobs object for matching directories."""
    return PathGlobs.create(Dirs,
                            descendant_addresses.directory,
                            globs=['.', '*', '**/*'])