From 8be16d75b8671020179569b3639854be23c22e7b Mon Sep 17 00:00:00 2001 From: Jason Perkins Date: Wed, 15 May 2013 11:15:54 -0400 Subject: [PATCH] Minor changes to Visual Studio C# projects to avoid changes on save --- src/actions/vstudio/vs2005_csproj.lua | 6 +++-- src/actions/vstudio/vs2008.lua | 2 +- src/base/io.lua | 22 ++++++++----------- .../vstudio/cs2005/projectsettings.lua | 5 +++-- 4 files changed, 17 insertions(+), 18 deletions(-) diff --git a/src/actions/vstudio/vs2005_csproj.lua b/src/actions/vstudio/vs2005_csproj.lua index b29d4557..010c2b20 100644 --- a/src/actions/vstudio/vs2005_csproj.lua +++ b/src/actions/vstudio/vs2005_csproj.lua @@ -27,6 +27,7 @@ function cs2005.generate_ng(prj) io.eol = "\r\n" io.indent = " " + io.utf8() premake.callarray(cs2005, cs2005.elements.project, prj) @@ -45,7 +46,7 @@ cs2005.targets(prj) cs2005.buildEvents(prj) - _p('') + io.printf('') end @@ -455,7 +456,8 @@ function cs2005.targetFrameworkProfile(prj) if _ACTION == "vs2010" then - _p(2,'') + _p(2,'') + _p(2,'') end end diff --git a/src/actions/vstudio/vs2008.lua b/src/actions/vstudio/vs2008.lua index 971d1a36..4ad2216f 100644 --- a/src/actions/vstudio/vs2008.lua +++ b/src/actions/vstudio/vs2008.lua @@ -50,7 +50,7 @@ vstudio = { csprojSchemaVersion = "2.0", - productVersion = "9.0.21022", + productVersion = "9.0.30729", solutionVersion = "10", toolsVersion = "3.5", } diff --git a/src/base/io.lua b/src/base/io.lua index fc87e6d2..4972f407 100644 --- a/src/base/io.lua +++ b/src/base/io.lua @@ -69,24 +69,15 @@ -- function io.printf(msg, ...) - if not io.eol then - io.eol = "\n" - end - - if not io.indent then - io.indent = "\t" - end - if type(msg) == "number" then local str, fmt, x = unpack(arg) - s = string.rep(io.indent, msg) .. string.format(unpack(arg)) + s = string.rep(io.indent or "\t", msg) .. string.format(unpack(arg)) else s = string.format(msg, unpack(arg)) end if not io._captured then io.write(s) - io.write(io.eol) else table.insert(io._captured, s) io._captured_string = nil @@ -108,16 +99,21 @@ -- for it. This saves me typing, and also reduces the size of the executable. -- - _p = io.printf + function _p(msg, ...) + io.printf(msg, unpack(arg)) + if not io._captured then + io.write(io.eol or "\n") + end + end -- -- Another variation that calls esc() on all of its arguments before formatting. -- - _x = function(msg, ...) + function _x(msg, ...) for i=2, #arg do arg[i] = premake.esc(arg[i]) end - io.printf(msg, unpack(arg)) + _p(msg, unpack(arg)) end diff --git a/tests/actions/vstudio/cs2005/projectsettings.lua b/tests/actions/vstudio/cs2005/projectsettings.lua index cbb1e689..227f45a2 100755 --- a/tests/actions/vstudio/cs2005/projectsettings.lua +++ b/tests/actions/vstudio/cs2005/projectsettings.lua @@ -57,7 +57,7 @@ Debug AnyCPU - 9.0.21022 + 9.0.30729 2.0 {AE61726D-187C-E440-BD07-2556188A6565} Exe @@ -84,7 +84,8 @@ MyProject MyProject v4.0 - + + 512 ]]