duandun3178 2017-03-28 21:25
浏览 309

在IntelliJ中使用File Watcher运行Makefile

I would like to run a Makefile in IntelliJ whenever a source file changes. Therefore I installed the File Watcher plugin and added a new File Watcher for Go files. In the Watcher Settings I added make as the Program and test for the Arguments.

When I now change a .go file, I get the following error message:

make test
make: *** No rule to make target `test'.  Stop.

Process finished with exit code 2

so I assume that the file watcher works in general but is somehow runs the make command in the wrong directory.

When I run make test in a terminal from the root of my project, everything works as expected and I get:

Formatting all packages...
Code analysis with go vet...
Execute test with ginkgo...
[1490735873] Cmd Suite - 1/1 specs • SUCCESS! 120.183µs PASS
[1490735873] Test Helpers Suite - 4/4 specs •••• SUCCESS! 125.046µs PASS
[1490735873] Models Suite - 5/5 specs ••••• SUCCESS! 453.456µs PASS
[1490735873] Services Suite - 16/16 specs •••••••••••••••• SUCCESS! 3.035275ms PASS

Ginkgo ran 4 suites in 855.886243ms
Test Suite Passed

What am I doing wrong - or am I missing the point of using file watchers in IntelliJ?

  • 写回答

1条回答 默认 最新

  • dousuohe5882 2017-03-28 21:27
    关注

    Solution was that I had to specify the Working Directory in Other Options. When I set this to $ContentRoot$, everything works as expected.

    enter image description here

    评论

报告相同问题?

悬赏问题

  • ¥15 如何用Labview在myRIO上做LCD显示?(语言-开发语言)
  • ¥15 Vue3地图和异步函数使用
  • ¥15 C++ yoloV5改写遇到的问题
  • ¥20 win11修改中文用户名路径
  • ¥15 win2012磁盘空间不足,c盘正常,d盘无法写入
  • ¥15 用土力学知识进行土坡稳定性分析与挡土墙设计
  • ¥70 PlayWright在Java上连接CDP关联本地Chrome启动失败,貌似是Windows端口转发问题
  • ¥15 帮我写一个c++工程
  • ¥30 Eclipse官网打不开,官网首页进不去,显示无法访问此页面,求解决方法
  • ¥15 关于smbclient 库的使用