From 80e31ebfa1d312ffcee9b0e7dd40a45fd9eaf8f4 Mon Sep 17 00:00:00 2001 From: chenwenhao Date: Mon, 15 Jan 2024 11:29:45 +0800 Subject: [PATCH] update readme --- Dockerfile | 6 ------ README.md | 28 +++++++++------------------- build-in-linux.sh | 7 ------- build-in-win.bash | 5 ----- run-mac.sh | 26 ++++++++++++-------------- run-win64.sh | 26 ++++++++++++-------------- 6 files changed, 33 insertions(+), 65 deletions(-) delete mode 100644 Dockerfile delete mode 100644 build-in-linux.sh delete mode 100644 build-in-win.bash diff --git a/Dockerfile b/Dockerfile deleted file mode 100644 index c060338f..00000000 --- a/Dockerfile +++ /dev/null @@ -1,6 +0,0 @@ -FROM registry.cn-shenzhen.aliyuncs.com/seeed-public/codecraft-build-env:latest - -ENV NODE_OPTIONS='--max_old_space_size=10240' -ENV CSC_IDENTITY_AUTO_DISCOVERY=false - -WORKDIR /root/workspace/seeed-codecraft_2f88 diff --git a/README.md b/README.md index 0202f1eb..6e652586 100644 --- a/README.md +++ b/README.md @@ -30,18 +30,8 @@ You can download the latest version from [the download page from our website](ht ## Prerequisites This project requires: -- [Node.js 14+](https://nodejs.org/) -- [Python 2.x](https://www.python.org/downloads/release/python-272/), and make it as the default version - -## Build - -Clone this repo - -```bash -git clone -b main https://github.com/Seeed-Studio/CodeCraft.git ~/seeed-codecraft -export workspace=~/seeed-codecraft -pushd $workspace -``` +- [Node.js 16+](https://nodejs.org/) +- [Python 2.x](https://www.python.org/downloads/release/python-272/), or [Python 3.x](https://www.python.org/downloads/) and make it as the default version ### Auto Install @@ -60,16 +50,16 @@ bash run-win64.sh ### Manual Installation ```bash -cd ${workspace}/blocks +cd ./blocks npm install && npm run build -cd ${workspace}/l10n +cd ./l10n npm install && npm run build -cd ${workspace}/vm +cd ./vm npm install && npm run build -cd ${workspace}/gui +cd ./gui npm install ``` @@ -88,8 +78,8 @@ npm run build-win #### Build main app ```bash -rm -r ${workspace}/main/app/gui && cp -r ./build ${workspace}/main/app/gui -cd ${workspace}/main/app +rm -r ../main/app/gui && cp -r ./build ../main/app/gui +cd ./main/app npm install ./node_modules/.bin/electron-rebuild serialport @@ -97,7 +87,7 @@ npm install # system, you need to open powershell as an administrator, and then execute # Set-ExecutionPolicy RemoteSigned -cd ${workspace}/main +cd ./main npm install rm -r build ``` diff --git a/build-in-linux.sh b/build-in-linux.sh deleted file mode 100644 index 5e221be2..00000000 --- a/build-in-linux.sh +++ /dev/null @@ -1,7 +0,0 @@ -#!/bin/bash - -docker build . -t seeed/codecraft-build-env:latest - -docker run -it --rm -v $(pwd):/root/workspace/seeed-codecraft_2f88 seeed/codecraft-build-env:latest bash -c "chmod +x run-win64.sh && ./run-win64.sh" - -docker run -it --rm -v $(pwd):/root/workspace/seeed-codecraft_2f88 seeed/codecraft-build-env:latest bash -c "chmod +x run-mac.sh && ./run-mac.sh" diff --git a/build-in-win.bash b/build-in-win.bash deleted file mode 100644 index e4897b90..00000000 --- a/build-in-win.bash +++ /dev/null @@ -1,5 +0,0 @@ -docker build . -t seeed/codecraft-build-env:latest - -docker run -it --rm -v $(pwd):/root/workspace/seeed-codecraft_2f88 seeed/codecraft-build-env:latest bash -c "chmod +x run-win64.sh && ./run-win64.sh" - -docker run -it --rm -v $(pwd):/root/workspace/seeed-codecraft_2f88 seeed/codecraft-build-env:latest bash -c "chmod +x run-mac.sh && ./run-mac.sh" diff --git a/run-mac.sh b/run-mac.sh index 59fc828d..3d44af8b 100755 --- a/run-mac.sh +++ b/run-mac.sh @@ -1,34 +1,32 @@ #!/bin/bash echo "======start codecraft build=====" -script_dir="/root/workspace/seeed-codecraft_2f88" -export CSC_IDENTITY_AUTO_DISCOVERY=false -export NODE_OPTIONS='--max_old_space_size=10240' +project_dir=$(cd $(dirname $0); pwd) echo "======install gui====" -cd ${script_dir}/gui && npm install -y --unsafe-perm=true +cd ${project_dir}/gui && npm install echo "======install blocks=====" -cd ${script_dir}/blocks && npm install -y --unsafe-perm=true +cd ${project_dir}/blocks && npm install echo "======build blocks=====" -cd ${script_dir}/blocks && npm run build +cd ${project_dir}/blocks && npm run build echo "======install l10n=====" -cd ${script_dir}/l10n && npm install -y --unsafe-perm=true +cd ${project_dir}/l10n && npm install echo "======build l10n=====" -cd ${script_dir}/l10n && npm run build +cd ${project_dir}/l10n && npm run build echo "======install vm=====" -cd ${script_dir}/vm && npm install -y --unsafe-perm=true +cd ${project_dir}/vm && npm install echo "======build vm=====" -cd ${script_dir}/vm && npm run build +cd ${project_dir}/vm && npm run build echo "======build gui=====" -cd ${script_dir}/gui && npm run build-mac -cd ${script_dir}/gui && rm -rf ../main/app/gui && cp -r ./build ../main/app/gui +cd ${project_dir}/gui && npm run build-mac +cd ${project_dir}/gui && rm -rf ../main/app/gui && cp -r ./build ../main/app/gui echo "======build app=====" -cd ${script_dir}/main/app && npm install -y --unsafe-perm=true && ./node_modules/.bin/electron-rebuild serialport +cd ${project_dir}/main/app && npm install && ./node_modules/.bin/electron-rebuild serialport echo "======build main=====" -cd ${script_dir}/main && npm install -y --unsafe-perm=true && rm -rf build && npm run publish-mac +cd ${project_dir}/main && npm install && rm -rf build && npm run publish-mac diff --git a/run-win64.sh b/run-win64.sh index 613e050a..2b05c3c3 100644 --- a/run-win64.sh +++ b/run-win64.sh @@ -1,34 +1,32 @@ #!/bin/bash echo "======start codecraft build=====" -script_dir="/root/workspace/seeed-codecraft_2f88" -export CSC_IDENTITY_AUTO_DISCOVERY=false -export NODE_OPTIONS='--max_old_space_size=10240' +project_dir=$(cd $(dirname $0); pwd) echo "======install gui====" -cd ${script_dir}/gui && npm install -y --unsafe-perm=true +cd ${project_dir}/gui && npm install echo "======install blocks=====" -cd ${script_dir}/blocks && npm install -y --unsafe-perm=true +cd ${project_dir}/blocks && npm install echo "======build blocks=====" -cd ${script_dir}/blocks && npm run build +cd ${project_dir}/blocks && npm run build echo "======install l10n=====" -cd ${script_dir}/l10n && npm install -y --unsafe-perm=true +cd ${project_dir}/l10n && npm install echo "======build l10n=====" -cd ${script_dir}/l10n && npm run build +cd ${project_dir}/l10n && npm run build echo "======install vm=====" -cd ${script_dir}/vm && npm install -y --unsafe-perm=true +cd ${project_dir}/vm && npm install echo "======build vm=====" -cd ${script_dir}/vm && npm run build +cd ${project_dir}/vm && npm run build echo "======build gui=====" -cd ${script_dir}/gui && npm run build-win -cd ${script_dir}/gui && rm -rf ../main/app/gui && cp -r ./build ../main/app/gui +cd ${project_dir}/gui && npm run build-win +cd ${project_dir}/gui && rm -rf ../main/app/gui && cp -r ./build ../main/app/gui echo "======build app=====" -cd ${script_dir}/main/app && npm install -y --unsafe-perm=true && ./node_modules/.bin/electron-rebuild serialport +cd ${project_dir}/main/app && npm install && ./node_modules/.bin/electron-rebuild serialport echo "======build main=====" -cd ${script_dir}/main && npm install -y --unsafe-perm=true && rm -rf build && npm run publish-win64 +cd ${project_dir}/main && npm install && rm -rf build && npm run publish-win64