请安装好:
我推荐你使用 VS Code 开发,你可以在一分钟内成功编译、运行和 Debug chsrc
Ctrl-Shift-B直接构建F5直接开始 Debug
请务必使用 dev 分支开发
git clone https://gitee.com/RubyMetric/chsrc.git -b dev关于分支的说明,可参考 ./03-CONTRIBUTING.md
共有四种构建模式:
DEV modeDEBUG modeRELEASE modeCI-RELEASE mode
开发时只需要前两种模式;第四种模式只在 GitHub Actions 使用。
如果你使用 just,可以在 VS Code 中获得更好的体验,按 Ctrl-Shift-B 直接使用 DEV mode 构建
注意: DEBUG 模式下, 执行任意一个 recipe 的任意操作,会额外检查所有 _prelude() 是否能正常工作,如: ./chsrc-debug ls <recipe>
just (b) # 在Windows上默认使用 gcc 编译,在macOS上默认使用 clang 编译,在其他系统上默认使用 cc 编译
just CC=clang # 使用 clang 编译
just CC=gcc # 使用 gcc 编译
# 编译出 debug 版本: chsrc-debug
just bd
# 编译出 release 版本: chsrc-release
just brmake 用户:
make (b) # 在Windows上默认使用 cc 编译,在macOS上默认使用 clang 编译,在其他系统上默认使用 cc 编译
make CC=clang # 使用 clang 编译
make CC=gcc # 使用 gcc 编译
# 编译出 debug 版本: chsrc-debug
make bd
# 编译出 release 版本: chsrc-release
make br如果你使用 just,可以在 VS Code 中获得更好的体验,按 F5 即可立即开始 Debug
# 重新编译出 ./chsrc-debug,并启动 GDB 调试 (在macOS上启动 LLDB 调试)
$ just debug
# 重新编译出 ./chsrc-debug,并启动 LLDB 调试
$ just DEBUGGER=lldb debugmake 用户:
# 重新编译出 ./chsrc-debug,并启动 GDB 调试 (在macOS上启动 LLDB 调试)
$ make debug
# 重新编译出 ./chsrc-debug,并启动 LLDB 调试
$ make debug DEBUGGER=lldbjust 用户只需要替换下述 make 为 just
make test-xy # 测试 xy.h
make test-fw # 测试 framework
make test # 测试上述两个
make test-cli # 测试命令
make clean关于分支的说明以及如何提交代码,请参考 ./03-CONTRIBUTING.md