(paths, vcs, incremental, platforms=SUPPORTED_PLATFORMS, shader_models=tuple(SHADER_MODELS),
shader_compiler=SHADER_COMPILER, warnings=True, staging='')
| 209 | |
| 210 | |
| 211 | def build(paths, vcs, incremental, platforms=SUPPORTED_PLATFORMS, shader_models=tuple(SHADER_MODELS), |
| 212 | shader_compiler=SHADER_COMPILER, warnings=True, staging=''): |
| 213 | files = set(flatten_paths(paths)) |
| 214 | logging.debug(f'Discovered {len(files)} files to build') |
| 215 | if not files: |
| 216 | return True |
| 217 | |
| 218 | extra_args = get_extra_args() |
| 219 | if staging: |
| 220 | os.makedirs(staging, exist_ok=True) |
| 221 | |
| 222 | work_items = [] |
| 223 | for each in files: |
| 224 | work_items.extend(get_outputs(each, platforms or SUPPORTED_PLATFORMS, shader_models or SHADER_MODELS, |
| 225 | shader_compiler, warnings, extra_args, staging)) |
| 226 | |
| 227 | if incremental: |
| 228 | work_items = list(get_modified(shader_compiler, work_items, extra_args)) |
| 229 | if not work_items: |
| 230 | logging.info('All files are up to date') |
| 231 | return True |
| 232 | |
| 233 | logging.debug(f'Starting build for {len(work_items)} outputs') |
| 234 | outputs = [x.dest for x in work_items] |
| 235 | vcs.pre_build(outputs) |
| 236 | success = WorkItemProcessor().process(work_items) |
| 237 | vcs.submit(outputs, success) |
| 238 | return success |
| 239 | |
| 240 | |
| 241 | class Perforce: |
no test coverage detected