2009-03-25 23:04:32 +00:00
|
|
|
--
|
|
|
|
-- 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
|
2009-03-25 23:04:32 +00:00
|
|
|
--
|
|
|
|
|
2014-02-08 15:44:57 +00:00
|
|
|
local p = premake
|
2015-03-11 19:52:51 +00:00
|
|
|
local m = p.vstudio.cs2005
|
2011-02-02 18:27:52 +00:00
|
|
|
|
|
|
|
|
2012-01-12 21:59:15 +00:00
|
|
|
--
|
2015-03-11 19:52:51 +00:00
|
|
|
-- Generate a Visual Studio 200x C# user file.
|
2012-01-12 21:59:15 +00:00
|
|
|
--
|
2013-05-22 15:15:48 +00:00
|
|
|
|
2015-03-11 19:52:51 +00:00
|
|
|
function m.generateUser(prj)
|
2014-09-12 19:47:22 +00:00
|
|
|
p.vstudio.projectElement()
|
2015-03-11 19:52:51 +00:00
|
|
|
p.push('<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
|
2015-03-11 19:52:51 +00:00
|
|
|
local cfg = p.project.getfirstconfig(prj)
|
2013-05-22 15:15:48 +00:00
|
|
|
|
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, ";"))
|
2013-05-22 15:15:48 +00:00
|
|
|
|
2015-03-11 19:52:51 +00:00
|
|
|
p.pop('</PropertyGroup>')
|
2015-01-02 22:26:13 +00:00
|
|
|
|
2015-03-11 19:52:51 +00:00
|
|
|
for cfg in p.project.eachconfig(prj) do
|
2015-01-26 22:04:29 +00:00
|
|
|
local contents = p.capture(function()
|
2015-03-11 19:52:51 +00:00
|
|
|
p.push()
|
|
|
|
m.debugsettings(cfg)
|
|
|
|
p.pop()
|
2015-01-26 22:04:29 +00:00
|
|
|
end)
|
|
|
|
|
|
|
|
if #contents > 0 then
|
2015-03-11 19:52:51 +00:00
|
|
|
p.push('<PropertyGroup %s>', m.condition(cfg))
|
2015-01-26 22:04:29 +00:00
|
|
|
p.outln(contents)
|
2015-03-11 19:52:51 +00:00
|
|
|
p.pop('</PropertyGroup>')
|
2015-01-26 22:04:29 +00:00
|
|
|
end
|
2015-01-02 22:26:13 +00:00
|
|
|
end
|
|
|
|
|
2015-03-11 19:52:51 +00:00
|
|
|
p.outln('</Project>')
|
2012-01-12 21:59:15 +00:00
|
|
|
end
|
2015-01-26 22:04:29 +00:00
|
|
|
|
2015-03-11 19:52:51 +00:00
|
|
|
|
|
|
|
|
|
|
|
function m.debugsettings(cfg)
|
|
|
|
m.localDebuggerCommandArguments(cfg)
|
2015-01-02 22:26:13 +00:00
|
|
|
end
|
|
|
|
|
2015-03-11 19:52:51 +00:00
|
|
|
function m.localDebuggerCommandArguments(cfg)
|
2015-01-02 22:26:13 +00:00
|
|
|
if #cfg.debugargs > 0 then
|
2015-03-11 19:52:51 +00:00
|
|
|
p.x('<StartArguments>%s</StartArguments>', table.concat(cfg.debugargs, " "))
|
2015-01-02 22:26:13 +00:00
|
|
|
end
|
|
|
|
end
|