MCPcopy Create free account
hub / github.com/SolaWing/xcode-build-server / findAllHeaderDirectory

Function findAllHeaderDirectory

compile_database.py:50–77  ·  view source on GitHub ↗
(rootDirectory, store)

Source from the content-addressed store, hash-verified

48
49
50def 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
80def findAllSwiftFiles(rootDirectory):

Callers 1

InferFlagsForSwiftFunction · 0.85

Calls 1

getMethod · 0.80

Tested by

no test coverage detected