Returns True if any SDK component was installed of False all componented were already installed.
(self)
| 2093 | return self.install_tool() |
| 2094 | |
| 2095 | def install_sdk(self): |
| 2096 | """Returns True if any SDK component was installed of False all componented |
| 2097 | were already installed. |
| 2098 | """ |
| 2099 | print(f"Installing SDK '{self}'..") |
| 2100 | installed = False |
| 2101 | |
| 2102 | for tool_name in self.uses: |
| 2103 | tool = find_tool(tool_name) |
| 2104 | if tool is None: |
| 2105 | exit_with_error(f"manifest error: No tool by name '{tool_name}' found! This may indicate an internal SDK error!") |
| 2106 | installed |= tool.install() |
| 2107 | |
| 2108 | if not installed: |
| 2109 | print(f"All SDK components already installed: '{self}'.") |
| 2110 | return False |
| 2111 | |
| 2112 | if self.custom_install_script == 'emscripten_npm_install': |
| 2113 | # upstream tools have hardcoded paths that are not stored in emsdk_manifest.json registry |
| 2114 | install_path = 'upstream' |
| 2115 | emscripten_dir = os.path.join(EMSDK_PATH, install_path, 'emscripten') |
| 2116 | # Older versions of the sdk did not include the node_modules directory |
| 2117 | # and require `npm ci` to be run post-install |
| 2118 | if not os.path.exists(os.path.join(emscripten_dir, 'node_modules')): |
| 2119 | if not emscripten_npm_install(self, emscripten_dir): |
| 2120 | exit_with_error('post-install step failed: emscripten_npm_install') |
| 2121 | |
| 2122 | print(f"Done installing SDK '{self}'.") |
| 2123 | return True |
| 2124 | |
| 2125 | def install_tool(self): |
| 2126 | """Returns True if the SDK was installed of False if was skipped due to |
no test coverage detected