Commits

Jason Perkins committed 78d4669

Minor changes to Visual Studio C# projects to avoid changes on save

Comments (0)

Files changed (4)

src/actions/vstudio/vs2005_csproj.lua

 	function cs2005.generate_ng(prj)
 		io.eol = "\r\n"
 		io.indent = "  "
+		io.utf8()
 
 		premake.callarray(cs2005, cs2005.elements.project, prj)
 
 		cs2005.targets(prj)
 		cs2005.buildEvents(prj)
 
-		_p('</Project>')
+		io.printf('</Project>')
 	end
 
 
 
 	function cs2005.targetFrameworkProfile(prj)
 		if _ACTION == "vs2010" then
-			_p(2,'<TargetFrameworkProfile></TargetFrameworkProfile>')
+			_p(2,'<TargetFrameworkProfile>')
+			_p(2,'</TargetFrameworkProfile>')
 		end
 	end
 

src/actions/vstudio/vs2008.lua

 
 		vstudio = {
 			csprojSchemaVersion = "2.0",
-			productVersion      = "9.0.21022",
+			productVersion      = "9.0.30729",
 			solutionVersion     = "10",
 			toolsVersion        = "3.5",
 		}
 --
 
 	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
 -- 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

tests/actions/vstudio/cs2005/projectsettings.lua

 	<PropertyGroup>
 		<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
 		<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
-		<ProductVersion>9.0.21022</ProductVersion>
+		<ProductVersion>9.0.30729</ProductVersion>
 		<SchemaVersion>2.0</SchemaVersion>
 		<ProjectGuid>{AE61726D-187C-E440-BD07-2556188A6565}</ProjectGuid>
 		<OutputType>Exe</OutputType>
 		<RootNamespace>MyProject</RootNamespace>
 		<AssemblyName>MyProject</AssemblyName>
 		<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
-		<TargetFrameworkProfile></TargetFrameworkProfile>
+		<TargetFrameworkProfile>
+		</TargetFrameworkProfile>
 		<FileAlignment>512</FileAlignment>
 	</PropertyGroup>
 		]]