From 9f67feb92328aaf102b0a1bbb42e10799fca3cf2 Mon Sep 17 00:00:00 2001 From: Tom van Dijck Date: Mon, 1 Aug 2016 14:40:40 -0700 Subject: [PATCH] Add support for kind="list:path" in rule properties. (#553) --- src/actions/vstudio/vs2010_rules_props.lua | 6 +++--- src/actions/vstudio/vs2010_rules_xml.lua | 2 ++ src/actions/vstudio/vs2010_vcxproj.lua | 5 ++++- 3 files changed, 9 insertions(+), 4 deletions(-) diff --git a/src/actions/vstudio/vs2010_rules_props.lua b/src/actions/vstudio/vs2010_rules_props.lua index e5e868e5..d42839c9 100644 --- a/src/actions/vstudio/vs2010_rules_props.lua +++ b/src/actions/vstudio/vs2010_rules_props.lua @@ -154,9 +154,9 @@ function m.dependsOn(r) - p.w('<%sDependsOn', r.name) - p.w(' Condition="\'$(ConfigurationType)\' != \'Makefile\'">_SelectedFiles;$(%sDependsOn)', - r.name, r.name, r.name) + p.w('<%sDependsOn', r.name) + p.w(' Condition="\'$(ConfigurationType)\' != \'Makefile\'">_SelectedFiles;$(%sDependsOn)', + r.name, r.name, r.name) end diff --git a/src/actions/vstudio/vs2010_rules_xml.lua b/src/actions/vstudio/vs2010_rules_xml.lua index 5b7b0cb4..88ea96f7 100644 --- a/src/actions/vstudio/vs2010_rules_xml.lua +++ b/src/actions/vstudio/vs2010_rules_xml.lua @@ -119,6 +119,8 @@ m.stringListProperty(def) elseif type(def.values) == "table" then m.enumProperty(def) + elseif def.kind:startswith("list:") then + m.stringListProperty(def) else m.stringProperty(def) end diff --git a/src/actions/vstudio/vs2010_vcxproj.lua b/src/actions/vstudio/vs2010_vcxproj.lua index d93b8517..0a5c9bf3 100644 --- a/src/actions/vstudio/vs2010_vcxproj.lua +++ b/src/actions/vstudio/vs2010_vcxproj.lua @@ -523,11 +523,14 @@ local fld = p.rule.getPropertyField(rule, prop) local value = cfg[fld.name] if value ~= nil then - if fld.kind == "path" then + if fld.kind == "list:path" then + value = table.concat(vstudio.path(cfg, value), ';') + elseif fld.kind == "path" then value = vstudio.path(cfg, value) else value = p.rule.getPropertyString(rule, prop, value) end + if value ~= nil and #value > 0 then m.element(prop.name, nil, '%s', value) end