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

Method __init__

server.py:54–79  ·  view source on GitHub ↗

pass in path should be absolute and normalized :param new_version: if LSP is new version and support target prepare

(self, root_path: str, cache_path, new_version)

Source from the content-addressed store, hash-verified

52
53class State(object):
54 def __init__(self, root_path: str, cache_path, new_version):
55 """
56 pass in path should be absolute and normalized
57 :param new_version: if LSP is new version and support target prepare
58 """
59 self.root_path = root_path
60 self.cache_path = cache_path
61 self.new_version = new_version
62 os.makedirs(cache_path, exist_ok=True)
63
64 # buildServer.json used as config dict
65 config_path = os.path.join(root_path, "buildServer.json")
66 self.config = ServerConfig(config_path)
67
68 # opened files need to be notified when flags changed
69 self.observed_uri = set()
70 # background thread to observe changes
71 self.observed_thread: Optional[Thread] = None
72
73 # {path: mtime} cache. use to find changes
74 self.observed_info = {self.config.path: get_mtime(self.config.path)}
75
76 self.reinit_compile_info()
77 # NOTE:thread-safety: for state shared by main and background watch thread,
78 # can only changed in sync_compile_file, which block all thread and no one access it.
79 # other time, the shared state is readonly and safe..
80
81 def get_compile_file(self, config: ServerConfig):
82 # isolate xcode generate compile file and manual compile_file

Callers

nothing calls this directly

Calls 3

reinit_compile_infoMethod · 0.95
ServerConfigClass · 0.90
get_mtimeFunction · 0.90

Tested by

no test coverage detected