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

Unified Diff: visual_studio/NativeClientVSAddIn/NativeClientVSAddIn/Connect.cs

Issue 11145025: Only store major version of AddIn in VS project file (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 side-by-side diff with in-line comments
Download patch
Index: visual_studio/NativeClientVSAddIn/NativeClientVSAddIn/Connect.cs
diff --git a/visual_studio/NativeClientVSAddIn/NativeClientVSAddIn/Connect.cs b/visual_studio/NativeClientVSAddIn/NativeClientVSAddIn/Connect.cs
index 8b39386e60de7aff7c58587f511e4b7a482e04f4..248210fa422e523bd1e7f0990edb9bbbbbd0333a 100644
--- a/visual_studio/NativeClientVSAddIn/NativeClientVSAddIn/Connect.cs
+++ b/visual_studio/NativeClientVSAddIn/NativeClientVSAddIn/Connect.cs
@@ -13,6 +13,7 @@ namespace NativeClientVSAddIn
using Microsoft.VisualStudio.VCProjectEngine;
using System.Collections.Generic;
using System.Diagnostics;
+ using System.Reflection;
/// <summary>The object for implementing an Add-in.</summary>
/// <seealso class='IDTExtensibility2' />
@@ -167,7 +168,7 @@ namespace NativeClientVSAddIn
/// </summary>
private void PerformPropertyModifications()
{
- string naclAddInVersion = GetAddInVersionFromDescription();
+ string naclAddInVersion = GetAddInMajorVersion().ToString();
var configs = Utility.GetPlatformVCConfigurations(dte_, Strings.PepperPlatformName);
configs.AddRange(Utility.GetPlatformVCConfigurations(dte_, Strings.NaCl64PlatformName));
@@ -225,8 +226,6 @@ namespace NativeClientVSAddIn
private void PerformPropertyFixes(VCConfiguration config)
{
IVCRulePropertyStorage debugger = config.Rules.Item("WindowsLocalDebugger");
- string arguments = debugger.GetUnevaluatedPropertyValue("LocalDebuggerCommandArguments");
- debugger.SetPropertyValue("LocalDebuggerCommandArguments", arguments);
// NaCl Platform Specific:
if (PropertyManager.IsNaClPlatform(config.Platform.Name))
@@ -263,29 +262,14 @@ namespace NativeClientVSAddIn
}
/// <summary>
- /// During the build process we dynamically put the add-in version number into the add-in
- /// description. This function extracts that version number.
+ /// Get the major version of the AddIn.
/// </summary>
- /// <returns>The add-in version number.</returns>
- private string GetAddInVersionFromDescription()
+ /// <returns>The add-in major version number.</returns>
+ private int GetAddInMajorVersion()
{
- string naclAddinVersion = "missing";
- foreach (AddIn addin in dte_.AddIns)
- {
- if (addin.Name.Equals(Strings.AddInName))
- {
- string identifier = "Version: [";
- int start = addin.Description.IndexOf(identifier) + identifier.Length;
- int end = addin.Description.LastIndexOf(']');
- if (start >= 0 && end >= 0)
- {
- naclAddinVersion = addin.Description.Substring(start, end - start);
- break;
- }
- }
- }
-
- return naclAddinVersion;
+ Assembly assem = Assembly.GetExecutingAssembly();
+ AssemblyName assemName = assem.GetName();
+ return assemName.Version.Major;
}
/// <summary>

Powered by Google App Engine
This is Rietveld 408576698