summaryrefslogtreecommitdiff
path: root/tests/projects/other/bin2obj/xmake.lua
diff options
context:
space:
mode:
Diffstat (limited to 'tests/projects/other/bin2obj/xmake.lua')
-rw-r--r--tests/projects/other/bin2obj/xmake.lua8
1 files changed, 8 insertions, 0 deletions
diff --git a/tests/projects/other/bin2obj/xmake.lua b/tests/projects/other/bin2obj/xmake.lua
index 9541e17ae..d383bb1bb 100644
--- a/tests/projects/other/bin2obj/xmake.lua
+++ b/tests/projects/other/bin2obj/xmake.lua
@@ -6,3 +6,11 @@ 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)
+ import("core.base.bytes")
+ assert(bytes and opt.target)
+ local data = io.readfile(inputfile, {encoding = "binary"})
+ io.writefile(outputfile, data:reverse(), {encoding = "binary"})
+ end})
+ -- transform can also be a lua script file (supported by the project generators)
+ add_files("src/asset2.bin", {zeroend = true, transform = path.join(os.projectdir(), "transform.lua")})