premake/src/actions/vstudio/vs2005_csproj_user.lua

55 lines
1.2 KiB
Lua
Raw Normal View History

--
-- vs2005_csproj_user.lua
-- Generate a Visual Studio 2005/2008 C# .user file.
2015-03-11 19:52:51 +00:00
-- Copyright (c) 2009-2015 Jason Perkins and the Premake project
--
local p = premake
2015-03-11 19:52:51 +00:00
local m = p.vstudio.cs2005
--
2015-03-11 19:52:51 +00:00
-- Generate a Visual Studio 200x C# user file.
--
2015-03-11 19:52:51 +00:00
function m.generateUser(prj)
p.vstudio.projectElement()
2015-03-11 19:52:51 +00:00
p.push('<PropertyGroup>')
-- Per-configuration reference paths aren't supported (are they?) so just
-- use the first configuration in the project
2015-03-11 19:52:51 +00:00
local cfg = p.project.getfirstconfig(prj)
2015-03-11 19:52:51 +00:00
local refpaths = path.translate(p.project.getrelative(prj, cfg.libdirs))
p.w('<ReferencePath>%s</ReferencePath>', table.concat(refpaths, ";"))
2015-03-11 19:52:51 +00:00
p.pop('</PropertyGroup>')
2015-03-11 19:52:51 +00:00
for cfg in p.project.eachconfig(prj) do
local contents = p.capture(function()
2015-03-11 19:52:51 +00:00
p.push()
m.debugsettings(cfg)
p.pop()
end)
if #contents > 0 then
2015-03-11 19:52:51 +00:00
p.push('<PropertyGroup %s>', m.condition(cfg))
p.outln(contents)
2015-03-11 19:52:51 +00:00
p.pop('</PropertyGroup>')
end
end
2015-03-11 19:52:51 +00:00
p.outln('</Project>')
end
2015-03-11 19:52:51 +00:00
function m.debugsettings(cfg)
m.localDebuggerCommandArguments(cfg)
end
2015-03-11 19:52:51 +00:00
function m.localDebuggerCommandArguments(cfg)
if #cfg.debugargs > 0 then
2015-03-11 19:52:51 +00:00
p.x('<StartArguments>%s</StartArguments>', table.concat(cfg.debugargs, " "))
end
end