diff options
| author | ruki <[email protected]> | 2026-03-16 23:42:27 +0800 |
|---|---|---|
| committer | ruki <[email protected]> | 2026-03-16 23:42:27 +0800 |
| commit | 9bb7b558f2e1c4cb0408f09e85a52c9a1e0db360 (patch) | |
| tree | 530c9ef00fda80b209614567d4439cd43d89f67b | |
| parent | 738d63ec3a02a86e93011f2b3b41267be30e7484 (diff) | |
remove some codes
| -rw-r--r-- | xmake/rules/csharp/clean.lua | 41 | ||||
| -rw-r--r-- | xmake/rules/csharp/install.lua | 66 |
2 files changed, 0 insertions, 107 deletions
diff --git a/xmake/rules/csharp/clean.lua b/xmake/rules/csharp/clean.lua deleted file mode 100644 index 78631738a..000000000 --- a/xmake/rules/csharp/clean.lua +++ /dev/null @@ -1,41 +0,0 @@ ---!A cross-platform build utility based on Lua --- --- Licensed under the Apache License, Version 2.0 (the "License"); --- you may not use this file except in compliance with the License. --- You may obtain a copy of the License at --- --- http://www.apache.org/licenses/LICENSE-2.0 --- --- Unless required by applicable law or agreed to in writing, software --- distributed under the License is distributed on an "AS IS" BASIS, --- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. --- See the License for the specific language governing permissions and --- limitations under the License. --- --- Copyright (C) 2015-present, Xmake Open Source Community. --- --- @author JassJam --- @file clean.lua --- - --- imports -import("target.action.clean", {alias = "_do_clean_target"}) -import("rules.modules.csharp_common", {rootdir = os.scriptdir(), alias = "csharp_common"}) - -function main(target, opt) - _do_clean_target(target) - - local targetfile = target:targetfile() - if targetfile then - os.tryrm(target:dependfile(targetfile)) - end - os.tryrm(target:targetdir()) - - -- also remove the bin/obj folders next to the .csproj file - local csprojfile = csharp_common.find_csproj(target) - if csprojfile then - local csprojdir = path.directory(csprojfile) - os.tryrm(path.join(csprojdir, "bin")) - os.tryrm(path.join(csprojdir, "obj")) - end -end diff --git a/xmake/rules/csharp/install.lua b/xmake/rules/csharp/install.lua deleted file mode 100644 index a43006dd6..000000000 --- a/xmake/rules/csharp/install.lua +++ /dev/null @@ -1,66 +0,0 @@ ---!A cross-platform build utility based on Lua --- --- Licensed under the Apache License, Version 2.0 (the "License"); --- you may not use this file except in compliance with the License. --- You may obtain a copy of the License at --- --- http://www.apache.org/licenses/LICENSE-2.0 --- --- Unless required by applicable law or agreed to in writing, software --- distributed under the License is distributed on an "AS IS" BASIS, --- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. --- See the License for the specific language governing permissions and --- limitations under the License. --- --- Copyright (C) 2015-present, Xmake Open Source Community. --- --- @author ruki --- @file install.lua --- - --- imports -import("core.base.option") -import("core.project.config") -import("core.tool.compiler") -import("rules.modules.csharp_common", {rootdir = os.scriptdir(), alias = "csharp_common"}) - -function main(target, opt) - local csprojfile = assert(csharp_common.find_or_generate_csproj(target), "target(%s): missing csharp .csproj file!", target:name()) - - -- get dotnet program from compiler toolchain - local compinst = compiler.load("cs", {target = target}) - local dotnet = compinst:program() - - local configuration = csharp_common.build_mode_to_configuration() - local verbosity = option.get("diagnosis") and "diagnostic" or "quiet" - - -- publish to a directory under target autogendir - local tmpdir = path.join(target:autogendir(), "publish") - os.mkdir(tmpdir) - - local rid = csharp_common.get_runtime_identifier(target) - local argv = { - "publish", csprojfile, - "--nologo", - "--configuration", configuration, - "--verbosity", verbosity, - "--output", tmpdir - } - if rid and target:is_binary() then - table.join2(argv, {"--runtime", rid}) - end - os.vrunv(dotnet, argv, {curdir = path.directory(csprojfile), envs = compinst:runenvs()}) - - -- copy published files to installdir - local installdir = target:installdir() - if target:is_binary() then - installdir = target:installdir("bin") - elseif target:is_static() or target:is_shared() then - installdir = target:installdir("lib") - end - if installdir and #installdir > 0 then - local install_abs = path.is_absolute(installdir) and installdir or path.absolute(installdir, os.projectdir()) - os.mkdir(install_abs) - os.cp(path.join(tmpdir, "**"), install_abs, {rootdir = tmpdir}) - end -end |
