aboutsummaryrefslogtreecommitdiff
path: root/zh/manual.md
diff options
context:
space:
mode:
authorruki <waruqi@gmail.com>2018-11-17 23:02:39 +0800
committerruki <waruqi@gmail.com>2018-11-17 23:02:39 +0800
commit9a0ffb9ab101d95627eeb4b88511ccf16338b729 (patch)
tree7b82a6d33df227fb25cd866e7650d01f38026216 /zh/manual.md
parenta340720807b83ef06f058c1b0673c78b8b67f58e (diff)
downloadxmake-docs-9a0ffb9ab101d95627eeb4b88511ccf16338b729.tar.gz
xmake-docs-9a0ffb9ab101d95627eeb4b88511ccf16338b729.zip
modify build file api
Diffstat (limited to 'zh/manual.md')
-rw-r--r--zh/manual.md12
1 files changed, 6 insertions, 6 deletions
diff --git a/zh/manual.md b/zh/manual.md
index d13a77a9..ef0a3329 100644
--- a/zh/manual.md
+++ b/zh/manual.md
@@ -2593,7 +2593,7 @@ add_tools("cc", "gcc@$(projectdir)/tools/bin/mipscc.exe")
```lua
rule("markdown")
- on_build_file(function (target, sourcefile)
+ on_build_file(function (target, sourcefile, opt)
-- compile .markdown with flags
local flags = target:values("markdown.flags")
if flags then
@@ -3611,7 +3611,7 @@ task.run("hello", {color="red"}, arg1, arg2, arg3)
-- 定义一个markdown文件的构建规则
rule("markdown")
set_extensions(".md", ".markdown")
- on_build_file(function (target, sourcefile)
+ on_build_file(function (target, sourcefile, opt)
os.cp(sourcefile, path.join(target:targetdir(), path.basename(sourcefile) .. ".html"))
end)
@@ -4018,7 +4018,7 @@ add_files("xmlhelper.cpp", {rule = "win.sdk.dotnet"})
```lua
rule("markdown")
set_extensions(".md", ".markdown")
- on_build_file(function (target, sourcefile)
+ on_build_file(function (target, sourcefile, opt)
os.cp(sourcefile, path.join(target:targetdir(), path.basename(sourcefile) .. ".html"))
end)
```
@@ -4039,7 +4039,7 @@ rule("markdown")
-- 定义一个markdown文件的构建规则
rule("markdown")
set_extensions(".md", ".markdown")
- on_build_file(function (target, sourcefile)
+ on_build_file(function (target, sourcefile, opt)
os.cp(sourcefile, path.join(target:targetdir(), path.basename(sourcefile) .. ".html"))
end)
@@ -4141,9 +4141,9 @@ rule("markdown")
```lua
rule("markdown")
- on_build_files(function (target, sourcefiles)
+ on_build_files(function (target, sourcebatch, opt)
-- build some source files
- for _, sourcefile in ipairs(sourcefiles) do
+ for _, sourcefile in ipairs(sourcebatch.sourcefiles) do
-- ...
end
end)