Exemplo n.º 1
0
    def UpdateHalDirBuildRule(self, hal_list):
        """Updates build rules for vts drivers/profilers.

        Updates vts drivers/profilers for each pair of (hal_name, hal_version)
        in hal_list.

        Args:
            hal_list: list of tuple of strings. For example,
                [('vibrator', '1.3'), ('sensors', '1.7')]
        """
        for target in hal_list:
            hal_name = target[0]
            hal_version = target[1]

            hal_dir = os.path.join(self._PROJECT_PATH,
                                   utils.HalNameDir(hal_name),
                                   utils.HalVerDir(hal_version))

            file_path = os.path.join(hal_dir, 'Android.bp')
            utils.WriteBuildRule(
                file_path, utils.OnlySubdirsBpRule(self._warning_header,
                                                   ['*']))

            file_path = os.path.join(hal_dir, 'build', 'Android.bp')
            utils.WriteBuildRule(
                file_path,
                self._VtsBuildRuleFromTemplate(self._VTS_BUILD_TEMPLATE,
                                               hal_name, hal_version))
Exemplo n.º 2
0
    def UpdateSecondLevelBuildRule(self, hal_list):
        """Updates test/vts-testcase/hal/<hal_name>/Android.bp"""
        top_level_dirs = dict()
        for target in hal_list:
            hal_dir = os.path.join(utils.HalNameDir(target[0]),
                                   utils.HalVerDir(target[1]))
            top_dir = hal_dir.split('/', 1)[0]
            top_level_dirs.setdefault(top_dir, []).append(
                os.path.relpath(hal_dir, top_dir))

        for k, v in top_level_dirs.items():
            file_path = os.path.join(self._PROJECT_PATH, k, 'Android.bp')
            utils.WriteBuildRule(
                file_path, utils.OnlySubdirsBpRule(self._warning_header, v))
    def UpdateHalDirBuildRule(self, hal_list, test_config_dir):
        """Updates build rules for vts drivers/profilers.

        Updates vts drivers/profilers for each pair of (hal_name, hal_version)
        in hal_list.

        Args:
            hal_list: list of tuple of strings. For example,
                [('vibrator', '1.3'), ('sensors', '1.7')]
            test_config_dir: string, directory storing the configurations.
        """
        for target in hal_list:
            hal_name = target[0]
            hal_version = target[1]

            hal_dir = os.path.join(
                self._ANDROID_BUILD_TOP, test_config_dir,
                utils.HalNameDir(hal_name), utils.HalVerDir(hal_version))

            file_path = os.path.join(hal_dir, 'build', 'Android.bp')
            utils.WriteBuildRule(file_path, self._VtsBuildRuleFromTemplate(
                self._VTS_BUILD_TEMPLATE, hal_name, hal_version))
Exemplo n.º 4
0
 def UpdateTopLevelBuildRule(self):
     """Updates test/vts-testcase/hal/Android.bp"""
     utils.WriteBuildRule(
         os.path.join(self._PROJECT_PATH, 'Android.bp'),
         utils.OnlySubdirsBpRule(self._warning_header, ['*']))