/// <summary> /// Retrieves the version from the vsix manifest file and sets the same to the global collection /// </summary> private void SetDominoPackageVersion(Microsoft.Build.Evaluation.ProjectCollection globalcollection) { var versionRegex = new Regex("<Identity\\s*" + "Id=\"(?<GUID>.*)\"\\s*" + "Version=\"(?<VERSION>.*)\"\\s*" + "Language=\"en-US\"\\s*" + "Publisher=\"Microsoft\"\\s*/>"); string source_extension = null; using (var sr = new StreamReader(Assembly.GetExecutingAssembly().GetManifestResourceStream("BuildXL.VsPackage.source.extension.vsixmanifest"))) { source_extension = sr.ReadToEnd(); } var match = versionRegex.Match(source_extension); if (!match.Success) { OutputMessage(Strings.IncorrectManifestFile); return; } // Ensure that the same version number is mentioned in source.extension.vsixmanifest and Support\BuildXL.Task.targets var version = match.Groups["VERSION"].Value.Trim(); globalcollection.SetGlobalProperty(Constants.DominoPackageVersion, version); }
void UpdateMSBuildProperties() { var dict = new Dictionary <string, string>(); MSBuildInternals.AddMSBuildSolutionProperties(this, dict); foreach (var pair in dict) { msBuildProjectCollection.SetGlobalProperty(pair.Key, pair.Value); } }