From dac18c990b1112bcd2c386bb22aec072e48d0c23 Mon Sep 17 00:00:00 2001 From: Jason Perkins Date: Tue, 14 Feb 2012 16:16:58 -0500 Subject: [PATCH] Added per-configuration file lists for VC2008 --- src/actions/vstudio/vs200x_vcproj.lua | 35 +++++++++++++++------ src/project/project.lua | 1 + tests/actions/vstudio/vc200x/test_files.lua | 26 +++++++++++++++ 3 files changed, 52 insertions(+), 10 deletions(-) diff --git a/src/actions/vstudio/vs200x_vcproj.lua b/src/actions/vstudio/vs200x_vcproj.lua index 5d16abb7..3c56af81 100644 --- a/src/actions/vstudio/vs200x_vcproj.lua +++ b/src/actions/vstudio/vs200x_vcproj.lua @@ -738,22 +738,37 @@ depth = depth + 1 for cfg in project.eachconfig(prj) do - local hasconfig + local elementOpened = false + local filecfg = nil - local out = function(depth, msg, ...) - if not hasconfig then - hasconfig = true + -- helper function writes an attribute into the element, opening + -- the containing element on the first call. + local toolattrib = function(depth, msg, ...) + if not elementOpened then + elementOpened = true _p(depth, '') _p(depth, '\t') _p(depth, '') end diff --git a/src/project/project.lua b/src/project/project.lua index c08f0d92..da4c13bc 100755 --- a/src/project/project.lua +++ b/src/project/project.lua @@ -87,6 +87,7 @@ if i <= #files then local fcfg = {} fcfg.fullpath = project.getrelative(prj, files[i]) + fcfg.abspath = files[i] local vpath = project.getvpath(prj, files[i]) if vpath ~= files[i] then diff --git a/tests/actions/vstudio/vc200x/test_files.lua b/tests/actions/vstudio/vc200x/test_files.lua index 2ec60ccf..f79df572 100644 --- a/tests/actions/vstudio/vc200x/test_files.lua +++ b/tests/actions/vstudio/vc200x/test_files.lua @@ -189,3 +189,29 @@ UsePrecompiledHeader="1" ]] end + + +-- +-- A file excluded from a specific configuration should be marked as such. +-- + + function suite.excludedFromBuild_onExcludedFile() + files { "hello.cpp" } + configuration "Debug" + removefiles { "hello.cpp" } + prepare() + test.capture [[ + + + + + + ]] + end