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

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

Issue 11225037: [NaCl SDK] move VSNaClSDKRoot into ConfigurationGeneral section (Closed) Base URL: http://nativeclient-sdk.googlecode.com/svn/trunk/src
Patch Set: Created 8 years, 1 month 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 201 matching lines...) Expand 10 before | Expand all | Expand 10 after
212 { 212 {
213 string baseLibName = lib.Replace(".lib", string.Empty); 213 string baseLibName = lib.Replace(".lib", string.Empty);
214 if (!string.IsNullOrWhiteSpace(lib)) 214 if (!string.IsNullOrWhiteSpace(lib))
215 { 215 {
216 libs = string.Concat(libs, baseLibName, ".lib;"); 216 libs = string.Concat(libs, baseLibName, ".lib;");
217 } 217 }
218 } 218 }
219 } 219 }
220 220
221 properties.SetProperty("Link", "AdditionalDependencies", libs); 221 properties.SetProperty("Link", "AdditionalDependencies", libs);
222
223 // Work around for issue 140162. Forces some properties to save to the project file.
224 PerformPropertyFixes(config);
225 } 222 }
226 } 223 }
227 } 224 }
228 225
229 /// <summary> 226 /// <summary>
230 /// Takes a project configuration and sets values in the project file to wor k around some
231 /// problems in Visual Studio. This is a work around for issue 140162.
232 /// </summary>
233 /// <param name="config">A configuration that needs modification.</param>
234 private void PerformPropertyFixes(VCConfiguration config)
235 {
236 // NaCl Platform Specific:
237 if (PropertyManager.IsNaClPlatform(config.Platform.Name))
238 {
239 IVCRulePropertyStorage general = config.Rules.Item("ConfigurationGeneral ");
240 string[] keys = {"VSNaClSDKRoot"};
241 Dictionary<string, string> values = new Dictionary<string, string>();
242 foreach (var key in keys)
243 {
244 values[key] = general.GetUnevaluatedPropertyValue(key);
245 general.DeleteProperty(key);
246 }
247
248 foreach (var key in keys)
249 {
250 general.SetPropertyValue(key, values[key]);
251 }
252 }
253
254 IVCRulePropertyStorage directories = config.Rules.Item("ConfigurationDirec tories");
255 string includePath = directories.GetUnevaluatedPropertyValue("IncludePath" );
256 string libraryPath = directories.GetUnevaluatedPropertyValue("LibraryPath" );
257 directories.DeleteProperty("IncludePath");
258 directories.DeleteProperty("LibraryPath");
259 directories.SetPropertyValue("IncludePath", includePath);
260 directories.SetPropertyValue("LibraryPath", libraryPath);
261
262 // Pepper specific:
263 if (config.Platform.Name == Strings.PepperPlatformName)
264 {
265 string executablePath = directories.GetUnevaluatedPropertyValue("Executa blePath");
266 directories.SetPropertyValue("ExecutablePath", executablePath);
267 }
268 }
269
270 /// <summary>
271 /// Get the major version of the AddIn. 227 /// Get the major version of the AddIn.
272 /// </summary> 228 /// </summary>
273 /// <returns>The add-in major version number.</returns> 229 /// <returns>The add-in major version number.</returns>
274 private int GetAddInMajorVersion() 230 private int GetAddInMajorVersion()
275 { 231 {
276 Assembly assem = Assembly.GetExecutingAssembly(); 232 Assembly assem = Assembly.GetExecutingAssembly();
277 AssemblyName assemName = assem.GetName(); 233 AssemblyName assemName = assem.GetName();
278 return assemName.Version.Major; 234 return assemName.Version.Major;
279 } 235 }
280 236
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
318 } 274 }
319 else if (properties.ProjectPlatform == PropertyManager.ProjectPlatformTy pe.Pepper) 275 else if (properties.ProjectPlatform == PropertyManager.ProjectPlatformTy pe.Pepper)
320 { 276 {
321 debugger_ = new PluginDebuggerVS(dte_, properties); 277 debugger_ = new PluginDebuggerVS(dte_, properties);
322 webServer_ = new WebServer(webServerOutputPane_, properties); 278 webServer_ = new WebServer(webServerOutputPane_, properties);
323 } 279 }
324 } 280 }
325 } 281 }
326 } 282 }
327 } 283 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698