diff --git a/src/actions/vstudio/vs2005.lua b/src/actions/vstudio/vs2005.lua index 244a310d..ed314047 100644 --- a/src/actions/vstudio/vs2005.lua +++ b/src/actions/vstudio/vs2005.lua @@ -31,15 +31,22 @@ if premake.project.isdotnet(prj) then premake.generate(prj, ".csproj", vstudio.cs2005.generate) - premake.generate(prj, ".csproj.user", vstudio.cs2005.generateUser) + + -- Skip generation of empty user files + local user = p.capture(function() vstudio.cs2005.generateUser(prj) end) + if #user > 0 then + p.generate(prj, ".csproj.user", function() p.outln(user) end) + end + elseif premake.project.iscpp(prj) then premake.generate(prj, ".vcproj", vstudio.vc200x.generate) -- Skip generation of empty user files local user = p.capture(function() vstudio.vc200x.generateUser(prj) end) if #user > 0 then - p.generate(prj, ".vcproj.user", function() p.out(user) end) + p.generate(prj, ".vcproj.user", function() p.outln(user) end) end + end end diff --git a/src/actions/vstudio/vs2010.lua b/src/actions/vstudio/vs2010.lua index a8192340..3552c56e 100644 --- a/src/actions/vstudio/vs2010.lua +++ b/src/actions/vstudio/vs2010.lua @@ -47,7 +47,7 @@ -- Skip generation of empty user files local user = p.capture(function() vstudio.vc2010.generateUser(prj) end) if #user > 0 then - p.generate(prj, ".vcxproj.user", function() p.out(user) end) + p.generate(prj, ".vcxproj.user", function() p.outln(user) end) end -- Only generate a filters file if the source tree actually has subfolders diff --git a/src/actions/vstudio/vs2010_vcxproj_user.lua b/src/actions/vstudio/vs2010_vcxproj_user.lua index 9647d317..9bdd20c2 100755 --- a/src/actions/vstudio/vs2010_vcxproj_user.lua +++ b/src/actions/vstudio/vs2010_vcxproj_user.lua @@ -42,7 +42,7 @@ end p.pop('') end - p.out('') + p.pop('') end end diff --git a/src/base/premake.lua b/src/base/premake.lua index 428493a0..7f011d48 100644 --- a/src/base/premake.lua +++ b/src/base/premake.lua @@ -164,6 +164,7 @@ _indentLevel = 0 callback(obj) f:close() + _indentLevel = 0 end