| import os |
| |
| from slave import base_recipe |
| from slave.step import code_coverage_step |
| from slave.step import gn_step |
| from slave.step import gn_check_step |
| from slave.step import x86_camera_step |
| |
| BUILD_BRANDING = 'chrome' |
| BUILD_ARCH = 'x86' |
| BUILD_FLAVOR = 'Release' |
| BUILD_PRODUCT = 'chromecast' |
| BUILD_ARGS_OFFICIAL = False |
| BUILD_ARGS_PRODUCT = 'photon_x86' |
| |
| COVERAGE_IGNORE_FILENAME_REGEX = '.*/gen/.*|.*/third_party/.*' |
| COVERAGE_REPORT_FORMAT = 'lcov' |
| |
| |
| def GetValidBuildNames(): |
| return [ |
| BUILD_ARGS_PRODUCT, |
| ] |
| |
| |
| def CreateRecipe(build_name: str, **kwargs): |
| del build_name |
| return PhotonRecipe(**kwargs) |
| |
| |
| class PhotonRecipe(base_recipe.BaseRecipe): |
| """ Recipe for build/run photon build""" |
| |
| def __init__(self, **kwargs): |
| base_recipe.BaseRecipe.__init__( |
| self, enable_build_accelerator=True, **kwargs) |
| self._properties = kwargs.get('properties', {}) |
| self._code_coverage = self._properties.get('code_coverage', False) |
| |
| def get_steps(self): |
| cwd = os.getcwd() |
| |
| # Output directory for gn gen step must match expected output directory |
| # for RunCoverageCommandStep based on given BUILD_ARCH, BUILD_PRODUCT, etc. |
| out_dir_parts = ['out', BUILD_ARCH, BUILD_PRODUCT, 'gn'] |
| out_dir = os.path.join( |
| 'chromium/src', '_'.join(out_dir_parts), BUILD_FLAVOR) |
| |
| build_args = [] |
| |
| steps = [ |
| gn_step.GnGenStep(build_args_product=BUILD_ARGS_PRODUCT, |
| build_args=build_args, |
| out_dir=out_dir, |
| cwd=cwd, |
| halt_on_failure=True, |
| **self._step_kwargs), |
| x86_camera_step.BuildPhotonStep(out_dir=out_dir, **self._step_kwargs), |
| x86_camera_step.RunPhotonUnitTestStep(out_dir=out_dir, |
| **self._step_kwargs), |
| ] |
| |
| return steps |