zengine/engine/xmake/rule_plugin/make_plugin.lua

28 lines
786 B
Lua
Raw Normal View History

2024-07-20 18:04:19 +08:00
import("core.project.depend")
function cmd_compile(target, genfile, file)
local res = [[
{
{"core", { public = true}},
{"asset", { public = true}},
}
]]
2024-07-22 09:05:42 +08:00
io.writefile(genfile, res)
2024-07-20 18:04:19 +08:00
local dependency = io.load(genfile)
for k,v in ipairs(dependency) do
--target:add("deps", v[1], v[2])
end
end
function main(target, file)
local sourcedir = path.join(target:autogendir({root = true}), target:plat())
if not os.isdir(sourcedir) then
os.mkdir(sourcedir)
end
local genfile = sourcedir .. "\\xmake.lua"
local dependfile = target:dependfile(genfile)
depend.on_changed(
function()
cmd_compile(target, genfile, file)
end,
{dependfile = dependfile, files = {file}}
)
end