我们可以使用 rule() 定义自定义构建规则,来处理特定的文件类型或构建逻辑。
rule("markdown")
set_extensions(".md")
on_build_file(function (target, sourcefile, opt)
print("processing %s", sourcefile)
end)
target("test")
set_kind("phony")
add_files("src/*.md")
add_rules("markdown")
$ xmake