summaryrefslogtreecommitdiff
path: root/tests/projects/other/bin2obj/xmake.lua
diff options
context:
space:
mode:
authorruki <[email protected]>2026-07-17 23:49:52 +0800
committerruki <[email protected]>2026-07-17 23:49:52 +0800
commitf467d71abc40d4fee6e896d7a0b8e4f5be7e16db (patch)
treec46a673aa416c6b76f7ba4e875cb56e699017e13 /tests/projects/other/bin2obj/xmake.lua
parent0cb38ea4d9823ee49d15debb7a94a2fc9e72d3cc (diff)
add batchcmds:call and transform for bin2obj/c
Diffstat (limited to 'tests/projects/other/bin2obj/xmake.lua')
-rw-r--r--tests/projects/other/bin2obj/xmake.lua7
1 files changed, 7 insertions, 0 deletions
diff --git a/tests/projects/other/bin2obj/xmake.lua b/tests/projects/other/bin2obj/xmake.lua
index 9541e17ae..74a50a027 100644
--- a/tests/projects/other/bin2obj/xmake.lua
+++ b/tests/projects/other/bin2obj/xmake.lua
@@ -6,3 +6,10 @@ target("test")
add_files("src/*.c")
add_files("src/data.bin", {zeroend = true})
add_files("src/xmake.ico", {zeroend = false})
+ add_files("src/asset.bin", {zeroend = true, transform = function (inputfile, outputfile, opt)
+ print("transform ..")
+ import("core.base.bytes")
+ assert(bytes and opt.target)
+ local data = io.readfile(inputfile, {encoding = "binary"})
+ io.writefile(outputfile, data:reverse(), {encoding = "binary"})
+ end})