OLD | NEW |
1 using System; | 1 using System; |
2 using System.Collections.Generic; | 2 using System.Collections.Generic; |
3 using System.Linq; | 3 using System.Linq; |
4 using System.Text; | 4 using System.Text; |
5 | 5 |
6 using Microsoft.Build.Framework; | 6 using Microsoft.Build.Framework; |
7 using System.Xaml; | 7 using System.Xaml; |
8 using Microsoft.Build.Framework.XamlTypes; | 8 using Microsoft.Build.Framework.XamlTypes; |
9 using Microsoft.Build.Utilities; | 9 using Microsoft.Build.Utilities; |
10 | 10 |
(...skipping 21 matching lines...) Expand all Loading... |
32 | 32 |
33 InitFunctionMap(); | 33 InitFunctionMap(); |
34 } | 34 } |
35 | 35 |
36 private void InitFunctionMap() | 36 private void InitFunctionMap() |
37 { | 37 { |
38 m_typeFunctionMap = new Dictionary<Type, Action<CommandLineBuilder,
BaseProperty, string>> | 38 m_typeFunctionMap = new Dictionary<Type, Action<CommandLineBuilder,
BaseProperty, string>> |
39 { | 39 { |
40 { typeof(StringListProperty), GenerateArgumentStringList }, | 40 { typeof(StringListProperty), GenerateArgumentStringList }, |
41 { typeof(StringProperty), GenerateArgumentString }, | 41 { typeof(StringProperty), GenerateArgumentString }, |
42 { typeof(IntProperty), GenerateArgumentString }, | 42 { typeof(IntProperty), GenerateArgumentInt }, |
43 { typeof(BoolProperty), GenerateArgumentBool }, | 43 { typeof(BoolProperty), GenerateArgumentBool }, |
44 { typeof(EnumProperty), GenerateArgumentEnum } | 44 { typeof(EnumProperty), GenerateArgumentEnum } |
45 }; | 45 }; |
46 } | 46 } |
47 | 47 |
48 public string Parse(ITaskItem taskItem) | 48 public string Parse(ITaskItem taskItem) |
49 { | 49 { |
50 CommandLineBuilder builder = new CommandLineBuilder(); | 50 CommandLineBuilder builder = new CommandLineBuilder(); |
51 | 51 |
52 foreach (string name in taskItem.MetadataNames) | 52 foreach (string name in taskItem.MetadataNames) |
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
119 } | 119 } |
120 } | 120 } |
121 | 121 |
122 private void GenerateArgumentString(CommandLineBuilder builder, BaseProp
erty property, string value) | 122 private void GenerateArgumentString(CommandLineBuilder builder, BaseProp
erty property, string value) |
123 { | 123 { |
124 // could cache this SubType test off in property wrapper or somewher
e if performance were an issue | 124 // could cache this SubType test off in property wrapper or somewher
e if performance were an issue |
125 StringProperty casted = (StringProperty)property; | 125 StringProperty casted = (StringProperty)property; |
126 AppendStringValue(builder, property, casted.Subtype, value); | 126 AppendStringValue(builder, property, casted.Subtype, value); |
127 } | 127 } |
128 | 128 |
| 129 private void GenerateArgumentInt(CommandLineBuilder builder, BasePropert
y property, string value) |
| 130 { |
| 131 // Currently we only have one Int property and it doesn't correspond
to a |
| 132 // command line arguemnt (ProcessorNumber) so we ignore it here. |
| 133 } |
| 134 |
129 private void GenerateArgumentBool(CommandLineBuilder builder, BaseProper
ty property, string value) | 135 private void GenerateArgumentBool(CommandLineBuilder builder, BaseProper
ty property, string value) |
130 { | 136 { |
131 if (value == "true") | 137 if (value == "true") |
132 { | 138 { |
133 builder.AppendSwitchUnquotedIfNotNull(m_parsedBuildRule.SwitchPr
efix, property.Switch); | 139 builder.AppendSwitchUnquotedIfNotNull(m_parsedBuildRule.SwitchPr
efix, property.Switch); |
134 } | 140 } |
135 else if (value == "false" && ((BoolProperty)property).ReverseSwitch
!= null) | 141 else if (value == "false" && ((BoolProperty)property).ReverseSwitch
!= null) |
136 { | 142 { |
137 builder.AppendSwitchUnquotedIfNotNull(m_parsedBuildRule.SwitchPr
efix, ((BoolProperty)property).ReverseSwitch); | 143 builder.AppendSwitchUnquotedIfNotNull(m_parsedBuildRule.SwitchPr
efix, ((BoolProperty)property).ReverseSwitch); |
138 } | 144 } |
(...skipping 12 matching lines...) Expand all Loading... |
151 } // class | 157 } // class |
152 | 158 |
153 private Rule m_parsedBuildRule; | 159 private Rule m_parsedBuildRule; |
154 private Dictionary<string, PropertyWrapper> ToolProperties { get; set; } | 160 private Dictionary<string, PropertyWrapper> ToolProperties { get; set; } |
155 | 161 |
156 // function mapping for easy property function calling | 162 // function mapping for easy property function calling |
157 private Dictionary<Type, Action<CommandLineBuilder, BaseProperty, string
>> m_typeFunctionMap; | 163 private Dictionary<Type, Action<CommandLineBuilder, BaseProperty, string
>> m_typeFunctionMap; |
158 } // XamlParser | 164 } // XamlParser |
159 } // namespace NaCl.Build.CPPTasks | 165 } // namespace NaCl.Build.CPPTasks |
160 | 166 |
OLD | NEW |