From 701014b37d30227f2fa38ebe6ce344ab766513a2 Mon Sep 17 00:00:00 2001 From: ruki Date: Tue, 17 Mar 2026 22:37:53 +0800 Subject: improve csharp generator --- xmake/rules/csharp/config.lua | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) (limited to 'xmake/rules/csharp/config.lua') diff --git a/xmake/rules/csharp/config.lua b/xmake/rules/csharp/config.lua index 97b3a4303..8b7186888 100644 --- a/xmake/rules/csharp/config.lua +++ b/xmake/rules/csharp/config.lua @@ -19,16 +19,13 @@ -- -- imports -import("core.project.config") import("core.project.depend") -import("modules.csproj_generator", {rootdir = os.scriptdir()}) +import("modules.csproj_generator", {rootdir = os.scriptdir(), alias = "generate_csproj"}) function main(target) -- compute csproj path - local targetkey = target:fullname():replace("::", path.sep()) - local csprojdir = path.join(config.directory(), "rules", "csharp", targetkey, target:plat(), target:arch()) - local csprojfile = path.join(csprojdir, target:name() .. ".csproj") + local csprojfile = path.join(target:autogendir(), "rules", "csharp", target:name() .. ".csproj") local dependfile = target:dependfile(csprojfile) -- collect source files and dep csproj paths as depend values @@ -43,7 +40,7 @@ function main(target) -- generate csproj incrementally depend.on_changed(function () - csproj_generator(target, csprojfile) + generate_csproj(target, csprojfile) end, {dependfile = dependfile, files = sourcefiles, values = depcsproj}) target:data_set("csharp.csproj", csprojfile) -- cgit v1.3.1