2009-03-25 23:04:32 +00:00
|
|
|
--
|
|
|
|
-- vs2005_csproj_user.lua
|
|
|
|
-- Generate a Visual Studio 2005/2008 C# .user file.
|
2014-02-08 15:44:57 +00:00
|
|
|
-- Copyright (c) 2009-2014 Jason Perkins and the Premake project
|
2009-03-25 23:04:32 +00:00
|
|
|
--
|
|
|
|
|
2014-02-08 15:44:57 +00:00
|
|
|
local p = premake
|
|
|
|
local cs2005 = p.vstudio.cs2005
|
|
|
|
local project = p.project
|
2011-02-02 18:27:52 +00:00
|
|
|
|
|
|
|
|
2012-01-12 21:59:15 +00:00
|
|
|
--
|
|
|
|
-- Generate a Visual Studio 200x C# user file, with support for the new platforms API.
|
|
|
|
--
|
2013-05-22 15:15:48 +00:00
|
|
|
|
2015-03-11 18:46:13 +00:00
|
|
|
function cs2005.generateUser(prj)
|
2014-09-12 19:47:22 +00:00
|
|
|
p.vstudio.projectElement()
|
2012-09-27 14:15:27 +00:00
|
|
|
_p(1,'<PropertyGroup>')
|
2013-05-22 15:15:48 +00:00
|
|
|
|
2012-09-27 14:15:27 +00:00
|
|
|
-- Per-configuration reference paths aren't supported (are they?) so just
|
|
|
|
-- use the first configuration in the project
|
|
|
|
local cfg = project.getfirstconfig(prj)
|
2013-05-22 15:15:48 +00:00
|
|
|
|
2012-09-27 14:15:27 +00:00
|
|
|
local refpaths = path.translate(project.getrelative(prj, cfg.libdirs))
|
|
|
|
_p(2,'<ReferencePath>%s</ReferencePath>', table.concat(refpaths, ";"))
|
2013-05-22 15:15:48 +00:00
|
|
|
|
2012-09-20 22:07:19 +00:00
|
|
|
_p(' </PropertyGroup>')
|
2015-01-02 22:26:13 +00:00
|
|
|
|
|
|
|
for cfg in project.eachconfig(prj) do
|
2015-01-26 22:04:29 +00:00
|
|
|
local contents = p.capture(function()
|
|
|
|
cs2005.debugsettings(cfg)
|
|
|
|
end)
|
|
|
|
|
|
|
|
if #contents > 0 then
|
|
|
|
_p(1,'<PropertyGroup %s>', cs2005.condition(cfg))
|
|
|
|
p.outln(contents)
|
|
|
|
_p(1,'</PropertyGroup>')
|
|
|
|
end
|
2015-01-02 22:26:13 +00:00
|
|
|
end
|
|
|
|
|
2012-09-20 22:07:19 +00:00
|
|
|
_p('</Project>')
|
2012-01-12 21:59:15 +00:00
|
|
|
end
|
2015-01-26 22:04:29 +00:00
|
|
|
|
2015-01-02 22:26:13 +00:00
|
|
|
function cs2005.debugsettings(cfg)
|
|
|
|
cs2005.localDebuggerCommandArguments(cfg)
|
|
|
|
end
|
|
|
|
|
|
|
|
function cs2005.localDebuggerCommandArguments(cfg)
|
|
|
|
if #cfg.debugargs > 0 then
|
|
|
|
_x(2,'<StartArguments>%s</StartArguments>', table.concat(cfg.debugargs, " "))
|
|
|
|
end
|
|
|
|
end
|