diff --git a/test-tools/wamr-ide/README.md b/test-tools/wamr-ide/README.md index 938cefe0..d5adbad9 100644 --- a/test-tools/wamr-ide/README.md +++ b/test-tools/wamr-ide/README.md @@ -14,6 +14,12 @@ The WAMR-IDE is an Integrated Development Environment to develop WebAssembly app ## How to setup WAMR IDE +Note: Please ensure that the scripts under `resource` directories have +execution permission. While on git they have x bits, you might have dropped +them eg. by copying them from Windows. +Similarly, do not drop execution permission when copying `lldb` binaries +under `resource/debug/bin`. + #### 1. Install `VSCode` on host. - make sure the version of [vscode](https://code.visualstudio.com/Download) you installed is at least _1.59.0_ @@ -33,15 +39,15 @@ The WAMR-IDE is an Integrated Development Environment to develop WebAssembly app #### 3. Build docker images -We have 2 docker images which should be built or loaded on your host, `wasm-toolchain` and `wasm-debug-server`. To build these 2 images, please enter the `WASM_Source_Debug_Server/Docker` & `WASM_Toolchain/Docker`, then execute the `build_docker_image` script respectively. +We have 2 docker images which should be built or loaded on your host, `wasm-toolchain` and `wasm-debug-server`. To build these 2 images, please enter the `WASM-Debug-Server/Docker` & `WASM-Toolchain/Docker`, then execute the `build_docker_image` script respectively. Windows (powershell): ```batch $ cd .\WASM-Toolchain\Docker -$ ./build_docker_image.bat -$ cd .\WASM-Source-Debug-Server\Docker -$ ./build_docker_image.bat +$ .\build_docker_image.bat +$ cd .\WASM-Debug-Server\Docker +$ .\build_docker_image.bat ``` Linux: @@ -67,14 +73,14 @@ Sometimes building the Docker images may fail due to bad network conditions. If ```xml $ cd .\docker_images\wasm-debug-server -$ docker build --no-cache --build-arg http_proxy=http://proxy-example.com:1234 ---build-arg https_proxy=http://proxy-example.com:1234 -t wasm-debug-server:1.0 . +$ docker build --no-cache --build-arg http_proxy=http://proxy.example.com:1234 +--build-arg https_proxy=http://proxy.example.com:1234 -t wasm-debug-server:1.0 . ``` ```xml $ cd .\docker_images\wasm-toolchain -$ docker build --no-cache --build-arg http_proxy=http://proxy-example.com:1234 ---build-arg https_proxy=http://proxy-example.com:1234 -t wasm-toolchain:1.0 . +$ docker build --no-cache --build-arg http_proxy=http://proxy.example.com:1234 +--build-arg https_proxy=http://proxy.example.com:1234 -t wasm-toolchain:1.0 . ``` #### If you encounter the problem `failed to solve with frontend dockerfile.v0: failed to create LLB definition`, please config your docker desktop @@ -89,9 +95,20 @@ $ docker build --no-cache --build-arg http_proxy=http://proxy-example.com:1234 `wamride-1.0.0.vsix` can be packaged by [`npm vsce`](https://code.visualstudio.com/api/working-with-extensions/publishing-extension). -> Note that patched `lldb` should be built and put into the `VSCode_Extension/resource/debug` folder before your package or extension debug process if you want to enable `source debugging` feature. Please follow this [instruction](../../doc/source_debugging.md#debugging-with-interpreter) to build `lldb`. -> -> **You can also debug the extension directly follow this [instruction](./VSCode_Extension/README.md) without packing the extension.** +```shell +$ npm install -g vsce +$ cd VSCode-Extension +$ rm -rf node_modules +$ npm install +$ vsce package +``` + +Note that patched `lldb` should be built and put into the `VSCode-Extension/resource/debug` folder before your package or extension debug process if you want to enable `source debugging` feature. +Please follow this [instruction](../../doc/source_debugging.md#debugging-with-interpreter) to build `lldb`. +Please follow this [instruction](./VSCode-Extension/resource/debug/README.md) +to copy the binaries. + +> **You can also debug the extension directly follow this [instruction](./VSCode-Extension/README.md) without packing the extension.** #### 5. Install extension from vsix @@ -113,7 +130,7 @@ select `wamride-1.0.0.vsix` which you have packed on your host. When you click `New project` button, the extension will pop up a message box at the bottom right of the screen as following: -![set-up-workspace-message](./Media/set-up-workspace-message.png "set up workspace message box") +![set-up-workspace-message](./Media/set_up_workspace_message.png "set up workspace message box") You can click `Set up now` and select the target folder to create project workspace, or you click `Maybe later` to close the message box. diff --git a/test-tools/wamr-ide/VSCode-Extension/LICENSE b/test-tools/wamr-ide/VSCode-Extension/LICENSE new file mode 100644 index 00000000..c6bd7e0c --- /dev/null +++ b/test-tools/wamr-ide/VSCode-Extension/LICENSE @@ -0,0 +1,219 @@ + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + + +--- LLVM Exceptions to the Apache 2.0 License ---- + +As an exception, if, as a result of your compiling your source code, portions +of this Software are embedded into an Object form of such source code, you +may redistribute such embedded portions in such Object form without complying +with the conditions of Sections 4(a), 4(b) and 4(d) of the License. + +In addition, if you combine or link compiled forms of this Software with +software that is licensed under the GPLv2 ("Combined Software") and if a +court of competent jurisdiction determines that the patent provision (Section +3), the indemnity provision (Section 9) or other Section of the License +conflicts with the conditions of the GPLv2, you may retroactively and +prospectively choose to deem waived or otherwise exclude such Section(s) of +the License, but only in their entirety and only with respect to the Combined +Software. + diff --git a/test-tools/wamr-ide/VSCode-Extension/package.json b/test-tools/wamr-ide/VSCode-Extension/package.json index bdf70dca..98aee2a9 100644 --- a/test-tools/wamr-ide/VSCode-Extension/package.json +++ b/test-tools/wamr-ide/VSCode-Extension/package.json @@ -14,7 +14,7 @@ "Other" ], "activationEvents": [ - "*" + "onStartupFinished" ], "main": "./out/extension.js", "contributes": { diff --git a/test-tools/wamr-ide/VSCode-Extension/resource/debug/README.md b/test-tools/wamr-ide/VSCode-Extension/resource/debug/README.md index e672d8b2..27efb169 100644 --- a/test-tools/wamr-ide/VSCode-Extension/resource/debug/README.md +++ b/test-tools/wamr-ide/VSCode-Extension/resource/debug/README.md @@ -8,4 +8,6 @@ /llvm/build-lldb/lib/liblldb.so.13 # move this file to resource/debug/lib/ ``` +Note: For macOS, the library is named like `liblldb.13.0.1.dylib`. + ### Then you can start the extension and run the execute source debugging by clicking the `debug` button in the extension panel. diff --git a/test-tools/wamr-ide/VSCode-Extension/resource/scripts/boot_debugger_server.bat b/test-tools/wamr-ide/VSCode-Extension/resource/scripts/boot_debugger_server.bat index 72dae7cc..34304971 100644 --- a/test-tools/wamr-ide/VSCode-Extension/resource/scripts/boot_debugger_server.bat +++ b/test-tools/wamr-ide/VSCode-Extension/resource/scripts/boot_debugger_server.bat @@ -3,12 +3,8 @@ @echo off -docker run -it --name=wasm-debug-server-ctr ^ +docker run --rm -it --name=wasm-debug-server-ctr ^ -v "%cd%":/mnt ^ -p 1234:1234 ^ wasm-debug-server:1.0 ^ /bin/bash -c "./debug.sh %1" - -@REM stop and remove wasm-debug-server-container -docker stop wasm-debug-server-ctr>nul 2>nul -docker rm wasm-debug-server-ctr>nul 2>nul \ No newline at end of file diff --git a/test-tools/wamr-ide/VSCode-Extension/resource/scripts/boot_debugger_server.sh b/test-tools/wamr-ide/VSCode-Extension/resource/scripts/boot_debugger_server.sh index c8ffc38c..9bd24548 100755 --- a/test-tools/wamr-ide/VSCode-Extension/resource/scripts/boot_debugger_server.sh +++ b/test-tools/wamr-ide/VSCode-Extension/resource/scripts/boot_debugger_server.sh @@ -1,13 +1,10 @@ +#!/bin/bash + # Copyright (C) 2019 Intel Corporation. All rights reserved. # SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -#!/bin/bash - -docker run -it --name=wasm-debug-server-ctr \ +docker run --rm -it --name=wasm-debug-server-ctr \ -v "$(pwd)":/mnt \ -p 1234:1234 \ wasm-debug-server:1.0 \ /bin/bash -c "./debug.sh $1" - -docker stop wasm-debug-server-ctr>/dev/null -docker rm wasm-debug-server-ctr>/dev/null \ No newline at end of file diff --git a/test-tools/wamr-ide/VSCode-Extension/resource/scripts/build.bat b/test-tools/wamr-ide/VSCode-Extension/resource/scripts/build.bat index 0548521c..1fe6ca41 100644 --- a/test-tools/wamr-ide/VSCode-Extension/resource/scripts/build.bat +++ b/test-tools/wamr-ide/VSCode-Extension/resource/scripts/build.bat @@ -4,12 +4,8 @@ @echo off @REM start a container, mount current project path to container/mnt -docker run --name=wasm-toolchain-ctr ^ +docker run --rm --name=wasm-toolchain-ctr ^ -it -v "%cd%":/mnt ^ --env=PROJ_PATH="%cd%" ^ wasm-toolchain:1.0 ^ /bin/bash -c "./build_wasm.sh %1" - -@REM stop and remove wasm-toolchain-ctr container -docker stop wasm-toolchain-ctr>nul 2>nul -docker rm wasm-toolchain-ctr>nul 2>nul \ No newline at end of file diff --git a/test-tools/wamr-ide/VSCode-Extension/resource/scripts/build.sh b/test-tools/wamr-ide/VSCode-Extension/resource/scripts/build.sh index 9b40dded..193d53b6 100755 --- a/test-tools/wamr-ide/VSCode-Extension/resource/scripts/build.sh +++ b/test-tools/wamr-ide/VSCode-Extension/resource/scripts/build.sh @@ -1,13 +1,10 @@ +#!/bin/bash + # Copyright (C) 2019 Intel Corporation. All rights reserved. # SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -#!/bin/bash - -docker run --name=wasm-toolchain-ctr \ +docker run --rm --name=wasm-toolchain-ctr \ -it -v "$(pwd)":/mnt \ --env=PROJ_PATH="$(pwd)" \ wasm-toolchain:1.0 \ /bin/bash -c "./build_wasm.sh $1" - -docker stop wasm-toolchain-ctr>/dev/null -docker rm wasm-toolchain-ctr>/dev/null \ No newline at end of file diff --git a/test-tools/wamr-ide/VSCode-Extension/resource/scripts/destroy.bat b/test-tools/wamr-ide/VSCode-Extension/resource/scripts/destroy.bat index 98891b25..faf316ab 100644 --- a/test-tools/wamr-ide/VSCode-Extension/resource/scripts/destroy.bat +++ b/test-tools/wamr-ide/VSCode-Extension/resource/scripts/destroy.bat @@ -22,17 +22,15 @@ echo "Prepare to clean up the docker containers..." call docker inspect wasm-toolchain-ctr>nul 2>nul IF %ERRORLEVEL% EQU 0 ( echo "Stopping and removing wasm-toolchain-ctr container..." - docker stop wasm-toolchain-ctr>nul 2>nul - docker rm wasm-toolchain-ctr>nul 2>nul + docker rm -f wasm-toolchain-ctr>nul 2>nul echo "Done." ) call docker inspect wasm-debug-server-ctr>nul 2>nul IF %ERRORLEVEL% EQU 0 ( echo "Stopping and removing wasm-debug-server-ctr container..." - docker stop wasm-debug-server-ctr>nul 2>nul - docker rm wasm-debug-server-ctr>nul 2>nul + docker rm -f wasm-debug-server-ctr>nul 2>nul echo "Done." ) -echo "Clean up docker containers successfully." \ No newline at end of file +echo "Clean up docker containers successfully." diff --git a/test-tools/wamr-ide/VSCode-Extension/resource/scripts/destroy.sh b/test-tools/wamr-ide/VSCode-Extension/resource/scripts/destroy.sh index f15f4370..aa90a86d 100755 --- a/test-tools/wamr-ide/VSCode-Extension/resource/scripts/destroy.sh +++ b/test-tools/wamr-ide/VSCode-Extension/resource/scripts/destroy.sh @@ -1,8 +1,8 @@ +#!/bin/bash + # Copyright (C) 2019 Intel Corporation. All rights reserved. # SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -#!/bin/bash - docker -v>/dev/null if [ $? -ne 0 ]; then echo "\nDocker is not installed, please install docker firstly.\n" @@ -19,16 +19,14 @@ echo "Prepare to clean up the docker containers..." if test ! -z "$(docker ps -a | grep wasm-toolchain-ctr)"; then echo "Stopping and removing wasm-toolchain-ctr container..." - docker stop wasm-toolchain-ctr>/dev/null - docker rm wasm-toolchain-ctr>/dev/null + docker rm -f wasm-toolchain-ctr>/dev/null echo "Done." fi if test ! -z "$(docker ps -a | grep wasm-debug-server-ctr)"; then echo "Stopping and removing wasm-debug-server-ctr container..." - docker stop wasm-debug-server-ctr>/dev/null - docker rm wasm-debug-server-ctr>/dev/null + docker rm -f wasm-debug-server-ctr>/dev/null echo "Done." fi -echo "Clean up docker containers successfully." \ No newline at end of file +echo "Clean up docker containers successfully." diff --git a/test-tools/wamr-ide/VSCode-Extension/resource/scripts/run.bat b/test-tools/wamr-ide/VSCode-Extension/resource/scripts/run.bat index a33ba448..45d86bda 100644 --- a/test-tools/wamr-ide/VSCode-Extension/resource/scripts/run.bat +++ b/test-tools/wamr-ide/VSCode-Extension/resource/scripts/run.bat @@ -3,11 +3,7 @@ @echo off -docker run -it --name=wasm-debug-server-ctr ^ +docker run --rm -it --name=wasm-debug-server-ctr ^ -v "%cd%":/mnt ^ wasm-debug-server:1.0 ^ /bin/bash -c "./run.sh %1" - -@REM stop and remove wasm-debug-server-ctr -docker stop wasm-debug-server-ctr>nul 2>nul -docker rm wasm-debug-server-ctr>nul 2>nul \ No newline at end of file diff --git a/test-tools/wamr-ide/VSCode-Extension/resource/scripts/run.sh b/test-tools/wamr-ide/VSCode-Extension/resource/scripts/run.sh index b1a60421..e9aacbc4 100755 --- a/test-tools/wamr-ide/VSCode-Extension/resource/scripts/run.sh +++ b/test-tools/wamr-ide/VSCode-Extension/resource/scripts/run.sh @@ -1,12 +1,9 @@ +#!/bin/bash + # Copyright (C) 2019 Intel Corporation. All rights reserved. # SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -#!/bin/bash - -docker run -it --name=wasm-debug-server-ctr \ +docker run --rm -it --name=wasm-debug-server-ctr \ -v "$(pwd)":/mnt \ wasm-debug-server:1.0 \ /bin/bash -c "./run.sh $1" - -docker stop wasm-debug-server-ctr>/dev/null -docker rm wasm-debug-server-ctr>/dev/null \ No newline at end of file diff --git a/test-tools/wamr-ide/VSCode-Extension/src/debugConfigurationProvider.ts b/test-tools/wamr-ide/VSCode-Extension/src/debugConfigurationProvider.ts index 64e3ea28..8fd539c8 100644 --- a/test-tools/wamr-ide/VSCode-Extension/src/debugConfigurationProvider.ts +++ b/test-tools/wamr-ide/VSCode-Extension/src/debugConfigurationProvider.ts @@ -33,7 +33,7 @@ export class WasmDebugConfigurationProvider this.port = port; this.hostPath = hostPath; /* linux and windows has different debug configuration */ - if (os.platform() === 'win32') { + if (os.platform() === 'win32' || os.platform() === 'darwin') { this.wasmDebugConfig = { type: 'wamr-debug', name: 'Attach', diff --git a/test-tools/wamr-ide/VSCode-Extension/src/decorationProvider.ts b/test-tools/wamr-ide/VSCode-Extension/src/decorationProvider.ts index eb17ab0c..db636913 100644 --- a/test-tools/wamr-ide/VSCode-Extension/src/decorationProvider.ts +++ b/test-tools/wamr-ide/VSCode-Extension/src/decorationProvider.ts @@ -51,7 +51,7 @@ export class DecorationProvider implements vscode.FileDecorationProvider { currentPrjDir = os.platform() === 'win32' ? (vscode.workspace.workspaceFolders?.[0].uri.fsPath as string) - : os.platform() === 'linux' + : os.platform() === 'linux' || os.platform() === 'darwin' ? (currentPrjDir = vscode.workspace.workspaceFolders?.[0].uri .path as string) : ''; diff --git a/test-tools/wamr-ide/VSCode-Extension/src/extension.ts b/test-tools/wamr-ide/VSCode-Extension/src/extension.ts index 5de39439..57f2aa09 100644 --- a/test-tools/wamr-ide/VSCode-Extension/src/extension.ts +++ b/test-tools/wamr-ide/VSCode-Extension/src/extension.ts @@ -58,7 +58,7 @@ export async function activate(context: vscode.ExtensionContext) { runScript = scriptPrefix.concat('run.bat'); debugScript = scriptPrefix.concat('boot_debugger_server.bat'); destroyScript = scriptPrefix.concat('destroy.bat'); - } else if (OS_PLATFORM === 'linux') { + } else if (OS_PLATFORM === 'linux' || OS_PLATFORM === 'darwin') { buildScript = scriptPrefix.concat('build.sh'); runScript = scriptPrefix.concat('run.sh'); debugScript = scriptPrefix.concat('boot_debugger_server.sh'); @@ -90,7 +90,7 @@ export async function activate(context: vscode.ExtensionContext) { if (OS_PLATFORM === 'win32') { currentPrjDir = vscode.workspace.workspaceFolders?.[0].uri .fsPath as string; - } else if (OS_PLATFORM === 'linux') { + } else if (OS_PLATFORM === 'linux' || OS_PLATFORM === 'darwin') { currentPrjDir = vscode.workspace.workspaceFolders?.[0].uri .path as string; } @@ -660,7 +660,7 @@ export async function activate(context: vscode.ExtensionContext) { let _path = curWorkspace.concat( OS_PLATFORM === 'win32' ? '\\' - : OS_PLATFORM === 'linux' + : OS_PLATFORM === 'linux' || OS_PLATFORM === 'darwin' ? '/' : '', option diff --git a/test-tools/wamr-ide/VSCode-Extension/src/taskProvider.ts b/test-tools/wamr-ide/VSCode-Extension/src/taskProvider.ts index 0a98299d..e5e1280e 100644 --- a/test-tools/wamr-ide/VSCode-Extension/src/taskProvider.ts +++ b/test-tools/wamr-ide/VSCode-Extension/src/taskProvider.ts @@ -31,11 +31,11 @@ export class WasmTaskProvider implements vscode.TaskProvider { let targetName = TargetConfigPanel.BUILD_ARGS.output_file_name.split('.')[0]; - if (os.platform() === 'linux' || os.platform() === 'win32') { + if (os.platform() === 'linux' || os.platform() === 'darwin' || os.platform() === 'win32') { /* build */ this.buildShellOption = { cmd: - os.platform() === 'linux' + os.platform() === 'linux' || os.platform() === 'darwin' ? 'bash' : (this._script.get('buildScript') as string), options: { @@ -47,7 +47,7 @@ export class WasmTaskProvider implements vscode.TaskProvider { /* debug */ this.debugShellOption = { cmd: - os.platform() === 'linux' + os.platform() === 'linux' || os.platform() === 'darwin' ? 'bash' : (this._script.get('debugScript') as string), options: { @@ -59,7 +59,7 @@ export class WasmTaskProvider implements vscode.TaskProvider { /* run */ this.runShellOption = { cmd: - os.platform() === 'linux' + os.platform() === 'linux' || os.platform() === 'darwin' ? 'bash' : (this._script.get('runScript') as string), options: { @@ -72,7 +72,7 @@ export class WasmTaskProvider implements vscode.TaskProvider { /* run */ this.destroyShellOption = { cmd: - os.platform() === 'linux' + os.platform() === 'linux' || os.platform() === 'darwin' ? 'bash' : (this._script.get('destroyScript') as string), options: { diff --git a/test-tools/wamr-ide/WASM-Debug-Server/Docker/README.md b/test-tools/wamr-ide/WASM-Debug-Server/Docker/README.md index 6f08e9c9..b4738e86 100644 --- a/test-tools/wamr-ide/WASM-Debug-Server/Docker/README.md +++ b/test-tools/wamr-ide/WASM-Debug-Server/Docker/README.md @@ -3,7 +3,6 @@ - Linux ```shell - chmod +x resource/* ./build_docker_image.sh ``` @@ -18,4 +17,4 @@ - `Dockerflie` is the source file to build `wasm-debug-server` docker image - `resource/debug.sh` is the script to execute the wasm app in debug mod, will start up the debugger server inside of the `iwasm` and hold to wait for connecting. -- `resource/run.sh` is the script to execute the wasm app directly. \ No newline at end of file +- `resource/run.sh` is the script to execute the wasm app directly. diff --git a/test-tools/wamr-ide/WASM-Debug-Server/Docker/build_docker_image.sh b/test-tools/wamr-ide/WASM-Debug-Server/Docker/build_docker_image.sh index 6573a709..6beedd6d 100755 --- a/test-tools/wamr-ide/WASM-Debug-Server/Docker/build_docker_image.sh +++ b/test-tools/wamr-ide/WASM-Debug-Server/Docker/build_docker_image.sh @@ -1,8 +1,9 @@ +#!/bin/bash + # Copyright (C) 2019 Intel Corporation. All rights reserved. # SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -#!/bin/bash docker build -t wasm-debug-server:1.0 . # delete intermediate docker image -docker image prune -f \ No newline at end of file +docker image prune -f diff --git a/test-tools/wamr-ide/WASM-Toolchain/Docker/README.md b/test-tools/wamr-ide/WASM-Toolchain/Docker/README.md index 71940225..f5ecb957 100644 --- a/test-tools/wamr-ide/WASM-Toolchain/Docker/README.md +++ b/test-tools/wamr-ide/WASM-Toolchain/Docker/README.md @@ -3,7 +3,6 @@ - Linux ```shell - chmod +x resource/* ./build_docker_image.sh ``` @@ -16,4 +15,4 @@ ### Resource Details - `Dockerflie` is the source file to build `wasm-debug-server` docker image. -- `resource/build_wasm.sh` is the script to compile the wasm app with `wasi-sdk`. \ No newline at end of file +- `resource/build_wasm.sh` is the script to compile the wasm app with `wasi-sdk`. diff --git a/test-tools/wamr-ide/WASM-Toolchain/Docker/build_docker_image.bat b/test-tools/wamr-ide/WASM-Toolchain/Docker/build_docker_image.bat index 6aabb505..96fb0287 100644 --- a/test-tools/wamr-ide/WASM-Toolchain/Docker/build_docker_image.bat +++ b/test-tools/wamr-ide/WASM-Toolchain/Docker/build_docker_image.bat @@ -3,9 +3,6 @@ @echo off -@REM pull gcc and ubuntu image firstly no matter whether exist or not. -docker pull gcc:9.3.0 -docker pull ubuntu:20.04 docker build -t wasm-toolchain:1.0 . @REM delete intermediate docker image diff --git a/test-tools/wamr-ide/WASM-Toolchain/Docker/build_docker_image.sh b/test-tools/wamr-ide/WASM-Toolchain/Docker/build_docker_image.sh index a82d39be..aa1e2f5e 100755 --- a/test-tools/wamr-ide/WASM-Toolchain/Docker/build_docker_image.sh +++ b/test-tools/wamr-ide/WASM-Toolchain/Docker/build_docker_image.sh @@ -1,9 +1,8 @@ +#!/bin/bash + # Copyright (C) 2019 Intel Corporation. All rights reserved. # SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -#!/bin/bash -docker pull gcc:9.3.0 -docker pull ubuntu:20.04 docker build -t wasm-toolchain:1.0 . # delete intermediate docker image