golang热编译工具 Hotbuild

wandercn · · 1642 次点击 · 开始浏览    置顶
这是一个创建于 的主题,其中的信息可能已经有所发展或是发生改变。

# hotbuild 一个跨平台的热编译工具 通过监视项目目录文件的修改,将自动触发重新编译和运行。运行目录和监视目录可以不同。监视项目路径下所有递归子目录中的文件修改。 ![hotbuild](https://github.com/wandercn/hotbuild/raw/master/logo.jpg "hotbuild") # 项目网站 [hotbuild.ffactory.org](https://hotbuild.ffactory.org) # 安装 go get -u github.com/wandercn/hotbuild@latest # 初始化 ``` wander$ cd $your_project_dir/ wander$ hotbuild initconf 2021/07/28 11:10:03 create config file: .hotbuild.toml ``` # 运行 ``` 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 ``` # 自定义配置 初始化文件在 $your_project_dir/.hotbuild.toml,you 你可以自行修改配置。 ``` 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 |运行命令 | # 问题排除 1. the "Too many open files" error of MacOSX ``` # maxfiles is 256 too small. wander$ launchctl limit cpu unlimited unlimited filesize unlimited unlimited data unlimited unlimited stack 8388608 67104768 core 0 unlimited rss unlimited unlimited memlock unlimited unlimited maxproc 2784 4176 maxfiles 256 10240 # change maxfiles to 4096. wander$ sudo launchctl limit maxfiles 4096 unlimited wander$ launchctl limit cpu unlimited unlimited filesize unlimited unlimited data unlimited unlimited stack 8388608 67104768 core 0 unlimited rss unlimited unlimited memlock unlimited unlimited maxproc 2784 4176 maxfiles 4096 10240 ``` # 作者留言 有兴趣的朋友可以试试,有问题可以提[Issues](https://github.com/wandercn/hotbuild/issues),觉得好用别忘了给我个 [Star](https://github.com/wandercn/hotbuild/stargazers)

有疑问加站长微信联系(非本文作者)

入群交流(和以上内容无关):加入Go大咖交流群,或添加微信:liuxiaoyan-s 备注:入群;或加QQ群:692541889

1642 次点击  ∙  1 赞  
加入收藏 微博
3 回复  |  直到 2021-07-29 16:17:09
暂无回复
添加一条新回复 (您需要 登录 后才能回复 没有账号 ?)
  • 请尽量让自己的回复能够对别人有帮助
  • 支持 Markdown 格式, **粗体**、~~删除线~~、`单行代码`
  • 支持 @ 本站用户;支持表情(输入 : 提示),见 Emoji cheat sheet
  • 图片支持拖拽、截图粘贴等方式上传