(self, *, aim, binary_cache_suffix=None, cmake_options="")
| 160 | self.hash = hash |
| 161 | |
| 162 | def build(self, *, aim, binary_cache_suffix=None, cmake_options=""): |
| 163 | os.chdir(self.build_dir) |
| 164 | binary_path = self._get_cached_binary_name(binary=aim, binary_cache_suffix=binary_cache_suffix) |
| 165 | if os.path.exists(binary_path): |
| 166 | LOG.info(f'Found cached binary: {binary_path}') |
| 167 | return |
| 168 | |
| 169 | branch_hash = get_branch_hash_name(branch=self.branch, hash=self.hash) |
| 170 | output_prefix = os.path.join(self.build_dir, branch_hash + '_') |
| 171 | |
| 172 | cmake_cmd = f'{self.cmake_cmd} {self.omim_path} {cmake_options}' |
| 173 | self._run_system(cmd=cmake_cmd, output_file=output_prefix + 'cmake_run.log', log_cmd=True) |
| 174 | make_cmd = f'make -j{self.cpu_count} {aim}' |
| 175 | self._run_system(cmd=make_cmd, output_file=output_prefix + 'make_run.log', log_cmd=True) |
| 176 | LOG.info(f'Build {aim} done') |
| 177 | self._run_system(cmd=f'cp {aim} {binary_path}') |
| 178 | |
| 179 | def run(self, *, binary, binary_cache_suffix=None, args, env=None, output_file=None, log_error_code=True): |
| 180 | binary_path = self._get_cached_binary_name(binary=binary, binary_cache_suffix=binary_cache_suffix) |
no test coverage detected