golang热编译工具|golang热编译工具 Hotbuild

hotbuild A cross platform hot compilation tool
By monitoring the modification of the project directory file, the recompilation and running are automatically triggered. Running directory and monitoring change directory can be different. Monitor the file modification in all recursive subdirectories under the project path.
golang热编译工具|golang热编译工具 Hotbuild
文章图片

Install

go get -u github.com/wandercn/hotbuild@latest

Initialize
wander$ cd $your_project_dir/ wander$ hotbuild initconf 2021/07/28 11:10:03 create config file: .hotbuild.toml

Run
wander$ cd $your_project_dir/ wander$ hotbuild run _____ ___________ ___ _____ | | | |/ _ \__| | __ )| | | |_ _| ||_ \ | |_| | | | || ||_ \| | | || || || | | | |_| |_| || || |_) | |_| || || |___| |_| | |_| |_|\___/ |_||____/ \___/|___|_____|____/ v1.0.5, built with Go 1.16.5.............................. ( Start rebuilding ) ................................. .............................. [ Build successfully ] ............................... .............................. { Start running } .................................... 2021/07/06 09:56:26.913 [I] [asm_amd64.s:1371]http server Running on http://0.0.0.0:8080 2021/07/06 09:56:26.913 [I] [asm_amd64.s:1371]Admin server Running on :8088

Custom configuration Auto create default configuration file in $your_project_dir/.hotbuild.toml,you can modify the configuration yourself.
wander$ cd $your_project_dir/ wander$ cat .hotbuild.toml buildcmd = "go build -o ./tmp_bin" excludedir = [".git", "tmp", "docs", "vendor"] projectdir = "/Users/apple/workspace/src/example.com/" runcmd = "./tmp_bin"

en zh-cn
buildcmd Compile command 编译命令
excludedir Exclude tracked folders 排除跟踪的文件夹
projectdir Project directory to track 需要跟踪的项目目录
runcmd Run command 运行命令
FAQ
  1. the "Too many open files" error of MacOSX
    # maxfiles is 256 too small.wander$ launchctl limit cpuunlimitedunlimited filesizeunlimitedunlimited dataunlimitedunlimited stack838860867104768 core0unlimited rssunlimitedunlimited memlockunlimitedunlimited maxproc27844176 maxfiles25610240# change maxfiles to 4096.wander$ sudo launchctl limit maxfiles 4096 unlimited wander$ launchctl limit cpuunlimitedunlimited filesizeunlimitedunlimited dataunlimitedunlimited stack838860867104768 core0unlimited rssunlimitedunlimited memlockunlimitedunlimited maxproc27844176 maxfiles409610240

License 【golang热编译工具|golang热编译工具 Hotbuild】

    推荐阅读