Added cleanExtensions(), with VC 201x support

This commit is contained in:
Jason Perkins 2014-07-16 15:32:08 -04:00
parent 7b8d4c4c98
commit 35582e2c4c
3 changed files with 37 additions and 0 deletions

View File

@ -117,6 +117,12 @@
tokens = true,
}
api.register {
name = "cleanExtensions",
scope = "config",
kind = "list:string",
}
api.register {
name = "configmap",
scope = "config",

View File

@ -182,6 +182,7 @@
m.propertyGroup,
m.outDir,
m.intDir,
m.extensionsToDeleteOnClean,
}
else
return {
@ -195,6 +196,7 @@
m.targetExt,
m.imageXexOutput,
m.generateManifest,
m.extensionsToDeleteOnClean,
}
end
end
@ -1024,6 +1026,14 @@
end
function m.extensionsToDeleteOnClean(cfg)
if #cfg.cleanExtensions > 0 then
local value = table.implode(cfg.cleanExtensions, "*", ";", "")
m.element("ExtensionsToDeleteOnClean", nil, value .. "$(ExtensionsToDeleteOnClean)")
end
end
function m.floatingPointModel(cfg)
if cfg.floatingpoint then
p.w('<FloatingPointModel>%s</FloatingPointModel>', cfg.floatingpoint)

View File

@ -232,3 +232,24 @@
</PropertyGroup>
]]
end
--
-- Check the handling of extra cleaning extensions.
--
function suite.extensionsToDeleteOnClean()
cleanExtensions { ".temp1", ".temp2" }
prepare()
test.capture [[
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<LinkIncremental>true</LinkIncremental>
<OutDir>.\</OutDir>
<IntDir>obj\Debug\</IntDir>
<TargetName>MyProject</TargetName>
<TargetExt>.exe</TargetExt>
<ExtensionsToDeleteOnClean>*.temp1;*.temp2;$(ExtensionsToDeleteOnClean)</ExtensionsToDeleteOnClean>
</PropertyGroup>
]]
end