public function generateFiles($component_data, ComponentCollection $component_collection) {
    $component_list = $component_collection->getComponents();

    // Let each file component in the tree gather data from its own children.
    $this->collectFileContents($component_collection);

    // Build files.
    // Get info on files. All components that wish to provide a file should have
    // registered themselves as first-level children of the root component.
    $files = $this->collectFiles($component_collection);

    // Filter files according to the requested build list.
    if (isset($component_data['requested_build'])) {
      $component_collection->getRootComponent()->applyBuildListFilter($files, $component_data['requested_build'], $component_data);
    }

    // Then we assemble the files into a simple array of full filename and
    // contents.
    $files_assembled = $this->assembleFiles($component_collection, $files);

    return $files_assembled;
  }