Ejemplo n.º 1
0
def checkComplete():
    """Checks whether the 'complete' build references every file.  This is used
  by the build script to ensure that every file is included in at least one
  build type.

  Returns:
    True on success, False on failure.
  """
    complete = build.Build()
    # Normally we don't need to include @core, but because we look at the build
    # object directly, we need to include it here.  When using main(), it will
    # call addCore which will ensure core is included.
    if not complete.parseBuild(['+@complete', '+@core'], os.getcwd()):
        print >> sys.stderr, 'Error parsing complete build'
        return False

    match = re.compile(r'.*\.js$')
    base = shakaBuildHelpers.getSourceBase()
    allFiles = shakaBuildHelpers.getAllFiles(os.path.join(base, 'lib'), match)
    missingFiles = set(allFiles) - complete.include

    if len(missingFiles) > 0:
        print >> sys.stderr, 'There are files missing from the complete build:'
        for missing in missingFiles:
            # Convert to a path relative to source base.
            print >> sys.stderr, '  ' + os.path.relpath(missing, base)
        return False
    return True
Ejemplo n.º 2
0
def checkComplete():
  """Checks whether the 'complete' build references every file.  This is used
  by the build script to ensure that every file is included in at least one
  build type.

  Returns:
    True on success, False on failure.
  """
  complete = build.Build()
  # Normally we don't need to include @core, but because we look at the build
  # object directly, we need to include it here.  When using main(), it will
  # call addCore which will ensure core is included.
  if not complete.parseBuild(['+@complete', '+@core'], os.getcwd()):
    print >> sys.stderr, 'Error parsing complete build'
    return False

  match = re.compile(r'.*\.js$')
  base = shakaBuildHelpers.getSourceBase()
  allFiles = shakaBuildHelpers.getAllFiles(os.path.join(base, 'lib'), match)
  missingFiles = set(allFiles) - complete.include

  if len(missingFiles) > 0:
    print >> sys.stderr, 'There are files missing from the complete build:'
    for missing in missingFiles:
      # Convert to a path relative to source base.
      print >> sys.stderr, '  ' + os.path.relpath(missing, base)
    return False
  return True
Ejemplo n.º 3
0
    def _addCore(self):
        """Adds the core library."""
        # Add externs and closure dependencies.
        sourceBase = shakaBuildHelpers.getSourceBase()
        match = re.compile(r'.*\.js$')
        self.include = self.include | set(
            shakaBuildHelpers.getAllFiles(os.path.join(
                sourceBase, 'externs'), match) + shakaBuildHelpers.getAllFiles(
                    os.path.join(sourceBase, 'third_party', 'closure'), match))

        # Check that there are no files in 'core' that are removed
        coreBuild = Build()
        coreBuild.parseBuild(['+@core'], os.getcwd())
        coreFiles = coreBuild.include
        if len(self.exclude & coreFiles) > 0:
            print >> sys.stderr, 'Cannot exclude files from core'
        self.include = self.include | coreFiles
Ejemplo n.º 4
0
  def _addCore(self):
    """Adds the core library."""
    # Add externs and closure dependencies.
    sourceBase = shakaBuildHelpers.getSourceBase()
    match = re.compile(r'.*\.js$')
    self.include = self.include | set(
        shakaBuildHelpers.getAllFiles(
            os.path.join(sourceBase, 'externs'), match) +
        shakaBuildHelpers.getAllFiles(
            os.path.join(sourceBase, 'third_party', 'closure'), match))

    # Check that there are no files in 'core' that are removed
    coreBuild = Build()
    coreBuild.parseBuild(['+@core'], os.getcwd())
    coreFiles = coreBuild.include
    if len(self.exclude & coreFiles) > 0:
      print >> sys.stderr, 'Cannot exclude files from core'
    self.include = self.include | coreFiles
Ejemplo n.º 5
0
 def get(arg):
     return shakaBuildHelpers.getAllFiles(os.path.join(base, arg), match)
Ejemplo n.º 6
0
 def get(*args):
   return shakaBuildHelpers.getAllFiles(os.path.join(base, *args), match)