Added new output function _x(), XML escapes all arguments before printing
This commit is contained in:
parent
8c9c451bdb
commit
665ef8b86a
@ -59,7 +59,7 @@
|
|||||||
local prjpath = vstudio.projectfile_ng(prj)
|
local prjpath = vstudio.projectfile_ng(prj)
|
||||||
prjpath = path.translate(path.getrelative(slnpath, prjpath))
|
prjpath = path.translate(path.getrelative(slnpath, prjpath))
|
||||||
|
|
||||||
_p('Project("{%s}") = "%s", "%s", "{%s}"', vstudio.tool(prj), prj.name, prjpath, prj.uuid)
|
_x('Project("{%s}") = "%s", "%s", "{%s}"', vstudio.tool(prj), prj.name, prjpath, prj.uuid)
|
||||||
sln2005.projectdependencies_ng(prj)
|
sln2005.projectdependencies_ng(prj)
|
||||||
_p('EndProject')
|
_p('EndProject')
|
||||||
end
|
end
|
||||||
|
@ -82,3 +82,15 @@
|
|||||||
--
|
--
|
||||||
|
|
||||||
_p = io.printf
|
_p = io.printf
|
||||||
|
|
||||||
|
|
||||||
|
--
|
||||||
|
-- Another variation that calls esc() on all of its arguments before formatting.
|
||||||
|
--
|
||||||
|
|
||||||
|
_x = function(msg, ...)
|
||||||
|
for i,v in ipairs(arg) do
|
||||||
|
arg[i] = premake.esc(arg[i])
|
||||||
|
end
|
||||||
|
io.printf(msg, unpack(arg))
|
||||||
|
end
|
||||||
|
@ -31,7 +31,6 @@
|
|||||||
--
|
--
|
||||||
|
|
||||||
function suite.structureIsOkay_onCpp()
|
function suite.structureIsOkay_onCpp()
|
||||||
_ACTION = "vs2005"
|
|
||||||
prepare()
|
prepare()
|
||||||
test.capture [[
|
test.capture [[
|
||||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "MyProject", "MyProject.vcproj", "{AE61726D-187C-E440-BD07-2556188A6565}"
|
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "MyProject", "MyProject.vcproj", "{AE61726D-187C-E440-BD07-2556188A6565}"
|
||||||
@ -45,7 +44,6 @@ EndProject
|
|||||||
--
|
--
|
||||||
|
|
||||||
function suite.structureIsOkay_onCSharp()
|
function suite.structureIsOkay_onCSharp()
|
||||||
_ACTION = "vs2005"
|
|
||||||
language "C#"
|
language "C#"
|
||||||
prepare()
|
prepare()
|
||||||
test.capture [[
|
test.capture [[
|
||||||
@ -53,3 +51,17 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MyProject", "MyProject.cspr
|
|||||||
EndProject
|
EndProject
|
||||||
]]
|
]]
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
|
--
|
||||||
|
-- Project names should be XML escaped.
|
||||||
|
--
|
||||||
|
|
||||||
|
function suite.projectNamesAreEscaped()
|
||||||
|
prj.name = 'My "x64" Project';
|
||||||
|
prepare()
|
||||||
|
test.capture [[
|
||||||
|
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "My "x64" Project", "My "x64" Project.vcproj", "{AE61726D-187C-E440-BD07-2556188A6565}"
|
||||||
|
EndProject
|
||||||
|
]]
|
||||||
|
end
|
||||||
|
Loading…
Reference in New Issue
Block a user