예제 #1
0
    def GetDependency(self, revision, platform):
        """Returns all dependencies of Chrome as a dict for given revision and OS.

    Args:
      revision (str): The revision of a Chrome build, it can be a githash or a
        chrome version for a official build.
      platform (str): The target platform of the Chrome build, should be one of
        'win', 'ios', 'mac', 'unix', 'android', or 'all'.

    Returns:
      A map from dependency path to the dependency info.
    """
        deps_repo_info = {'deps_file': 'DEPS'}
        root_dep = dependency.Dependency(_CHROMIUM_ROOT_DIR,
                                         _CHROMIUM_REPO_MASTER, revision,
                                         **deps_repo_info)

        deps_parser.UpdateDependencyTree(root_dep, [platform],
                                         DEPSDownloader(self._get_repository))

        dependencies = {}

        # Flatten the dependency tree into a one-level dict.
        def FlattenDepTree(dep):
            dependencies[dep.path] = dep
            for child in dep.children.values():
                FlattenDepTree(child)

        FlattenDepTree(root_dep)

        # Make sure that DEPS file in buildspec/ overwrite the chromium repo.
        dependencies[_CHROMIUM_ROOT_DIR] = root_dep

        return dependencies
예제 #2
0
        def _Test(target_os_list, expected_deps_tree_json):
            root_dep = dependency.Dependency(root_dep_path,
                                             root_dep_repo_url,
                                             root_dep_revision,
                                             deps_file=root_dep_deps_file)

            deps_parser.UpdateDependencyTree(root_dep, target_os_list,
                                             DummyDEPSLoader(self))

            self.assertEqual(expected_deps_tree_json, root_dep.ToDict())
예제 #3
0
    def _CreateDependency(path, repo_info):
        if path.endswith('/'):
            path = path[:-1]

        repo_url = repo_info
        revision = None
        if '@' in repo_info:
            # The dependency is pinned to some revision.
            repo_url, revision = repo_info.split('@')

        return dependency.Dependency(path, repo_url, revision,
                                     root_dep.deps_file)