MCPcopy Create free account
hub / github.com/nodejs/node / ExecPackageFramework

Method ExecPackageFramework

tools/gyp/pylib/gyp/mac_tool.py:303–330  ·  view source on GitHub ↗

Takes a path to Something.framework and the Current version of that and sets up all the symlinks.

(self, framework, version)

Source from the content-addressed store, hash-verified

301 module_file.write(module_template)
302
303 def ExecPackageFramework(self, framework, version):
304 """Takes a path to Something.framework and the Current version of that and
305 sets up all the symlinks."""
306 # Find the name of the binary based on the part before the ".framework".
307 binary = os.path.basename(framework).split(".")[0]
308
309 CURRENT = "Current"
310 RESOURCES = "Resources"
311 VERSIONS = "Versions"
312
313 if not os.path.exists(os.path.join(framework, VERSIONS, version, binary)):
314 # Binary-less frameworks don't seem to contain symlinks (see e.g.
315 # chromium's out/Debug/org.chromium.Chromium.manifest/ bundle).
316 return
317
318 # Move into the framework directory to set the symlinks correctly.
319 pwd = os.getcwd()
320 os.chdir(framework)
321
322 # Set up the Current version.
323 self._Relink(version, os.path.join(VERSIONS, CURRENT))
324
325 # Set up the root symlinks.
326 self._Relink(os.path.join(VERSIONS, CURRENT, binary), binary)
327 self._Relink(os.path.join(VERSIONS, CURRENT, RESOURCES), RESOURCES)
328
329 # Back to where we were before!
330 os.chdir(pwd)
331
332 def _Relink(self, dest, link):
333 """Creates a symlink to |dest| named |link|. If |link| already exists,

Callers

nothing calls this directly

Calls 5

_RelinkMethod · 0.95
chdirMethod · 0.80
splitMethod · 0.45
existsMethod · 0.45
joinMethod · 0.45

Tested by

no test coverage detected