Gets the list of files to include to the Android.bp :param repo_path: Path of the repository :return: The filtered list of useful filess
(repo_path)
| 166 | |
| 167 | |
| 168 | def list_all_files(repo_path): |
| 169 | """ Gets the list of files to include to the Android.bp |
| 170 | |
| 171 | :param repo_path: Path of the repository |
| 172 | :return: The filtered list of useful filess |
| 173 | """ |
| 174 | if not repo_path.endswith('/'): |
| 175 | repo_path = repo_path + "/" |
| 176 | |
| 177 | # Get cpp files |
| 178 | cpp_files = [] |
| 179 | cl_files = [] |
| 180 | for path, subdirs, files in os.walk(repo_path): |
| 181 | for file in files: |
| 182 | if file.endswith(".cpp"): |
| 183 | cpp_files.append(os.path.join(path, file)) |
| 184 | elif file.endswith(".cl"): |
| 185 | cl_files.append(os.path.join(path, file)) |
| 186 | # Include CL headers |
| 187 | if "src/core/CL/cl_kernels" in path and file.endswith(".h"): |
| 188 | cl_files.append(os.path.join(path, file)) |
| 189 | # Filter out unused cpp files |
| 190 | filtered_cpp_files = [] |
| 191 | for cpp_file in cpp_files: |
| 192 | if any(ep in cpp_file for ep in excluded_paths) or any(ef in cpp_file for ef in excluded_files): |
| 193 | continue |
| 194 | filtered_cpp_files.append(cpp_file.replace(repo_path, "")) |
| 195 | # Filter out unused cl files |
| 196 | filtered_cl_files = [] |
| 197 | for cl_file in cl_files: |
| 198 | if any(ep in cl_file for ep in excluded_paths): |
| 199 | continue |
| 200 | filtered_cl_files.append(cl_file.replace(repo_path, "")) |
| 201 | |
| 202 | return filtered_cpp_files, filtered_cl_files |
| 203 | |
| 204 | |
| 205 | if __name__ == "__main__": |
no test coverage detected