|
1 | 1 | # Developing this extension |
2 | 2 |
|
3 | 3 | ## Prerequisites |
| 4 | + |
4 | 5 | - Install **Visual Studio Code**. |
5 | 6 | - Install **Node.js** on your machine and ensure it is on your path. |
6 | 7 | - The currently recommended version is 20.x (LTS). |
7 | 8 | - Install **Yarn** which is used to build and execute scripts in this repository: |
8 | | -``` |
9 | | -> npm install -g yarn |
10 | | -``` |
| 9 | + |
| 10 | + ```sh |
| 11 | + > npm install -g yarn |
| 12 | + ``` |
11 | 13 |
|
12 | 14 | ## Building |
13 | 15 |
|
14 | | -1. Open a terminal and execute the following command to download NPM dependencies and tools, and to build the Typescript code: |
15 | | -``` |
16 | | -> yarn |
17 | | -``` |
| 16 | +Major parts are platform independent but due to the inclusion of binary tools the resulting |
| 17 | +packages become platform-specific, i.e. for on `<target>`. |
| 18 | + |
| 19 | +Supported `<target>`s are: |
| 20 | + |
| 21 | +- win32-x64 (Windows, Intel, x86-64) |
| 22 | +- win32-arm64 (Windows, Arm, aarch64) |
| 23 | +- linux-x64 (Linux, Intel, x86-64) |
| 24 | +- linux-arm64 (Linux, Arm, aarch64) |
| 25 | +- darwin-x64 (MacOS, Intel, x86-64) |
| 26 | +- darwin-arm64 (MacOS, Arm, aarch64) |
| 27 | + |
| 28 | +1. Open a terminal and execute the following command to download NPM dependencies and tools, and |
| 29 | + to build the Typescript code: |
| 30 | + |
| 31 | + ```sh |
| 32 | + > yarn |
| 33 | + ``` |
| 34 | + |
| 35 | +2. Download binary tools |
| 36 | + |
| 37 | + ```sh |
| 38 | + > yarn download-tools [--target <target>] [--no-cache] |
| 39 | + ``` |
| 40 | + |
| 41 | + If no `<target>` is specified the local system's architecture is used by default. |
| 42 | + By default, tool downloads are cached in the yarn cache (see `yarn cache dir`) to prevent |
| 43 | + recurring downloads of exact same archives on clean builds. |
18 | 44 |
|
19 | | -2. Package the extension as a locally installable VSIX file: |
20 | | -``` |
21 | | -> yarn package |
22 | | -``` |
| 45 | +3. Package the extension as a locally installable VSIX file: |
| 46 | +
|
| 47 | + ```sh |
| 48 | + > yarn package [--target <target>] |
| 49 | + ``` |
23 | 50 |
|
24 | 51 | ## Developing |
25 | 52 |
|
26 | | -1. If you are developing and debugging this extension, we recommend you run the following command after an initial build: |
27 | | -``` |
28 | | -> yarn watch |
29 | | -``` |
30 | | -While just calling `yarn` creates a production build of the extension, running the above creates a build dedicated for debug. Additionally, it sets up a watch which detects code changes and rebuilds them incrementally. |
| 53 | +1. If you are developing and debugging this extension, we recommend you run the following command |
| 54 | + after an initial build: |
| 55 | +
|
| 56 | + ```sh |
| 57 | + > yarn watch |
| 58 | + ``` |
| 59 | +
|
| 60 | + While just calling `yarn` creates a production build of the extension, running the above |
| 61 | + creates a build dedicated for debug. Additionally, it sets up a watch which detects code |
| 62 | + changes and rebuilds them incrementally. |
31 | 63 |
|
32 | 64 | 2. Switch to the VS Code `Run and Debug` view. |
| 65 | +
|
33 | 66 | 3. Select and run `Desktop Extension`. This launches an extension host that runs this extension. |
34 | 67 |
|
35 | 68 | ## Testing |
36 | 69 |
|
37 | 70 | 1. Run the following command to execute all test locally: |
38 | | -``` |
39 | | -> yarn test |
40 | | -``` |
41 | 71 |
|
42 | | -**Note**: At this point, no tests have been added to this repository. |
| 72 | + ```sh |
| 73 | + > yarn test |
| 74 | + ``` |
| 75 | +
|
| 76 | + **Note**: At this point, no tests have been added to this repository. |
| 77 | +
|
| 78 | +## Updating tool dependencies |
| 79 | +
|
| 80 | +Tool dependencies are recorded in `package.json`: |
| 81 | +
|
| 82 | +```json |
| 83 | + "cmsis": { |
| 84 | + "<tool>": "[<owner>/<repo>@]<version>" |
| 85 | + } |
| 86 | +```` |
| 87 | +
|
| 88 | +The `<version>` must match the tools release version tag. |
0 commit comments