(rootDirectory, store)
| 48 | |
| 49 | |
| 50 | def findAllHeaderDirectory(rootDirectory, store): |
| 51 | headerDirsCacheDict = store.setdefault("headerDirs", {}) |
| 52 | headerDirs = headerDirsCacheDict.get(rootDirectory) |
| 53 | if headerDirs: |
| 54 | return headerDirs |
| 55 | |
| 56 | output = subprocess.check_output( |
| 57 | ["find", "-L", rootDirectory, "-name", "*.h"], universal_newlines=True |
| 58 | ) |
| 59 | headers = output.splitlines() |
| 60 | headerDirs = set() |
| 61 | frameworks = set() |
| 62 | for h in headers: |
| 63 | frameworkIndex = h.rfind(".framework") |
| 64 | if frameworkIndex != -1: |
| 65 | h = os.path.dirname(h[:frameworkIndex]) |
| 66 | frameworks.add(h) |
| 67 | else: |
| 68 | h = os.path.dirname(h) |
| 69 | headerDirs.add(h) |
| 70 | # contains more one dir for import with module name |
| 71 | # don't contains more one module name dir. if need, can specify in .flags |
| 72 | # conflict with #if_include framework check |
| 73 | # h = os.path.dirname(h) |
| 74 | # headerDirs.add(h) |
| 75 | |
| 76 | headerDirsCacheDict[rootDirectory] = (headerDirs, frameworks) |
| 77 | return headerDirs, frameworks |
| 78 | |
| 79 | |
| 80 | def findAllSwiftFiles(rootDirectory): |
no test coverage detected