diff options
| author | ruki <[email protected]> | 2018-04-12 00:26:55 +0800 |
|---|---|---|
| committer | ruki <[email protected]> | 2018-04-11 20:41:34 +0800 |
| commit | b0196c2cc8d91c1db21442488ff44e64336bfa7c (patch) | |
| tree | 05d09c87ac1d4f4182fee21da97146d84ce15f9f /tests/apis/rules/xmake.lua | |
| parent | a193fb96aa44c2ba32b18557fabd7d7694ee41eb (diff) | |
load rule deps
Diffstat (limited to 'tests/apis/rules/xmake.lua')
| -rw-r--r-- | tests/apis/rules/xmake.lua | 25 |
1 files changed, 3 insertions, 22 deletions
diff --git a/tests/apis/rules/xmake.lua b/tests/apis/rules/xmake.lua index 4f56e801d..b67c1ca2b 100644 --- a/tests/apis/rules/xmake.lua +++ b/tests/apis/rules/xmake.lua @@ -2,14 +2,14 @@ -- define rule: markdown rule("markdown") set_extensions(".md", ".markdown") - on_build(function (target, sourcefile) + on_build_file(function (target, sourcefile) os.cp(sourcefile, path.join(target:targetdir(), path.basename(sourcefile) .. ".html")) end) -- define rule: man rule("man") add_imports("core.project.rule") - on_build_all(function (target, sourcefiles) + on_build_files(function (target, sourcefiles) for _, sourcefile in ipairs(sourcefiles) do print("generating man: %s", sourcefile) end @@ -19,7 +19,7 @@ rule("man") -- define rule: c code rule("c code") add_imports("core.tool.compiler") - on_build(function (target, sourcefile) + on_build_file(function (target, sourcefile) local objectfile_o = os.tmpfile() .. ".o" local sourcefile_c = os.tmpfile() .. ".c" os.cp(sourcefile, sourcefile_c) @@ -27,24 +27,6 @@ rule("c code") table.insert(target:objectfiles(), objectfile_o) end) --- define rule: stub -rule("stub") - on_build(function (target, sourcefile) - print("on_build: %s", sourcefile) - end) - on_clean(function (target, sourcefile) - print("on_clean: %s", sourcefile) - end) - on_install(function (target, sourcefile) - print("on_install: %s", sourcefile) - end) - on_uninstall(function (target, sourcefile) - print("on_uninstall: %s", sourcefile) - end) - on_package(function (target, sourcefile) - print("on_package: %s", sourcefile) - end) - -- define target target("test") @@ -59,4 +41,3 @@ target("test") add_files("src/man/*.in", {rule = "man"}) add_files("src/index.md") add_files("src/test.c.in", {rule = "c code"}) - add_files("src/empty.stub", {rule = "stub"}) |
