summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorruki <[email protected]>2023-06-21 23:45:00 +0800
committerruki <[email protected]>2023-06-21 23:45:00 +0800
commita70688f2322121027ca136125be0a2ebd8a3b06d (patch)
treef59ab47c3796de89b4da49039d39003a69502254
parent8b922876282fbe9089f41e7bfe0a679712b2d51e (diff)
add upgrade vs project stub
-rw-r--r--xmake/modules/private/utils/upgrade_vsproj.lua46
-rw-r--r--xmake/plugins/project/vstudio/impl/vs201x_vcxproj.lua2
2 files changed, 46 insertions, 2 deletions
diff --git a/xmake/modules/private/utils/upgrade_vsproj.lua b/xmake/modules/private/utils/upgrade_vsproj.lua
new file mode 100644
index 000000000..b1dc9eff0
--- /dev/null
+++ b/xmake/modules/private/utils/upgrade_vsproj.lua
@@ -0,0 +1,46 @@
+--!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, TBOOX Open Source Group.
+--
+-- @author ruki
+-- @file upgrade_vsproj.lua
+--
+
+-- imports
+import("core.base.option")
+
+-- the options
+local options = {
+ {nil, "vs", "kv", nil, "Set the vs version. (default: latest)." }
+, {nil, "vs_toolset", "kv", nil, "Set the vs toolset." }
+, {nil, "vs_sdkver", "kv", nil, "Set the vs sdk version." }
+, {nil, "vs_projectfiles", "vs", nil, "Set the solution or project files." }
+}
+
+-- upgrade vs project file
+function _upgrade(projectfile, opt)
+ opt = opt or {}
+end
+
+function main(...)
+ local argv = {...}
+ local opt = option.parse(argv, options, "Upgrade all the vs project files."
+ , ""
+ , "Usage: xmake l private.utils.upgrade_vsproj [options]")
+
+ for _, projectfile in ipairs(opt.vs_projectfiles) do
+ _upgrade(projectfile, opt)
+ end
+end
diff --git a/xmake/plugins/project/vstudio/impl/vs201x_vcxproj.lua b/xmake/plugins/project/vstudio/impl/vs201x_vcxproj.lua
index 64a6f5419..10ddb8dbc 100644
--- a/xmake/plugins/project/vstudio/impl/vs201x_vcxproj.lua
+++ b/xmake/plugins/project/vstudio/impl/vs201x_vcxproj.lua
@@ -214,8 +214,6 @@ end
-- make header
function _make_header(vcxprojfile, vsinfo)
-
- -- make header
vcxprojfile:print("<?xml version=\"1.0\" encoding=\"utf-8\"?>")
vcxprojfile:enter("<Project DefaultTargets=\"Build\" ToolsVersion=\"%s.0\" xmlns=\"http://schemas.microsoft.com/developer/msbuild/2003\">", assert(vsinfo.project_version))
end