diff options
| author | ruki <[email protected]> | 2018-04-12 00:49:03 +0800 |
|---|---|---|
| committer | ruki <[email protected]> | 2018-04-11 22:54:23 +0800 |
| commit | 67bfa73b2ae4ddfa3f5c001685bdb063a0454ec1 (patch) | |
| tree | e9018f32a1c66073aff796ffc48a010839699929 /tests | |
| parent | 6d36e632a581a487f275cd77cf72c52dd67eedef (diff) | |
add orderules and on_load
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/apis/rules/xmake.lua | 80 |
1 files changed, 79 insertions, 1 deletions
diff --git a/tests/apis/rules/xmake.lua b/tests/apis/rules/xmake.lua index cf516686e..cb5179982 100644 --- a/tests/apis/rules/xmake.lua +++ b/tests/apis/rules/xmake.lua @@ -27,6 +27,84 @@ rule("c code") table.insert(target:objectfiles(), objectfile_o) end) +-- define rule: stub3 +rule("stub3") + on_load(function (target) + print("rule(stub3): on_load") + end) + +-- define rule: stub2 +rule("stub2") + on_load(function (target) + print("rule(stub2): on_load") + end) + before_build(function (target) + print("rule(stub2): before_build") + end) + on_build(function (target) + print("rule(stub2): on_build") + end) + after_build(function (target) + print("rule(stub2): after_build") + end) + +-- define rule: stub1 +rule("stub1") + add_deps("stub2") + on_load(function (target) + print("rule(stub1): on_load") + end) + + before_build(function (target) + print("rule(stub1): before_build") + end) + on_build(function (target) + print("rule(stub1): on_build") + end) + after_build(function (target) + print("rule(stub1): after_build") + end) + + before_clean(function (target) + print("rule(stub1): before_build") + end) + on_clean(function (target) + print("rule(stub1): on_build") + end) + after_clean(function (target) + print("rule(stub1): after_build") + end) + + before_install(function (target) + print("rule(stub1): before_install") + end) + on_install(function (target) + print("rule(stub1): on_install") + end) + after_install(function (target) + print("rule(stub1): after_install") + end) + + before_uninstall(function (target) + print("rule(stub1): before_uninstall") + end) + on_uninstall(function (target) + print("rule(stub1): on_uninstall") + end) + after_uninstall(function (target) + print("rule(stub1): after_uninstall") + end) + + before_package(function (target) + print("rule(stub1): before_package") + end) + on_package(function (target) + print("rule(stub1): on_package") + end) + after_package(function (target) + print("rule(stub1): after_package") + end) + -- define target target("test") @@ -34,7 +112,7 @@ target("test") set_kind("binary") -- add rules - add_rules("markdown") + add_rules("markdown", "stub1") -- add files add_files("src/*.c") |
