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

Side by Side Diff: visual_studio/NativeClientVSAddIn/NativeClientVSAddIn/Connect.cs

Issue 11192036: Fix for Visual Studio prompting for $(CHROME_PATH) (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 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 namespace NativeClientVSAddIn 5 namespace NativeClientVSAddIn
6 { 6 {
7 using System; 7 using System;
8 8
9 using EnvDTE; 9 using EnvDTE;
10 using EnvDTE80; 10 using EnvDTE80;
(...skipping 156 matching lines...) Expand 10 before | Expand all | Expand 10 after
167 /// to save some specific properties into the project file to get around iss ue 140162. 167 /// to save some specific properties into the project file to get around iss ue 140162.
168 /// </summary> 168 /// </summary>
169 private void PerformPropertyModifications() 169 private void PerformPropertyModifications()
170 { 170 {
171 string naclAddInVersion = GetAddInMajorVersion().ToString(); 171 string naclAddInVersion = GetAddInMajorVersion().ToString();
172 172
173 var configs = Utility.GetPlatformVCConfigurations(dte_, Strings.PepperPlat formName); 173 var configs = Utility.GetPlatformVCConfigurations(dte_, Strings.PepperPlat formName);
174 configs.AddRange(Utility.GetPlatformVCConfigurations(dte_, Strings.NaCl64P latformName)); 174 configs.AddRange(Utility.GetPlatformVCConfigurations(dte_, Strings.NaCl64P latformName));
175 configs.AddRange(Utility.GetPlatformVCConfigurations(dte_, Strings.NaCl32P latformName)); 175 configs.AddRange(Utility.GetPlatformVCConfigurations(dte_, Strings.NaCl32P latformName));
176 176
177
177 var properties = new PropertyManager(); 178 var properties = new PropertyManager();
178 foreach (VCConfiguration config in configs) 179 foreach (VCConfiguration config in configs)
179 { 180 {
180 properties.SetTarget(config); 181 properties.SetTarget(config);
181 if (properties.NaClAddInVersion != naclAddInVersion) 182
183 IVCRulePropertyStorage debugger = config.Rules.Item("WindowsLocalDebugge r");
184 string executable = debugger.GetUnevaluatedPropertyValue("LocalDebuggerC ommand");
185
186 // Perform project modifications of the NaClAddInVersion in the project file
187 // is out of date, or if the WindowsLocalDebugger contains CHROME_PATH. The
188 // later can happen if the developer deletes the .user file.
189 if (executable.Contains("$(CHROME_PATH)") || properties.NaClAddInVersion != naclAddInVersion)
182 { 190 {
183 Debug.WriteLine("Modifying Config: " + config.Name); 191 Debug.WriteLine("Modifying Config: " + config.Name);
184 192
185 // Set the NaCl add-in version so that it is stored in the project fil e. 193 // Set the NaCl add-in version so that it is stored in the project fil e.
186 properties.SetProperty("ConfigurationGeneral", "NaClAddInVersion", nac lAddInVersion); 194 properties.SetProperty("ConfigurationGeneral", "NaClAddInVersion", nac lAddInVersion);
187 195
188 // Expand the CHROME_PATH variable to its full path. 196 // Expand the CHROME_PATH variable to its full path.
189 string expandedChrome = properties.GetProperty( 197 string expandedChrome = properties.GetProperty(
190 "WindowsLocalDebugger", "LocalDebuggerCommand"); 198 "WindowsLocalDebugger", "LocalDebuggerCommand");
191 properties.SetProperty("WindowsLocalDebugger", "LocalDebuggerCommand", expandedChrome); 199 properties.SetProperty("WindowsLocalDebugger", "LocalDebuggerCommand", expandedChrome);
(...skipping 26 matching lines...) Expand all
218 } 226 }
219 } 227 }
220 228
221 /// <summary> 229 /// <summary>
222 /// Takes a project configuration and sets values in the project file to wor k around some 230 /// Takes a project configuration and sets values in the project file to wor k around some
223 /// problems in Visual Studio. This is a work around for issue 140162. 231 /// problems in Visual Studio. This is a work around for issue 140162.
224 /// </summary> 232 /// </summary>
225 /// <param name="config">A configuration that needs modification.</param> 233 /// <param name="config">A configuration that needs modification.</param>
226 private void PerformPropertyFixes(VCConfiguration config) 234 private void PerformPropertyFixes(VCConfiguration config)
227 { 235 {
228 IVCRulePropertyStorage debugger = config.Rules.Item("WindowsLocalDebugger" );
229
230 // NaCl Platform Specific: 236 // NaCl Platform Specific:
231 if (PropertyManager.IsNaClPlatform(config.Platform.Name)) 237 if (PropertyManager.IsNaClPlatform(config.Platform.Name))
232 { 238 {
233 IVCRulePropertyStorage general = config.Rules.Item("ConfigurationGeneral "); 239 IVCRulePropertyStorage general = config.Rules.Item("ConfigurationGeneral ");
234 string[] keys = {"VSNaClSDKRoot"}; 240 string[] keys = {"VSNaClSDKRoot"};
235 Dictionary<string, string> values = new Dictionary<string, string>(); 241 Dictionary<string, string> values = new Dictionary<string, string>();
236 foreach (var key in keys) 242 foreach (var key in keys)
237 { 243 {
238 values[key] = general.GetUnevaluatedPropertyValue(key); 244 values[key] = general.GetUnevaluatedPropertyValue(key);
239 general.DeleteProperty(key); 245 general.DeleteProperty(key);
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after
312 } 318 }
313 else if (properties.ProjectPlatform == PropertyManager.ProjectPlatformTy pe.Pepper) 319 else if (properties.ProjectPlatform == PropertyManager.ProjectPlatformTy pe.Pepper)
314 { 320 {
315 debugger_ = new PluginDebuggerVS(dte_, properties); 321 debugger_ = new PluginDebuggerVS(dte_, properties);
316 webServer_ = new WebServer(webServerOutputPane_, properties); 322 webServer_ = new WebServer(webServerOutputPane_, properties);
317 } 323 }
318 } 324 }
319 } 325 }
320 } 326 }
321 } 327 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698