Selaa lähdekoodia

Some wamr-ide improvements (#1354)

including:
- enable macOS support
- documentation improvements
- fix some warnings
YAMAMOTO Takashi 3 vuotta sitten
vanhempi
sitoutus
e8f0c9580b
21 muutettua tiedostoa jossa 288 lisäystä ja 80 poistoa
  1. 29 12
      test-tools/wamr-ide/README.md
  2. 219 0
      test-tools/wamr-ide/VSCode-Extension/LICENSE
  3. 1 1
      test-tools/wamr-ide/VSCode-Extension/package.json
  4. 2 0
      test-tools/wamr-ide/VSCode-Extension/resource/debug/README.md
  5. 1 5
      test-tools/wamr-ide/VSCode-Extension/resource/scripts/boot_debugger_server.bat
  6. 3 6
      test-tools/wamr-ide/VSCode-Extension/resource/scripts/boot_debugger_server.sh
  7. 1 5
      test-tools/wamr-ide/VSCode-Extension/resource/scripts/build.bat
  8. 3 6
      test-tools/wamr-ide/VSCode-Extension/resource/scripts/build.sh
  9. 3 5
      test-tools/wamr-ide/VSCode-Extension/resource/scripts/destroy.bat
  10. 5 7
      test-tools/wamr-ide/VSCode-Extension/resource/scripts/destroy.sh
  11. 1 5
      test-tools/wamr-ide/VSCode-Extension/resource/scripts/run.bat
  12. 3 6
      test-tools/wamr-ide/VSCode-Extension/resource/scripts/run.sh
  13. 1 1
      test-tools/wamr-ide/VSCode-Extension/src/debugConfigurationProvider.ts
  14. 1 1
      test-tools/wamr-ide/VSCode-Extension/src/decorationProvider.ts
  15. 3 3
      test-tools/wamr-ide/VSCode-Extension/src/extension.ts
  16. 5 5
      test-tools/wamr-ide/VSCode-Extension/src/taskProvider.ts
  17. 1 2
      test-tools/wamr-ide/WASM-Debug-Server/Docker/README.md
  18. 3 2
      test-tools/wamr-ide/WASM-Debug-Server/Docker/build_docker_image.sh
  19. 1 2
      test-tools/wamr-ide/WASM-Toolchain/Docker/README.md
  20. 0 3
      test-tools/wamr-ide/WASM-Toolchain/Docker/build_docker_image.bat
  21. 2 3
      test-tools/wamr-ide/WASM-Toolchain/Docker/build_docker_image.sh

+ 29 - 12
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.
 

+ 219 - 0
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.
+

+ 1 - 1
test-tools/wamr-ide/VSCode-Extension/package.json

@@ -14,7 +14,7 @@
         "Other"
     ],
     "activationEvents": [
-        "*"
+        "onStartupFinished"
     ],
     "main": "./out/extension.js",
     "contributes": {

+ 2 - 0
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.

+ 1 - 5
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

+ 3 - 6
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

+ 1 - 5
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

+ 3 - 6
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

+ 3 - 5
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."
+echo "Clean up docker containers successfully."

+ 5 - 7
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."
+echo "Clean up docker containers successfully."

+ 1 - 5
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

+ 3 - 6
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

+ 1 - 1
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',

+ 1 - 1
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)
                 : '';

+ 3 - 3
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

+ 5 - 5
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: {

+ 1 - 2
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.
+-   `resource/run.sh` is the script to execute the wasm app directly.

+ 3 - 2
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
+docker image prune -f

+ 1 - 2
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`.
+-   `resource/build_wasm.sh` is the script to compile the wasm app with `wasi-sdk`.

+ 0 - 3
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

+ 2 - 3
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