我想使用构建器进行任务自动化。
我要使用的功能是buildr cc
(默认情况下)在更改源文件夹时运行编译。
我的目标是为特定目录设置构建器以执行自定义任务(例如系统调用)
我的最新版本(不工作,因为我定义了构建)如下。
define "directory_watcher" do
compile.sources << _(".")
compile.from(_(".")).using(:javac)
compile do
p "Calling pandoc in compile"
system "pandoc 0*.txt -o directory_watcher.html -s -c css/base.css"
end
build do
p "Calling pandoc in build"
system "pandoc 0*.txt -o directory_watcher.html -s -c css/base.css"
end
end
使用这个构建器文件,我成功地观察了根文件夹而不是 main/src/... 但没有别的。如果我修改文件,它会通知,但不会显示文本“在编译中调用 pandoc”。
如何解决?