aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorruki <waruqi@gmail.com>2018-11-17 23:45:04 +0800
committerruki <waruqi@gmail.com>2018-11-17 23:45:04 +0800
commit0e2a0d901f60f1f162f4c6c33666c14c940d6e96 (patch)
tree08cf117dffc9c0d30dbc8781a5d1acadd0b6d246
parentc7579637eefacd429f4e9c837064cd51de25a907 (diff)
downloadxmake-docs-0e2a0d901f60f1f162f4c6c33666c14c940d6e96.tar.gz
xmake-docs-0e2a0d901f60f1f162f4c6c33666c14c940d6e96.zip
add before and after build file api
-rw-r--r--manual.md57
-rw-r--r--zh/manual.md56
2 files changed, 113 insertions, 0 deletions
diff --git a/manual.md b/manual.md
index c6d4a760..b24794a6 100644
--- a/manual.md
+++ b/manual.md
@@ -1492,6 +1492,35 @@ target("test")
end)
```
+##### target:before_build_file
+
+###### Run custom script before building single file
+
+通过此接口,可以用来hook指定target内置的构建过程,在每个源文件编译过程之前执行一些自定义脚本:
+
+```lua
+target("test")
+ set_kind("binary")
+ add_files("src/*.c")
+ before_build_file(function (target, sourcefile, opt)
+ end)
+```
+
+##### target:before_build_files
+
+###### Run custom script before building files
+
+通过此接口,可以用来hook指定target内置的构建过程,在一批同类型源文件编译过程之前执行一些自定义脚本:
+
+```lua
+target("test")
+ set_kind("binary")
+ add_files("src/*.c")
+ before_build_files(function (target, sourcebatch, opt)
+ end)
+```
+
+
##### target:before_clean
###### Run custom script before cleaning target
@@ -1572,6 +1601,34 @@ target("test")
end)
```
+##### target:after_build_file
+
+###### Run custom script after building single file
+
+通过此接口,可以用来hook指定target内置的构建过程,在每个源文件编译过程之后执行一些自定义脚本:
+
+```lua
+target("test")
+ set_kind("binary")
+ add_files("src/*.c")
+ after_build_file(function (target, sourcefile, opt)
+ end)
+```
+
+##### target:after_build_files
+
+###### Run custom script after building files
+
+通过此接口,可以用来hook指定target内置的构建过程,在一批同类型源文件编译过程之后执行一些自定义脚本:
+
+```lua
+target("test")
+ set_kind("binary")
+ add_files("src/*.c")
+ after_build_files(function (target, sourcebatch, opt)
+ end)
+```
+
##### target:after_clean
###### Run custom script after cleaning target
diff --git a/zh/manual.md b/zh/manual.md
index c29ee32e..8b33e881 100644
--- a/zh/manual.md
+++ b/zh/manual.md
@@ -1514,6 +1514,34 @@ target("test")
end)
```
+##### target:before_build_file
+
+###### 自定义编译前的脚本, 实现单文件构建
+
+通过此接口,可以用来hook指定target内置的构建过程,在每个源文件编译过程之前执行一些自定义脚本:
+
+```lua
+target("test")
+ set_kind("binary")
+ add_files("src/*.c")
+ before_build_file(function (target, sourcefile, opt)
+ end)
+```
+
+##### target:before_build_files
+
+###### 自定义编译前的脚本, 实现多文件构建
+
+通过此接口,可以用来hook指定target内置的构建过程,在一批同类型源文件编译过程之前执行一些自定义脚本:
+
+```lua
+target("test")
+ set_kind("binary")
+ add_files("src/*.c")
+ before_build_files(function (target, sourcebatch, opt)
+ end)
+```
+
##### target:before_clean
###### 在清理之前执行一些自定义脚本
@@ -1594,6 +1622,34 @@ target("test")
end)
```
+##### target:after_build_file
+
+###### 自定义编译前的脚本, 实现单文件构建
+
+通过此接口,可以用来hook指定target内置的构建过程,在每个源文件编译过程之后执行一些自定义脚本:
+
+```lua
+target("test")
+ set_kind("binary")
+ add_files("src/*.c")
+ after_build_file(function (target, sourcefile, opt)
+ end)
+```
+
+##### target:after_build_files
+
+###### 自定义编译前的脚本, 实现多文件构建
+
+通过此接口,可以用来hook指定target内置的构建过程,在一批同类型源文件编译过程之后执行一些自定义脚本:
+
+```lua
+target("test")
+ set_kind("binary")
+ add_files("src/*.c")
+ after_build_files(function (target, sourcebatch, opt)
+ end)
+```
+
##### target:after_clean
###### 在清理之后执行一些自定义脚本