Skip to content

Commit

Permalink
fix: wxml编译失败
Browse files Browse the repository at this point in the history
  • Loading branch information
msojocs committed Feb 4, 2022
1 parent aa0297d commit 158bc10
Show file tree
Hide file tree
Showing 4 changed files with 42 additions and 14 deletions.
4 changes: 2 additions & 2 deletions bin/wechat-devtools
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@ export PATH="$root_dir/wine:$root_dir/node/bin:$root_dir/nwjs:$PATH"
# LANG=zh_CN.UTF-8 exec "$DIR"/../nwjs/nw --load-extension="$DIR"/../nwjs/package.nw/js/ideplugin "$@"

EXTENSION1="--load-extension=$root_dir/nwjs/package.nw/js/ideplugin"
EXTENSION2="--load-extension=$( echo ~ )/.config/wechat_devtools/WeappPlugin" # 调试器AppData与Storage可用
EXTENSION2="--load-extension=$( echo ~ )/.config/wechat_devtools/WeappPlugin"
INSPECTOR1="--custom-devtools-frontend=file://$root_dir/package.nw/js/ideplugin/inspector" # 要加file://指明为本地文件路径
INSPECTOR2="--custom-devtools-frontend=file://$( echo ~ )/.config/wechat_devtools/WeappPlugin/inspector/"
USERDATADIR="$( echo ~ )/.config/wechat_devtools"

# "$@"参数
LANG=zh_CN.UTF-8
exec "$root_dir/nwjs/nw" $root_dir/package.nw $EXTENSION2 $INSPECTOR2 "$@"
exec "$root_dir/nwjs/nw" $root_dir/package.nw $EXTENSION2 $INSPECTOR1 "$@"
21 changes: 20 additions & 1 deletion test/wcc/WCC.MD
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,26 @@
node_modules --- options.json
把options.json转换为命令行参数

execute ----
## Windows
```
Wechat WXML Compiler, version v0.5vv_20200413_syb_scopedata
Usage: Z:\mnt\disk1\GitHub\wechat-devtools\cache\wechat_devtools_1.05.2201240_x64\code\package.nw\js\vendo
r\wcc.exe [-d] [-o OUTPUT] [-xc XComponentDefine] [-om XComponentDefine] [-cb [callback.js...]] [-llcommon
] [-llw/-lla XCPath] <FILES... | -s <SINGLE_FILE>
Options:
-d: output code for debug
-o: output destination (default stdout)
-xc: output simplified code for custom component
-cc: output compelete code for custom component
-s: read from stdin
-ds: insert debug wxs info
-cb: add life cycle callback
-llw: compile in lazy load mode (webiew)
-lla: compile in lazy load mode (app service)
args XCPath: custom component paths connected by comma or --split (./page/index,./comp/comp)
```

## Linux
```
Wechat WXML Compiler, version v0.5vv_20200413_syb_scopedata
Usage: ./wcc [-d] [-o OUTPUT] [-xc XComponentDefine] [-om XComponentDefine] [-cb [callback.js...]] [-ll XCPath] <FILES... | -s <SINGLE_FILE>
Expand Down
15 changes: 12 additions & 3 deletions test/wcc/test.sh
Original file line number Diff line number Diff line change
@@ -1,9 +1,18 @@
#!/bin/bash
cd /home/msojocs/Documents/we1 && \
/mnt/disk1/GitHub/wechat-devtools/package.nw/node_modules/wcc/bin/linux/wcc -d --split ">_<9772" -cc "2>_<9772./pages/index/index.wxml>_<97720>_<9772./pages/logs/logs.wxml>_<97720" ./pages/index/index.wxml ./pages/logs/logs.wxml -gn $gwx
# cd /home/msojocs/Documents/we1 && \
# /mnt/disk1/GitHub/wechat-devtools/package.nw/node_modules/wcc/bin/linux/wcc -d --split ">_<9772" -cc "2>_<9772./pages/index/index.wxml>_<97720>_<9772./pages/logs/logs.wxml>_<97720" ./pages/index/index.wxml ./pages/logs/logs.wxml -gn $gwx
# | grep Z

# cd /home/msojocs/Documents/we1 && \
# wine /mnt/disk1/GitHub/wechat-devtools/cache/wechat_devtools_1.05.2201240_x64/code/package.nw/js/vendor/wcc.exe \
# " -d --split >_<9772 -xc 2>_<9772./pages/index/index.wxml>_<97720>_<9772./pages/logs/logs.wxml>_<97720" \
# " ./pages/logs/logs.wxml ./pages/index/index.wxml -gn $gwx"
# " ./pages/logs/logs.wxml ./pages/index/index.wxml -gn $gwx"


cd /home/msojocs/Documents/we1 && \
/mnt/disk1/GitHub/wechat-devtools/node_modules/miniprogram-compiler/bin/linux/wcc \
"-d" "--split" ">_<1266" "-xc" "2>_<1266./pages/index/index.wxml>_<12660>_<1266./pages/logs/logs.wxml>_<12660" "-ll" "pages/index/index" "pages/logs/logs" "./pages/index/index.wxml" "./pages/logs/logs.wxml" "-gn" "$gwx"

cd /home/msojocs/Documents/we1 && \
wine /mnt/disk1/GitHub/wechat-devtools/node_modules/miniprogram-compiler/bin/windows/wcc.exe \
"-d" "--split" ">_<1266" "-xc" "2>_<1266./pages/index/index.wxml>_<12660>_<1266./pages/logs/logs.wxml>_<12660" "-lla" "./pages/index/index>_<1266./pages/logs/logs" "./pages/index/index.wxml" "./pages/logs/logs.wxml" "-gn" "$gwx"
16 changes: 8 additions & 8 deletions tools/rebuild-node-modules
Original file line number Diff line number Diff line change
Expand Up @@ -102,14 +102,14 @@ cp -fr "${package_dir}/node_modules_tmp/node_modules/vscode-ripgrep/bin/rg" "${p

# wcc wcsc
# 预览编译
cd "${package_dir}/js/vendor/" && rm -rf "wcc.exe" "wcsc.exe"
cp "${package_dir}/node_modules_tmp/node_modules/miniprogram-compiler/bin/linux/wcc" "${package_dir}/js/vendor/wcc.exe"
cp "${package_dir}/node_modules_tmp/node_modules/miniprogram-compiler/bin/linux/wcsc" "${package_dir}/js/vendor/wcsc.exe"
cd "${package_dir}/js/vendor" && \
wcc_md5=$( md5sum wcc.exe|cut -d ' ' -f1 ) && \
sed -i 's/wcc.exe": ".*"/wcc.exe": "'"${wcc_md5}"'"/g' "config.json" && \
wcsc_md5=$( md5sum wcsc.exe|cut -d ' ' -f1 ) && \
sed -i 's/wcsc.exe": ".*"/wcsc.exe": "'"${wcsc_md5}"'"/g' "config.json"
# cd "${package_dir}/js/vendor/" && rm -rf "wcc.exe" "wcsc.exe"
# cp "${package_dir}/node_modules_tmp/node_modules/miniprogram-compiler/bin/linux/wcc" "${package_dir}/js/vendor/wcc.exe"
# cp "${package_dir}/node_modules_tmp/node_modules/miniprogram-compiler/bin/linux/wcsc" "${package_dir}/js/vendor/wcsc.exe"
# cd "${package_dir}/js/vendor" && \
# wcc_md5=$( md5sum wcc.exe|cut -d ' ' -f1 ) && \
# sed -i 's/wcc.exe": ".*"/wcc.exe": "'"${wcc_md5}"'"/g' "config.json" && \
# wcsc_md5=$( md5sum wcsc.exe|cut -d ' ' -f1 ) && \
# sed -i 's/wcsc.exe": ".*"/wcsc.exe": "'"${wcsc_md5}"'"/g' "config.json"

# 可视化编译
(cd "${package_dir}/node_modules/" \
Expand Down

0 comments on commit 158bc10

Please sign in to comment.