예제 #1
0
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
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 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
  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
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
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
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=['.', '*', '**/*'])