diff --git a/src/actions/vstudio/vs2005_csproj.lua b/src/actions/vstudio/vs2005_csproj.lua
index c1a15bb4..2285a879 100644
--- a/src/actions/vstudio/vs2005_csproj.lua
+++ b/src/actions/vstudio/vs2005_csproj.lua
@@ -133,10 +133,10 @@
-- Some settings applied at project level; can't be changed in cfg
local cfg = project.getfirstconfig(prj)
local filecfg = config.getfileconfig(cfg, node.abspath)
-
+
local action = premake.dotnet.getbuildaction(filecfg)
local fname = path.translate(node.relpath)
- local elements, dependency = cs2005.getrelated(prj, node.abspath, action)
+ local elements, dependency = cs2005.getrelated(prj, filecfg, action)
if elements == "None" then
_p(2,'<%s Include="%s" />', action, fname)
@@ -148,12 +148,10 @@
_p(3,'Designer')
_p(3,'ResXFileCodeGenerator')
_x(3,'%s.Designer.cs', path.getbasename(node.name))
- elseif elements == "SubTypeDesigner" then
- _p(3,'Designer')
- elseif elements == "SubTypeForm" then
- _p(3,'Form')
elseif elements == "PreserveNewest" then
_p(3,'PreserveNewest')
+ elseif elements then
+ _p(3,'%s', elements)
end
if dependency then
dependency = project.getrelative(prj, dependency)
@@ -229,13 +227,14 @@
--
-- @param prj
-- The current project, which contains the source file lists.
--- @param fname
--- The absolute path of the file under consideration.
+-- @param filecfg
+-- The configuration of the file being generated.
-- @param action
-- The build action for the file under consideration.
--
- function cs2005.getrelated(prj, fname, action)
+ function cs2005.getrelated(prj, filecfg, action)
+ local fname = filecfg.abspath
if action == "Compile" and fname:endswith(".cs") then
if fname:endswith(".Designer.cs") then
local basename = fname:sub(1, -13)
@@ -252,12 +251,11 @@
return "AutoGen", testname
end
else
- local basename = fname:sub(1, -4)
-
-- is there a matching *.Designer.cs?
+ local basename = fname:sub(1, -4)
testname = basename .. ".Designer.cs"
if project.hasfile(prj, testname) then
- return "AutoGenerated"
+ return "Form"
end
end
end
diff --git a/src/base/api.lua b/src/base/api.lua
index bfe21e17..c9459f98 100644
--- a/src/base/api.lua
+++ b/src/base/api.lua
@@ -1177,7 +1177,8 @@
end
local cfg = { }
- cfg.terms = table.flatten({terms})
+ cfg.terms = table.flatten({terms})
+ cfg.basedir = os.getcwd()
table.insert(container.blocks, cfg)
premake.CurrentConfiguration = cfg
diff --git a/src/project/oven.lua b/src/project/oven.lua
index 7f3809b2..9215047e 100755
--- a/src/project/oven.lua
+++ b/src/project/oven.lua
@@ -102,16 +102,17 @@
-- the base dir of the configuration, so single-star wildcards
-- (i.e. "*.cpp") will work as expected, and lower-case to make
-- the test case-insensitive.
- filename = { path.getrelative(cfg.basedir, filename):lower() }
for _, block in ipairs(cfg.solution.blocks) do
- if oven.filter(block, cfg.terms, filename) then
+ local filter = { path.getrelative(block.basedir, filename):lower() }
+ if oven.filter(block, cfg.terms, filter) then
oven.mergefile(fcfg, cfg, block)
end
end
for _, block in ipairs(cfg.project.blocks) do
- if oven.filter(block, cfg.terms, filename) then
+ local filter = { path.getrelative(block.basedir, filename):lower() }
+ if oven.filter(block, cfg.terms, filter) then
oven.mergefile(fcfg, cfg, block)
end
end