Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(203)

Side by Side Diff: visual_studio/NativeClientVSAddIn/NaCl.Build.CPPTasks/XamlParser.cs

Issue 11044024: Implement multi-core builds in MSVS (Closed) Base URL: http://nativeclient-sdk.googlecode.com/svn/trunk/src
Patch Set: Created 8 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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
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
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 arm (ProcessorNumber)
133 //IntProperty casted = (IntProperty)property;
134 //AppendStringValue(builder, property, String.Empty, value);
binji 2012/10/03 22:52:13 remove unused code
Sam Clegg 2012/10/04 22:57:57 Done.
135 }
136
129 private void GenerateArgumentBool(CommandLineBuilder builder, BaseProper ty property, string value) 137 private void GenerateArgumentBool(CommandLineBuilder builder, BaseProper ty property, string value)
130 { 138 {
131 if (value == "true") 139 if (value == "true")
132 { 140 {
133 builder.AppendSwitchUnquotedIfNotNull(m_parsedBuildRule.SwitchPr efix, property.Switch); 141 builder.AppendSwitchUnquotedIfNotNull(m_parsedBuildRule.SwitchPr efix, property.Switch);
134 } 142 }
135 else if (value == "false" && ((BoolProperty)property).ReverseSwitch != null) 143 else if (value == "false" && ((BoolProperty)property).ReverseSwitch != null)
136 { 144 {
137 builder.AppendSwitchUnquotedIfNotNull(m_parsedBuildRule.SwitchPr efix, ((BoolProperty)property).ReverseSwitch); 145 builder.AppendSwitchUnquotedIfNotNull(m_parsedBuildRule.SwitchPr efix, ((BoolProperty)property).ReverseSwitch);
138 } 146 }
(...skipping 12 matching lines...) Expand all
151 } // class 159 } // class
152 160
153 private Rule m_parsedBuildRule; 161 private Rule m_parsedBuildRule;
154 private Dictionary<string, PropertyWrapper> ToolProperties { get; set; } 162 private Dictionary<string, PropertyWrapper> ToolProperties { get; set; }
155 163
156 // function mapping for easy property function calling 164 // function mapping for easy property function calling
157 private Dictionary<Type, Action<CommandLineBuilder, BaseProperty, string >> m_typeFunctionMap; 165 private Dictionary<Type, Action<CommandLineBuilder, BaseProperty, string >> m_typeFunctionMap;
158 } // XamlParser 166 } // XamlParser
159 } // namespace NaCl.Build.CPPTasks 167 } // namespace NaCl.Build.CPPTasks
160 168
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698