├── .gitignore ├── .nuget ├── NuGet.Config ├── NuGet.exe └── NuGet.targets ├── Core ├── Core.csproj ├── Properties │ └── AssemblyInfo.cs ├── Resources │ ├── Key.snk │ └── NuProj.ico └── VersionSource.cs ├── Install ├── Install.wixproj └── NuBuild.wxs ├── MSBuild ├── Config │ ├── NuBuild.targets │ └── NuBuild.tasks └── Tasks │ ├── NuPackage.cs │ ├── NuPrepare.cs │ ├── NuProjectResultResolver.cs │ ├── Properties │ └── AssemblyInfo.cs │ ├── Tasks.csproj │ ├── Utility │ └── AssemblyReader.cs │ └── packages.config ├── Mpf ├── AssemblyReferenceNode.cs ├── Attributes.cs ├── Automation │ ├── AutomationScope.cs │ ├── OAFileItem.cs │ ├── OAFolderItem.cs │ ├── OANavigableProjectItems.cs │ ├── OANestedProjectItem.cs │ ├── OANullProperty.cs │ ├── OAProject.cs │ ├── OAProjectItem.cs │ ├── OAProjectItems.cs │ ├── OAProperties.cs │ ├── OAProperty.cs │ ├── OAReferenceFolderItem.cs │ ├── OAReferenceItem.cs │ ├── OASolutionFolder.cs │ └── VSProject │ │ ├── OAAssemblyReference.cs │ │ ├── OABuildManager.cs │ │ ├── OAComReference.cs │ │ ├── OAProjectReference.cs │ │ ├── OAReferenceBase.cs │ │ ├── OAReferences.cs │ │ ├── OAVSProject.cs │ │ └── OAVSProjectItem.cs ├── BuildDependency.cs ├── BuildPropertyPage.cs ├── BuildStatus.cs ├── ComReferenceNode.cs ├── ConfigProvider.cs ├── ConfigurationProperties.cs ├── DataObject.cs ├── DependentFileNode.cs ├── DesignPropertyDescriptor.cs ├── DesignTimeAssemblyResolution.cs ├── Diagrams │ ├── AutomationClasses.cd │ ├── ConfigurationClasses.cd │ ├── DocumentManagerClasses.cd │ ├── HierarchyClasses.cd │ ├── PropertiesClasses.cd │ └── ReferenceClasses.cd ├── DocumentManager.cs ├── EnumDependencies.cs ├── FileChangeManager.cs ├── FileDocumentManager.cs ├── FileNode.cs ├── FolderNode.cs ├── GlobalSuppressions.cs ├── HierarchyNode.cs ├── IDEBuildLogger.cs ├── ImageHandler.cs ├── Interfaces.cs ├── Key.snk ├── LocalizableProperties.cs ├── MPFProjectAll.files ├── Misc │ ├── ConnectionPointContainer.cs │ ├── ExternDll.cs │ ├── NativeMethods.cs │ └── UnsafeNativeMethods.cs ├── Mpf.csproj ├── NestedProjectBuildDependency.cs ├── NestedProjectNode.cs ├── NodeProperties.cs ├── OleServiceProvider.cs ├── Output.cs ├── OutputGroup.cs ├── ProjectBase.files ├── ProjectConfig.cs ├── ProjectContainerNode.cs ├── ProjectDesignerDocumentManager.cs ├── ProjectDocumentsListener.cs ├── ProjectElement.cs ├── ProjectFactory.cs ├── ProjectFileConstants.cs ├── ProjectNode.CopyPaste.cs ├── ProjectNode.Events.cs ├── ProjectNode.cs ├── ProjectOptions.cs ├── ProjectPackage.cs ├── ProjectReferenceNode.cs ├── Properties │ └── AssemblyInfo.cs ├── PropertiesEditorLauncher.cs ├── ReferenceContainerNode.cs ├── ReferenceNode.cs ├── RegisteredProjectType.cs ├── Resources │ └── imagelis.bmp ├── SelectionListener.cs ├── SettingsPage.cs ├── SingleFileGenerator.cs ├── SingleFileGeneratorFactory.cs ├── SolutionListener.cs ├── SolutionListenerForBuildDependencyUpdate.cs ├── SolutionListenerForProjectEvents.cs ├── SolutionListenerForProjectOpen.cs ├── SolutionListenerForProjectReferenceUpdate.cs ├── StructuresEnums.cs ├── SuspendFileChanges.cs ├── TokenProcessor.cs ├── Tracing.cs ├── TrackDocumentsHelper.cs ├── TypeConverters.cs ├── UIThread.cs ├── UpdateSolutionEventsListener.cs ├── Url.cs ├── Utilities.cs ├── VSShellUtilities.cs ├── VisualStudio.Project.cs ├── VisualStudio.Project.resx ├── VsCommands.cs └── WebProjectBase.Files ├── NewProj.png ├── NuBuild.png ├── NuBuild.sln ├── ProjProp.png ├── README.md ├── Samples ├── AutoVersion │ ├── Library │ │ ├── Class.cs │ │ ├── Library.csproj │ │ └── Properties │ │ │ └── AssemblyInfo.cs │ └── Package │ │ ├── Package.nuproj │ │ └── Package.nuspec ├── LibraryVersion │ └── Package │ │ ├── Package.nuproj │ │ └── Package.nuspec ├── MultiPackage │ ├── Library1 │ │ ├── Class.cs │ │ └── Library1.csproj │ ├── Library2 │ │ ├── Class.cs │ │ └── Library2.csproj │ ├── Library3 │ │ ├── Class.cs │ │ └── Library3.csproj │ └── Package │ │ ├── Package.nuproj │ │ ├── Package1.nuspec │ │ └── Package2.nuspec ├── NoReference │ └── Package │ │ ├── Package.nuproj │ │ ├── Package.nuspec │ │ └── test.txt ├── Pcl │ ├── Library │ │ ├── Class.cs │ │ ├── Library.csproj │ │ └── Properties │ │ │ └── AssemblyInfo.cs │ └── Package │ │ ├── Package.nuproj │ │ └── Package.nuspec ├── ReferenceVersion │ ├── Library │ │ ├── Class.cs │ │ ├── Library.csproj │ │ └── Properties │ │ │ └── AssemblyInfo.cs │ └── Package │ │ ├── Package.nuproj │ │ └── Package.nuspec ├── Replacements │ ├── Library │ │ ├── Class.cs │ │ ├── Library.csproj │ │ └── Properties │ │ │ └── AssemblyInfo.cs │ └── Package │ │ ├── Package.nuproj │ │ └── Package.nuspec ├── Samples.sln ├── Simple │ ├── Library │ │ ├── Class.cs │ │ └── Library.csproj │ └── Package │ │ ├── Package.nuproj │ │ └── Package.nuspec └── TfsVersion │ ├── Library │ ├── Class.cs │ ├── Library.csproj │ └── Properties │ │ └── AssemblyInfo.cs │ └── Package │ ├── Package.nuproj │ └── Package.nuspec ├── VS ├── ItemTemplate │ ├── ItemTemplate.csproj │ └── NuSpec │ │ ├── NuSpec.ico │ │ ├── NuSpec.nuspec │ │ └── NuSpec.vstemplate ├── Package │ ├── NuBuild │ │ ├── NuBuildFactory.cs │ │ ├── NuBuildNode.cs │ │ ├── NuBuildPackage.cs │ │ └── NuBuildPropertyPage.cs │ ├── Package.csproj │ ├── Properties │ │ └── AssemblyInfo.cs │ ├── Resources │ │ ├── Key.snk │ │ ├── NuBuild.vsct │ │ └── Package.resx │ ├── TypeConverters │ │ └── EnumDescriptionTypeConverter.cs │ └── source.extension.vsixmanifest └── ProjectTemplate │ ├── NuProj │ ├── NuProj.ico │ ├── NuProj.nuproj │ ├── NuProj.nuspec │ ├── NuProj.vstemplate │ └── NuSpec1.nuspec │ └── ProjectTemplate.csproj ├── Version.cs └── license.txt /.gitignore: -------------------------------------------------------------------------------- 1 | # Build Folders (you can keep bin if you'd like, to store dlls and pdbs) 2 | bin 3 | obj 4 | 5 | # mstest test results 6 | TestResults 7 | 8 | # Downloaded nuget packages. 9 | /Packages/ 10 | 11 | # user files 12 | *.user 13 | *.suo 14 | -------------------------------------------------------------------------------- /.nuget/NuGet.Config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /.nuget/NuGet.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/brentspell/NuBuild/d6b6088758eda10bd412eae8ce5bbed5b1cd3565/.nuget/NuGet.exe -------------------------------------------------------------------------------- /Core/Core.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | {DF1AC33F-7D8D-473C-AD88-2CA4EDAD3B70} 5 | Library 6 | NuBuild 7 | NuBuild.Core 8 | v4.0 9 | AnyCPU 10 | Properties 11 | 12 | 13 | ..\Bin\ 14 | 4 15 | true 16 | TRACE 17 | 18 | 19 | true 20 | full 21 | false 22 | $(DefineConstants);DEBUG 23 | 24 | 25 | pdbonly 26 | true 27 | 28 | 29 | true 30 | 31 | 32 | Resources\Key.snk 33 | 34 | 35 | Resources\NuProj.ico 36 | 37 | 38 | 39 | 40 | 41 | 42 | Properties\Version.cs 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | -------------------------------------------------------------------------------- /Core/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | //=========================================================================== 2 | // MODULE: AssemblyInfo.cs 3 | // PURPOSE: assembly configuration properties 4 | // 5 | // Copyright © 2012 6 | // Brent M. Spell. All rights reserved. 7 | // 8 | // This library is free software; you can redistribute it and/or modify it 9 | // under the terms of the GNU Lesser General Public License as published 10 | // by the Free Software Foundation; either version 3 of the License, or 11 | // (at your option) any later version. This library is distributed in the 12 | // hope that it will be useful, but WITHOUT ANY WARRANTY; without even the 13 | // implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 14 | // See the GNU Lesser General Public License for more details. You should 15 | // have received a copy of the GNU Lesser General Public License along with 16 | // this library; if not, write to 17 | // Free Software Foundation, Inc. 18 | // 51 Franklin Street, Fifth Floor 19 | // Boston, MA 02110-1301 USA 20 | //=========================================================================== 21 | // System References 22 | using System; 23 | using System.Reflection; 24 | using System.Runtime.CompilerServices; 25 | using System.Runtime.InteropServices; 26 | // Project References 27 | 28 | [assembly:Guid("DF1AC33F-7D8D-473C-AD88-2CA4EDAD3B70")] 29 | [assembly:AssemblyProduct("NuGet Project System")] 30 | [assembly:AssemblyTitle("NuGet Project System Core Library")] 31 | [assembly:AssemblyCompany("Brent M. Spell")] 32 | [assembly:AssemblyCopyright("Copyright © 2012 Brent M. Spell. All Rights Reserved.")] 33 | [assembly:CLSCompliant(false)] 34 | [assembly:ComVisible(false)] 35 | #if DEBUG 36 | [assembly:AssemblyConfiguration("Debug")] 37 | #else 38 | [assembly:AssemblyConfiguration("Release")] 39 | #endif 40 | -------------------------------------------------------------------------------- /Core/Resources/Key.snk: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/brentspell/NuBuild/d6b6088758eda10bd412eae8ce5bbed5b1cd3565/Core/Resources/Key.snk -------------------------------------------------------------------------------- /Core/Resources/NuProj.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/brentspell/NuBuild/d6b6088758eda10bd412eae8ce5bbed5b1cd3565/Core/Resources/NuProj.ico -------------------------------------------------------------------------------- /Core/VersionSource.cs: -------------------------------------------------------------------------------- 1 | //=========================================================================== 2 | // MODULE: VersionSource.cs 3 | // PURPOSE: NuBuild package version source enumeration 4 | // 5 | // Copyright © 2012 6 | // Brent M. Spell. All rights reserved. 7 | // 8 | // This library is free software; you can redistribute it and/or modify it 9 | // under the terms of the GNU Lesser General Public License as published 10 | // by the Free Software Foundation; either version 3 of the License, or 11 | // (at your option) any later version. This library is distributed in the 12 | // hope that it will be useful, but WITHOUT ANY WARRANTY; without even the 13 | // implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 14 | // See the GNU Lesser General Public License for more details. You should 15 | // have received a copy of the GNU Lesser General Public License along with 16 | // this library; if not, write to 17 | // Free Software Foundation, Inc. 18 | // 51 Franklin Street, Fifth Floor 19 | // Boston, MA 02110-1301 USA 20 | //=========================================================================== 21 | // System References 22 | using System; 23 | using System.ComponentModel; 24 | // Project References 25 | 26 | namespace NuBuild 27 | { 28 | /// 29 | /// Package version generation source 30 | /// 31 | public enum VersionSource 32 | { 33 | Manual, // don't generate package versions 34 | Library, // generate package version from a package DLL 35 | Auto // generate build number from file on disk or $(BuildNumber) 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /Install/Install.wixproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | {45B0F49D-351E-4C1F-A1C0-4EB943EE53D2} 5 | Package 6 | NuBuild 7 | ..\Bin\ 8 | ..\Bin\ 9 | obj\$(Platform)\$(Configuration)\ 10 | true 11 | ICE61 12 | True 13 | 14 | 15 | Debug 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | $(WixExtDir)\WixVSExtension.dll 25 | WixVSExtension 26 | 27 | 28 | 29 | -------------------------------------------------------------------------------- /MSBuild/Config/NuBuild.tasks: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /MSBuild/Tasks/NuProjectResultResolver.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.Build.Framework; 2 | using Microsoft.Build.Utilities; 3 | using System; 4 | using System.Collections.Generic; 5 | using System.IO; 6 | using System.Linq; 7 | using System.Text; 8 | using System.Xml.Linq; 9 | 10 | namespace NuBuild.MSBuild 11 | { 12 | public sealed class NuProjectResultResolver : Task 13 | { 14 | private List lstOutputs = new List(); 15 | 16 | [Output] 17 | public ITaskItem[] TargetOutputs { get; set; } 18 | 19 | [Required] 20 | public ITaskItem[] Projects { get; set; } 21 | 22 | [Required] 23 | public string Configuration { get; set; } 24 | [Required] 25 | public string Platform { get; set; } 26 | 27 | public override bool Execute() 28 | { 29 | if (Projects == null) 30 | { 31 | TargetOutputs = new ITaskItem[0]; 32 | return false; 33 | } 34 | 35 | foreach (ITaskItem project in Projects) 36 | { 37 | string compiledFile = GetCompiledFile(project.ItemSpec, Configuration, Platform); 38 | lstOutputs.Add(new TaskItem(compiledFile)); 39 | } 40 | 41 | TargetOutputs = lstOutputs.ToArray(); 42 | return true; 43 | } 44 | 45 | private string GetCompiledFile(string prjFile, string configuration, string platform) 46 | { 47 | XNamespace ns = @"http://schemas.microsoft.com/developer/msbuild/2003"; 48 | XDocument doc = XDocument.Load(prjFile); 49 | //OutputType 50 | string outputType = doc.Root.Descendants(ns + "OutputType").First().Value; 51 | //AssemblyName 52 | string assemblyName = doc.Root.Descendants(ns + "AssemblyName").First().Value; 53 | //OutputPath 54 | string outputPath = string.Empty; 55 | foreach (var item in doc.Root.Elements(ns + "PropertyGroup")) 56 | { 57 | if (item.HasAttributes && !string.IsNullOrWhiteSpace(item.Attribute("Condition").Value)) 58 | { 59 | string conditionAttribute = item.Attribute("Condition").Value; 60 | if (conditionAttribute.Contains(configuration + @"|" + platform)) 61 | { 62 | outputPath = item.Element(ns + "OutputPath").Value; 63 | break; 64 | } 65 | } 66 | } 67 | 68 | string fileExt = GetOutputTypeExtension(outputType); 69 | 70 | string compiledProject = Path.Combine(Path.GetDirectoryName(prjFile), outputPath, assemblyName + fileExt); 71 | 72 | 73 | return compiledProject; 74 | } 75 | 76 | private string GetOutputTypeExtension(string outputType) 77 | { 78 | if (outputType.ToUpper() == @"Library".ToUpper()) 79 | return ".dll"; 80 | if (outputType.ToUpper() == @"Exe".ToUpper()) 81 | return ".exe"; 82 | if (outputType.ToUpper() == @"WinExe".ToUpper()) 83 | return ".exe"; 84 | 85 | return string.Empty; 86 | } 87 | } 88 | } 89 | -------------------------------------------------------------------------------- /MSBuild/Tasks/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | //=========================================================================== 2 | // MODULE: AssemblyInfo.cs 3 | // PURPOSE: assembly configuration properties 4 | // 5 | // Copyright © 2012 6 | // Brent M. Spell. All rights reserved. 7 | // 8 | // This library is free software; you can redistribute it and/or modify it 9 | // under the terms of the GNU Lesser General Public License as published 10 | // by the Free Software Foundation; either version 3 of the License, or 11 | // (at your option) any later version. This library is distributed in the 12 | // hope that it will be useful, but WITHOUT ANY WARRANTY; without even the 13 | // implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 14 | // See the GNU Lesser General Public License for more details. You should 15 | // have received a copy of the GNU Lesser General Public License along with 16 | // this library; if not, write to 17 | // Free Software Foundation, Inc. 18 | // 51 Franklin Street, Fifth Floor 19 | // Boston, MA 02110-1301 USA 20 | //=========================================================================== 21 | // System References 22 | using System; 23 | using System.Reflection; 24 | using System.Runtime.CompilerServices; 25 | using System.Runtime.InteropServices; 26 | // Project References 27 | 28 | [assembly:Guid("A0B266F8-F6A5-4A13-9403-F2E07B963F21")] 29 | [assembly:AssemblyProduct("NuGet Project System")] 30 | [assembly:AssemblyTitle("NuGet Project System MSBuild Task Library")] 31 | [assembly:AssemblyCompany("Brent M. Spell")] 32 | [assembly:AssemblyCopyright("Copyright © 2012 Brent M. Spell. All Rights Reserved.")] 33 | [assembly:CLSCompliant(false)] 34 | [assembly:ComVisible(false)] 35 | #if DEBUG 36 | [assembly:AssemblyConfiguration("Debug")] 37 | #else 38 | [assembly:AssemblyConfiguration("Release")] 39 | #endif 40 | -------------------------------------------------------------------------------- /MSBuild/Tasks/Tasks.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | {A0B266F8-F6A5-4A13-9403-F2E07B963F21} 5 | Library 6 | NuBuild.MSBuild 7 | NuBuild.MSBuild.Tasks 8 | v4.0 9 | AnyCPU 10 | Properties 11 | ..\..\ 12 | true 13 | 14 | 15 | ..\..\Bin\ 16 | 4 17 | true 18 | 19 | 20 | 21 | 22 | true 23 | full 24 | false 25 | $(DefineConstants);DEBUG 26 | 27 | 28 | pdbonly 29 | true 30 | 31 | 32 | 33 | 34 | 35 | 36 | ..\..\packages\Microsoft.Web.Xdt.1.0.0\lib\net40\Microsoft.Web.XmlTransform.dll 37 | 38 | 39 | False 40 | ..\..\packages\Nuget.Core.2.8.0\lib\net40-Client\NuGet.Core.dll 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | Properties\Version.cs 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | {DF1AC33F-7D8D-473C-AD88-2CA4EDAD3B70} 59 | Core 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | -------------------------------------------------------------------------------- /MSBuild/Tasks/packages.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /Mpf/Attributes.cs: -------------------------------------------------------------------------------- 1 | /*************************************************************************** 2 | 3 | Copyright (c) Microsoft Corporation. All rights reserved. 4 | This code is licensed under the Visual Studio SDK license terms. 5 | THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF 6 | ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY 7 | IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR 8 | PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT. 9 | 10 | ***************************************************************************/ 11 | 12 | using System; 13 | using System.ComponentModel; 14 | using System.Diagnostics; 15 | using System.Globalization; 16 | 17 | namespace Microsoft.VisualStudio.Project 18 | { 19 | /// 20 | /// Defines a type converter. 21 | /// 22 | /// This is needed to get rid of the type TypeConverter type that could not give back the Type we were passing to him. 23 | /// We do not want to use reflection to get the type back from the ConverterTypeName. Also the GetType methos does not spwan converters from other assemblies. 24 | [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1019:DefineAccessorsForAttributeArguments"), AttributeUsage(AttributeTargets.Class | AttributeTargets.Enum | AttributeTargets.Property | AttributeTargets.Field)] 25 | public sealed class PropertyPageTypeConverterAttribute : Attribute 26 | { 27 | #region fields 28 | Type converterType; 29 | #endregion 30 | 31 | #region ctors 32 | public PropertyPageTypeConverterAttribute(Type type) 33 | { 34 | this.converterType = type; 35 | } 36 | #endregion 37 | 38 | #region properties 39 | public Type ConverterType 40 | { 41 | get 42 | { 43 | return this.converterType; 44 | } 45 | } 46 | #endregion 47 | } 48 | 49 | [AttributeUsage(AttributeTargets.Class | AttributeTargets.Property | AttributeTargets.Field, Inherited = false, AllowMultiple = false)] 50 | internal sealed class LocDisplayNameAttribute : DisplayNameAttribute 51 | { 52 | #region fields 53 | string name; 54 | #endregion 55 | 56 | #region ctors 57 | public LocDisplayNameAttribute(string name) 58 | { 59 | this.name = name; 60 | } 61 | #endregion 62 | 63 | #region properties 64 | public override string DisplayName 65 | { 66 | get 67 | { 68 | string result = SR.GetString(this.name, CultureInfo.CurrentUICulture); 69 | if(result == null) 70 | { 71 | Debug.Assert(false, "String resource '" + this.name + "' is missing"); 72 | result = this.name; 73 | } 74 | return result; 75 | } 76 | } 77 | #endregion 78 | } 79 | } 80 | -------------------------------------------------------------------------------- /Mpf/Automation/AutomationScope.cs: -------------------------------------------------------------------------------- 1 | /*************************************************************************** 2 | 3 | Copyright (c) Microsoft Corporation. All rights reserved. 4 | This code is licensed under the Visual Studio SDK license terms. 5 | THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF 6 | ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY 7 | IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR 8 | PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT. 9 | 10 | ***************************************************************************/ 11 | 12 | using System; 13 | using Microsoft.VisualStudio.Shell.Interop; 14 | using ErrorHandler = Microsoft.VisualStudio.ErrorHandler; 15 | 16 | namespace Microsoft.VisualStudio.Project.Automation 17 | { 18 | /// 19 | /// Helper class that handle the scope of an automation function. 20 | /// It should be used inside a "using" directive to define the scope of the 21 | /// automation function and make sure that the ExitAutomation method is called. 22 | /// 23 | internal class AutomationScope : IDisposable 24 | { 25 | private IVsExtensibility3 extensibility; 26 | private bool inAutomation; 27 | private static volatile object Mutex; 28 | private bool isDisposed; 29 | 30 | /// 31 | /// Initializes the class. 32 | /// 33 | [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Performance", "CA1810:InitializeReferenceTypeStaticFieldsInline")] 34 | static AutomationScope() 35 | { 36 | Mutex = new object(); 37 | } 38 | 39 | /// 40 | /// Defines the beginning of the scope of an automation function. This constuctor 41 | /// calls EnterAutomationFunction to signal the Shell that the current function is 42 | /// changing the status of the automation objects. 43 | /// 44 | public AutomationScope(IServiceProvider provider) 45 | { 46 | if(null == provider) 47 | { 48 | throw new ArgumentNullException("provider"); 49 | } 50 | extensibility = provider.GetService(typeof(EnvDTE.IVsExtensibility)) as IVsExtensibility3; 51 | if(null == extensibility) 52 | { 53 | throw new InvalidOperationException(); 54 | } 55 | ErrorHandler.ThrowOnFailure(extensibility.EnterAutomationFunction()); 56 | inAutomation = true; 57 | } 58 | 59 | /// 60 | /// Ends the scope of the automation function. This function is also called by the 61 | /// Dispose method. 62 | /// 63 | public void ExitAutomation() 64 | { 65 | if(inAutomation) 66 | { 67 | ErrorHandler.ThrowOnFailure(extensibility.ExitAutomationFunction()); 68 | inAutomation = false; 69 | } 70 | } 71 | 72 | /// 73 | /// Gets the IVsExtensibility3 interface used in the automation function. 74 | /// 75 | public IVsExtensibility3 Extensibility 76 | { 77 | get { return extensibility; } 78 | } 79 | 80 | /// 81 | /// Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources. 82 | /// 83 | public void Dispose() 84 | { 85 | this.Dispose(true); 86 | GC.SuppressFinalize(this); 87 | } 88 | 89 | #region IDisposable Members 90 | private void Dispose(bool disposing) 91 | { 92 | if(!this.isDisposed) 93 | { 94 | lock(Mutex) 95 | { 96 | if(disposing) 97 | { 98 | ExitAutomation(); 99 | } 100 | 101 | this.isDisposed = true; 102 | } 103 | } 104 | } 105 | #endregion 106 | } 107 | } 108 | -------------------------------------------------------------------------------- /Mpf/Automation/OAFolderItem.cs: -------------------------------------------------------------------------------- 1 | /*************************************************************************** 2 | 3 | Copyright (c) Microsoft Corporation. All rights reserved. 4 | This code is licensed under the Visual Studio SDK license terms. 5 | THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF 6 | ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY 7 | IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR 8 | PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT. 9 | 10 | ***************************************************************************/ 11 | 12 | using System; 13 | using System.Diagnostics.CodeAnalysis; 14 | using System.Runtime.InteropServices; 15 | using EnvDTE; 16 | 17 | namespace Microsoft.VisualStudio.Project.Automation 18 | { 19 | /// 20 | /// Represents an automation object for a folder in a project 21 | /// 22 | [SuppressMessage("Microsoft.Interoperability", "CA1405:ComVisibleTypeBaseTypesShouldBeComVisible")] 23 | [ComVisible(true), CLSCompliant(false)] 24 | public class OAFolderItem : OAProjectItem 25 | { 26 | #region ctors 27 | public OAFolderItem(OAProject project, FolderNode node) 28 | : base(project, node) 29 | { 30 | } 31 | 32 | #endregion 33 | 34 | #region overridden methods 35 | public override ProjectItems Collection 36 | { 37 | get 38 | { 39 | ProjectItems items = new OAProjectItems(this.Project, this.Node); 40 | return items; 41 | } 42 | } 43 | 44 | public override ProjectItems ProjectItems 45 | { 46 | get 47 | { 48 | return this.Collection; 49 | } 50 | } 51 | #endregion 52 | } 53 | } 54 | -------------------------------------------------------------------------------- /Mpf/Automation/OANestedProjectItem.cs: -------------------------------------------------------------------------------- 1 | /*************************************************************************** 2 | 3 | Copyright (c) Microsoft Corporation. All rights reserved. 4 | This code is licensed under the Visual Studio SDK license terms. 5 | THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF 6 | ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY 7 | IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR 8 | PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT. 9 | 10 | ***************************************************************************/ 11 | 12 | using System; 13 | using System.Diagnostics.CodeAnalysis; 14 | using System.Runtime.InteropServices; 15 | using Microsoft.VisualStudio; 16 | using Microsoft.VisualStudio.Shell.Interop; 17 | 18 | namespace Microsoft.VisualStudio.Project.Automation 19 | { 20 | [SuppressMessage("Microsoft.Interoperability", "CA1405:ComVisibleTypeBaseTypesShouldBeComVisible")] 21 | [ComVisible(true), CLSCompliant(false)] 22 | public class OANestedProjectItem : OAProjectItem 23 | { 24 | #region fields 25 | EnvDTE.Project nestedProject; 26 | #endregion 27 | 28 | #region ctors 29 | public OANestedProjectItem(OAProject project, NestedProjectNode node) 30 | : base(project, node) 31 | { 32 | if (node == null) 33 | { 34 | throw new ArgumentNullException("node"); 35 | } 36 | 37 | object nestedproject; 38 | if(ErrorHandler.Succeeded(node.NestedHierarchy.GetProperty(VSConstants.VSITEMID_ROOT, (int)__VSHPROPID.VSHPROPID_ExtObject, out nestedproject))) 39 | { 40 | this.nestedProject = nestedproject as EnvDTE.Project; 41 | } 42 | } 43 | 44 | #endregion 45 | 46 | #region overridden methods 47 | /// 48 | /// Returns the collection of project items defined in the nested project 49 | /// 50 | public override EnvDTE.ProjectItems ProjectItems 51 | { 52 | get 53 | { 54 | if(this.nestedProject != null) 55 | { 56 | return this.nestedProject.ProjectItems; 57 | } 58 | return null; 59 | } 60 | } 61 | 62 | /// 63 | /// Returns the nested project. 64 | /// 65 | public override EnvDTE.Project SubProject 66 | { 67 | get 68 | { 69 | return this.nestedProject; 70 | } 71 | } 72 | #endregion 73 | } 74 | } 75 | -------------------------------------------------------------------------------- /Mpf/Automation/OANullProperty.cs: -------------------------------------------------------------------------------- 1 | /*************************************************************************** 2 | 3 | Copyright (c) Microsoft Corporation. All rights reserved. 4 | This code is licensed under the Visual Studio SDK license terms. 5 | THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF 6 | ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY 7 | IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR 8 | PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT. 9 | 10 | ***************************************************************************/ 11 | 12 | using System; 13 | using System.Runtime.InteropServices; 14 | 15 | namespace Microsoft.VisualStudio.Project.Automation 16 | { 17 | /// 18 | /// This object defines a so called null object that is returned as instead of null. This is because callers in VSCore usually crash if a null propery is returned for them. 19 | /// 20 | [CLSCompliant(false), ComVisible(true)] 21 | public class OANullProperty : EnvDTE.Property 22 | { 23 | #region fields 24 | private OAProperties parent; 25 | #endregion 26 | 27 | #region ctors 28 | 29 | public OANullProperty(OAProperties parent) 30 | { 31 | this.parent = parent; 32 | } 33 | #endregion 34 | 35 | #region EnvDTE.Property 36 | 37 | public object Application 38 | { 39 | get { return String.Empty; } 40 | } 41 | 42 | public EnvDTE.Properties Collection 43 | { 44 | get 45 | { 46 | //todo: EnvDTE.Property.Collection 47 | return this.parent; 48 | } 49 | } 50 | 51 | public EnvDTE.DTE DTE 52 | { 53 | get { return null; } 54 | } 55 | 56 | public object get_IndexedValue(object index1, object index2, object index3, object index4) 57 | { 58 | return String.Empty; 59 | } 60 | 61 | public void let_Value(object value) 62 | { 63 | //todo: let_Value 64 | } 65 | 66 | public string Name 67 | { 68 | get { return String.Empty; } 69 | } 70 | 71 | public short NumIndices 72 | { 73 | get { return 0; } 74 | } 75 | 76 | public object Object 77 | { 78 | get { return this.parent.Target; } 79 | set 80 | { 81 | } 82 | } 83 | 84 | public EnvDTE.Properties Parent 85 | { 86 | get { return this.parent; } 87 | } 88 | 89 | public void set_IndexedValue(object index1, object index2, object index3, object index4, object value) 90 | { 91 | 92 | } 93 | 94 | public object Value 95 | { 96 | get { return String.Empty; } 97 | set { } 98 | } 99 | #endregion 100 | } 101 | } 102 | -------------------------------------------------------------------------------- /Mpf/Automation/OAProject.cs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/brentspell/NuBuild/d6b6088758eda10bd412eae8ce5bbed5b1cd3565/Mpf/Automation/OAProject.cs -------------------------------------------------------------------------------- /Mpf/Automation/OAReferenceFolderItem.cs: -------------------------------------------------------------------------------- 1 | /*************************************************************************** 2 | 3 | Copyright (c) Microsoft Corporation. All rights reserved. 4 | This code is licensed under the Visual Studio SDK license terms. 5 | THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF 6 | ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY 7 | IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR 8 | PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT. 9 | 10 | ***************************************************************************/ 11 | 12 | using System; 13 | using System.Collections.Generic; 14 | using System.Diagnostics.CodeAnalysis; 15 | using System.Runtime.InteropServices; 16 | 17 | namespace Microsoft.VisualStudio.Project.Automation 18 | { 19 | /// 20 | /// Contains OAReferenceItem objects 21 | /// 22 | [SuppressMessage("Microsoft.Interoperability", "CA1405:ComVisibleTypeBaseTypesShouldBeComVisible")] 23 | [ComVisible(true), CLSCompliant(false)] 24 | public class OAReferenceFolderItem : OAProjectItem 25 | { 26 | #region ctors 27 | public OAReferenceFolderItem(OAProject project, ReferenceContainerNode node) 28 | : base(project, node) 29 | { 30 | } 31 | 32 | #endregion 33 | 34 | #region overridden methods 35 | /// 36 | /// Returns the project items collection of all the references defined for this project. 37 | /// 38 | public override EnvDTE.ProjectItems ProjectItems 39 | { 40 | get 41 | { 42 | return new OANavigableProjectItems(this.Project, this.GetListOfProjectItems(), this.Node); 43 | } 44 | } 45 | 46 | 47 | #endregion 48 | 49 | #region Helper methods 50 | private List GetListOfProjectItems() 51 | { 52 | List list = new List(); 53 | for(HierarchyNode child = this.Node.FirstChild; child != null; child = child.NextSibling) 54 | { 55 | ReferenceNode node = child as ReferenceNode; 56 | 57 | if(node != null) 58 | { 59 | list.Add(new OAReferenceItem(this.Project, node)); 60 | } 61 | } 62 | 63 | return list; 64 | } 65 | #endregion 66 | } 67 | } 68 | -------------------------------------------------------------------------------- /Mpf/Automation/OAReferenceItem.cs: -------------------------------------------------------------------------------- 1 | /*************************************************************************** 2 | 3 | Copyright (c) Microsoft Corporation. All rights reserved. 4 | This code is licensed under the Visual Studio SDK license terms. 5 | THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF 6 | ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY 7 | IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR 8 | PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT. 9 | 10 | ***************************************************************************/ 11 | 12 | using System; 13 | using System.Diagnostics; 14 | using System.Diagnostics.CodeAnalysis; 15 | using System.Runtime.InteropServices; 16 | 17 | namespace Microsoft.VisualStudio.Project.Automation 18 | { 19 | /// 20 | /// Represents the automation object equivalent to a ReferenceNode object 21 | /// 22 | [SuppressMessage("Microsoft.Interoperability", "CA1405:ComVisibleTypeBaseTypesShouldBeComVisible")] 23 | [ComVisible(true), CLSCompliant(false)] 24 | public class OAReferenceItem : OAProjectItem 25 | { 26 | #region ctors 27 | public OAReferenceItem(OAProject project, ReferenceNode node) 28 | : base(project, node) 29 | { 30 | } 31 | 32 | #endregion 33 | 34 | #region overridden methods 35 | /// 36 | /// Not implemented. If called throws invalid operation exception. 37 | /// 38 | public override void Delete() 39 | { 40 | throw new InvalidOperationException(); 41 | } 42 | 43 | 44 | /// 45 | /// Not implemented. If called throws invalid operation exception. 46 | /// 47 | /// A Constants. vsViewKind indicating the type of view to use. 48 | /// 49 | public override EnvDTE.Window Open(string viewKind) 50 | { 51 | throw new InvalidOperationException(); 52 | } 53 | 54 | /// 55 | /// Gets or sets the name of the object. 56 | /// 57 | public override string Name 58 | { 59 | get 60 | { 61 | return base.Name; 62 | } 63 | set 64 | { 65 | throw new InvalidOperationException(); 66 | } 67 | } 68 | 69 | /// 70 | /// Gets the ProjectItems collection containing the ProjectItem object supporting this property. 71 | /// 72 | public override EnvDTE.ProjectItems Collection 73 | { 74 | get 75 | { 76 | // Get the parent node (ReferenceContainerNode) 77 | ReferenceContainerNode parentNode = this.Node.Parent as ReferenceContainerNode; 78 | Debug.Assert(parentNode != null, "Failed to get the parent node"); 79 | 80 | // Get the ProjectItems object for the parent node 81 | if(parentNode != null) 82 | { 83 | // The root node for the project 84 | return ((OAReferenceFolderItem)parentNode.GetAutomationObject()).ProjectItems; 85 | } 86 | 87 | return null; 88 | } 89 | } 90 | #endregion 91 | } 92 | } 93 | -------------------------------------------------------------------------------- /Mpf/Automation/OASolutionFolder.cs: -------------------------------------------------------------------------------- 1 | /*************************************************************************** 2 | 3 | Copyright (c) Microsoft Corporation. All rights reserved. 4 | This code is licensed under the Visual Studio SDK license terms. 5 | THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF 6 | ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY 7 | IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR 8 | PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT. 9 | 10 | ***************************************************************************/ 11 | 12 | using System; 13 | using System.Diagnostics; 14 | using System.Globalization; 15 | using System.Runtime.InteropServices; 16 | using Microsoft.VisualStudio; 17 | using Microsoft.VisualStudio.Shell.Interop; 18 | 19 | namespace Microsoft.VisualStudio.Project.Automation 20 | { 21 | [ComVisible(true), CLSCompliant(false)] 22 | public class OASolutionFolder : EnvDTE80.SolutionFolder 23 | where T : HierarchyNode 24 | { 25 | bool hidden = false; 26 | T node; 27 | 28 | public OASolutionFolder(T associatedNode) 29 | { 30 | if(associatedNode == null) 31 | { 32 | throw new ArgumentNullException("associatedNode"); 33 | } 34 | 35 | Debug.Assert(associatedNode.ProjectMgr is ProjectContainerNode, "Expecting obejct of type" + typeof(ProjectContainerNode).Name); 36 | 37 | if(!(associatedNode.ProjectMgr is ProjectContainerNode)) 38 | throw new ArgumentException(SR.GetString(SR.InvalidParameter, CultureInfo.CurrentUICulture), "associatedNode"); 39 | 40 | this.node = associatedNode; 41 | } 42 | 43 | 44 | #region SolutionFolder Members 45 | 46 | public virtual EnvDTE.Project AddFromFile(string fileName) 47 | { 48 | ProjectContainerNode projectContainer = (ProjectContainerNode)this.node.ProjectMgr; 49 | ProjectElement newElement = new ProjectElement(projectContainer, fileName, ProjectFileConstants.SubProject); 50 | NestedProjectNode newNode = projectContainer.AddExistingNestedProject(newElement, __VSCREATEPROJFLAGS.CPF_NOTINSLNEXPLR | __VSCREATEPROJFLAGS.CPF_SILENT | __VSCREATEPROJFLAGS.CPF_OPENFILE); 51 | if(newNode == null) 52 | return null; 53 | // Now that the sub project was created, get its extensibility object so we can return it 54 | object newProject = null; 55 | if(ErrorHandler.Succeeded(newNode.NestedHierarchy.GetProperty(VSConstants.VSITEMID_ROOT, (int)__VSHPROPID.VSHPROPID_ExtObject, out newProject))) 56 | return newProject as EnvDTE.Project; 57 | else 58 | return null; 59 | } 60 | 61 | public virtual EnvDTE.Project AddFromTemplate(string fileName, string destination, string projectName) 62 | { 63 | bool isVSTemplate = Utilities.IsTemplateFile(fileName); 64 | 65 | NestedProjectNode newNode = null; 66 | if(isVSTemplate) 67 | { 68 | // Get the wizard to run, we will get called again and use the alternate code path 69 | ProjectElement newElement = new ProjectElement(this.node.ProjectMgr, System.IO.Path.Combine(destination, projectName), ProjectFileConstants.SubProject); 70 | newElement.SetMetadata(ProjectFileConstants.Template, fileName); 71 | ((ProjectContainerNode)this.node.ProjectMgr).RunVsTemplateWizard(newElement, false); 72 | } 73 | else 74 | { 75 | if((String.IsNullOrEmpty(System.IO.Path.GetExtension(projectName)))) 76 | { 77 | string targetExtension = System.IO.Path.GetExtension(fileName); 78 | projectName = System.IO.Path.ChangeExtension(projectName, targetExtension); 79 | } 80 | 81 | ProjectContainerNode projectContainer = (ProjectContainerNode)this.node.ProjectMgr; 82 | newNode = projectContainer.AddNestedProjectFromTemplate(fileName, destination, projectName, null, __VSCREATEPROJFLAGS.CPF_NOTINSLNEXPLR | __VSCREATEPROJFLAGS.CPF_SILENT | __VSCREATEPROJFLAGS.CPF_CLONEFILE); 83 | } 84 | if(newNode == null) 85 | return null; 86 | 87 | // Now that the sub project was created, get its extensibility object so we can return it 88 | object newProject = null; 89 | if(ErrorHandler.Succeeded(newNode.NestedHierarchy.GetProperty(VSConstants.VSITEMID_ROOT, (int)__VSHPROPID.VSHPROPID_ExtObject, out newProject))) 90 | return newProject as EnvDTE.Project; 91 | else 92 | return null; 93 | } 94 | 95 | public virtual EnvDTE.Project AddSolutionFolder(string Name) 96 | { 97 | throw new NotImplementedException(); 98 | } 99 | 100 | public virtual EnvDTE.Project Parent 101 | { 102 | get 103 | { 104 | throw new NotImplementedException(); 105 | } 106 | } 107 | 108 | public virtual bool Hidden 109 | { 110 | get 111 | { 112 | return hidden; 113 | } 114 | set 115 | { 116 | hidden = value; 117 | } 118 | } 119 | 120 | public virtual EnvDTE.DTE DTE 121 | { 122 | get 123 | { 124 | return (EnvDTE.DTE)this.node.ProjectMgr.Site.GetService(typeof(EnvDTE.DTE)); 125 | } 126 | } 127 | 128 | #endregion 129 | } 130 | 131 | } 132 | -------------------------------------------------------------------------------- /Mpf/Automation/VSProject/OAAssemblyReference.cs: -------------------------------------------------------------------------------- 1 | /*************************************************************************** 2 | 3 | Copyright (c) Microsoft Corporation. All rights reserved. 4 | This code is licensed under the Visual Studio SDK license terms. 5 | THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF 6 | ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY 7 | IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR 8 | PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT. 9 | 10 | ***************************************************************************/ 11 | 12 | using System.Diagnostics.CodeAnalysis; 13 | using System.Reflection; 14 | using System.Runtime.InteropServices; 15 | using System.Text; 16 | using VSLangProj; 17 | 18 | namespace Microsoft.VisualStudio.Project.Automation 19 | { 20 | [SuppressMessage("Microsoft.Interoperability", "CA1405:ComVisibleTypeBaseTypesShouldBeComVisible")] 21 | [ComVisible(true)] 22 | public class OAAssemblyReference : OAReferenceBase 23 | { 24 | public OAAssemblyReference(AssemblyReferenceNode assemblyReference) : 25 | base(assemblyReference) 26 | { 27 | } 28 | 29 | #region Reference override 30 | public override int BuildNumber 31 | { 32 | get 33 | { 34 | if((null == BaseReferenceNode.ResolvedAssembly) || 35 | (null == BaseReferenceNode.ResolvedAssembly.Version)) 36 | { 37 | return 0; 38 | } 39 | return BaseReferenceNode.ResolvedAssembly.Version.Build; 40 | } 41 | } 42 | public override string Culture 43 | { 44 | get 45 | { 46 | if((null == BaseReferenceNode.ResolvedAssembly) || 47 | (null == BaseReferenceNode.ResolvedAssembly.CultureInfo)) 48 | { 49 | return string.Empty; 50 | } 51 | return BaseReferenceNode.ResolvedAssembly.CultureInfo.Name; 52 | } 53 | } 54 | public override string Identity 55 | { 56 | get 57 | { 58 | // Note that in this function we use the assembly name instead of the resolved one 59 | // because the identity of this reference is the assembly name needed by the project, 60 | // not the specific instance found in this machine / environment. 61 | if(null == BaseReferenceNode.AssemblyName) 62 | { 63 | return null; 64 | } 65 | return BaseReferenceNode.AssemblyName.FullName; 66 | } 67 | } 68 | public override int MajorVersion 69 | { 70 | get 71 | { 72 | if((null == BaseReferenceNode.ResolvedAssembly) || 73 | (null == BaseReferenceNode.ResolvedAssembly.Version)) 74 | { 75 | return 0; 76 | } 77 | return BaseReferenceNode.ResolvedAssembly.Version.Major; 78 | } 79 | } 80 | public override int MinorVersion 81 | { 82 | get 83 | { 84 | if((null == BaseReferenceNode.ResolvedAssembly) || 85 | (null == BaseReferenceNode.ResolvedAssembly.Version)) 86 | { 87 | return 0; 88 | } 89 | return BaseReferenceNode.ResolvedAssembly.Version.Minor; 90 | } 91 | } 92 | 93 | public override string PublicKeyToken 94 | { 95 | get 96 | { 97 | if((null == BaseReferenceNode.ResolvedAssembly) || 98 | (null == BaseReferenceNode.ResolvedAssembly.GetPublicKeyToken())) 99 | { 100 | return null; 101 | } 102 | StringBuilder builder = new StringBuilder(); 103 | byte[] publicKeyToken = BaseReferenceNode.ResolvedAssembly.GetPublicKeyToken(); 104 | for(int i = 0; i < publicKeyToken.Length; i++) 105 | { 106 | builder.AppendFormat("{0:x}", publicKeyToken[i]); 107 | } 108 | return builder.ToString(); 109 | } 110 | } 111 | 112 | public override string Name 113 | { 114 | get 115 | { 116 | if(null != BaseReferenceNode.ResolvedAssembly) 117 | { 118 | return BaseReferenceNode.ResolvedAssembly.Name; 119 | } 120 | if(null != BaseReferenceNode.AssemblyName) 121 | { 122 | return BaseReferenceNode.AssemblyName.Name; 123 | } 124 | return null; 125 | } 126 | } 127 | public override int RevisionNumber 128 | { 129 | get 130 | { 131 | if((null == BaseReferenceNode.ResolvedAssembly) || 132 | (null == BaseReferenceNode.ResolvedAssembly.Version)) 133 | { 134 | return 0; 135 | } 136 | return BaseReferenceNode.ResolvedAssembly.Version.Revision; 137 | } 138 | } 139 | public override bool StrongName 140 | { 141 | get 142 | { 143 | if((null == BaseReferenceNode.ResolvedAssembly) || 144 | (0 == (BaseReferenceNode.ResolvedAssembly.Flags & AssemblyNameFlags.PublicKey))) 145 | { 146 | return false; 147 | } 148 | return true; 149 | } 150 | } 151 | public override prjReferenceType Type 152 | { 153 | get 154 | { 155 | return prjReferenceType.prjReferenceTypeAssembly; 156 | } 157 | } 158 | public override string Version 159 | { 160 | get 161 | { 162 | if((null == BaseReferenceNode.ResolvedAssembly) || 163 | (null == BaseReferenceNode.ResolvedAssembly.Version)) 164 | { 165 | return string.Empty; 166 | } 167 | return BaseReferenceNode.ResolvedAssembly.Version.ToString(); 168 | } 169 | } 170 | #endregion 171 | } 172 | } 173 | -------------------------------------------------------------------------------- /Mpf/Automation/VSProject/OABuildManager.cs: -------------------------------------------------------------------------------- 1 | /*************************************************************************** 2 | 3 | Copyright (c) Microsoft Corporation. All rights reserved. 4 | This code is licensed under the Visual Studio SDK license terms. 5 | THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF 6 | ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY 7 | IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR 8 | PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT. 9 | 10 | ***************************************************************************/ 11 | 12 | using System; 13 | using Microsoft.VisualStudio.Shell.Interop; 14 | using VSLangProj; 15 | using Microsoft.VisualStudio; 16 | 17 | namespace Microsoft.VisualStudio.Project.Automation 18 | { 19 | public class OABuildManager : ConnectionPointContainer, 20 | IEventSource<_dispBuildManagerEvents>, 21 | BuildManager, 22 | BuildManagerEvents 23 | { 24 | private ProjectNode projectManager; 25 | 26 | public OABuildManager(ProjectNode project) 27 | { 28 | projectManager = project; 29 | AddEventSource<_dispBuildManagerEvents>(this as IEventSource<_dispBuildManagerEvents>); 30 | } 31 | 32 | 33 | #region BuildManager Members 34 | 35 | public virtual string BuildDesignTimeOutput(string bstrOutputMoniker) 36 | { 37 | throw new NotImplementedException(); 38 | } 39 | 40 | public virtual EnvDTE.Project ContainingProject 41 | { 42 | get { return projectManager.GetAutomationObject() as EnvDTE.Project; } 43 | } 44 | 45 | public virtual EnvDTE.DTE DTE 46 | { 47 | get { return projectManager.Site.GetService(typeof(EnvDTE.DTE)) as EnvDTE.DTE; } 48 | } 49 | 50 | [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1065:DoNotRaiseExceptionsInUnexpectedLocations")] 51 | public virtual object DesignTimeOutputMonikers 52 | { 53 | get { throw new NotImplementedException(); } 54 | } 55 | 56 | [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1065:DoNotRaiseExceptionsInUnexpectedLocations")] 57 | public virtual object Parent 58 | { 59 | get { throw new NotImplementedException(); } 60 | } 61 | 62 | #endregion 63 | 64 | #region _dispBuildManagerEvents_Event Members 65 | 66 | public event _dispBuildManagerEvents_DesignTimeOutputDeletedEventHandler DesignTimeOutputDeleted; 67 | 68 | public event _dispBuildManagerEvents_DesignTimeOutputDirtyEventHandler DesignTimeOutputDirty; 69 | 70 | #endregion 71 | 72 | #region IEventSource<_dispBuildManagerEvents> Members 73 | 74 | void IEventSource<_dispBuildManagerEvents>.OnSinkAdded(_dispBuildManagerEvents sink) 75 | { 76 | DesignTimeOutputDeleted += new _dispBuildManagerEvents_DesignTimeOutputDeletedEventHandler(sink.DesignTimeOutputDeleted); 77 | DesignTimeOutputDirty += new _dispBuildManagerEvents_DesignTimeOutputDirtyEventHandler(sink.DesignTimeOutputDirty); 78 | } 79 | 80 | void IEventSource<_dispBuildManagerEvents>.OnSinkRemoved(_dispBuildManagerEvents sink) 81 | { 82 | DesignTimeOutputDeleted -= new _dispBuildManagerEvents_DesignTimeOutputDeletedEventHandler(sink.DesignTimeOutputDeleted); 83 | DesignTimeOutputDirty -= new _dispBuildManagerEvents_DesignTimeOutputDirtyEventHandler(sink.DesignTimeOutputDirty); 84 | } 85 | 86 | #endregion 87 | 88 | protected virtual void OnDesignTimeOutputDeleted(string outputMoniker) 89 | { 90 | var handlers = this.DesignTimeOutputDeleted; 91 | if (handlers != null) 92 | { 93 | handlers(outputMoniker); 94 | } 95 | } 96 | 97 | protected virtual void OnDesignTimeOutputDirty(string outputMoniker) 98 | { 99 | var handlers = this.DesignTimeOutputDirty; 100 | if (handlers != null) 101 | { 102 | handlers(outputMoniker); 103 | } 104 | } 105 | } 106 | } 107 | -------------------------------------------------------------------------------- /Mpf/Automation/VSProject/OAComReference.cs: -------------------------------------------------------------------------------- 1 | /*************************************************************************** 2 | 3 | Copyright (c) Microsoft Corporation. All rights reserved. 4 | This code is licensed under the Visual Studio SDK license terms. 5 | THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF 6 | ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY 7 | IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR 8 | PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT. 9 | 10 | ***************************************************************************/ 11 | 12 | using System; 13 | using System.Diagnostics.CodeAnalysis; 14 | using System.Globalization; 15 | using System.Runtime.InteropServices; 16 | 17 | namespace Microsoft.VisualStudio.Project.Automation 18 | { 19 | [SuppressMessage("Microsoft.Interoperability", "CA1405:ComVisibleTypeBaseTypesShouldBeComVisible")] 20 | [ComVisible(true)] 21 | public class OAComReference : OAReferenceBase 22 | { 23 | public OAComReference(ComReferenceNode comReference) : 24 | base(comReference) 25 | { 26 | } 27 | 28 | #region Reference override 29 | public override string Culture 30 | { 31 | get 32 | { 33 | int locale = 0; 34 | try 35 | { 36 | locale = int.Parse(BaseReferenceNode.LCID, CultureInfo.InvariantCulture); 37 | } 38 | catch(System.FormatException) 39 | { 40 | // Do Nothing 41 | } 42 | if(0 == locale) 43 | { 44 | return string.Empty; 45 | } 46 | CultureInfo culture = new CultureInfo(locale); 47 | return culture.Name; 48 | } 49 | } 50 | public override string Identity 51 | { 52 | get 53 | { 54 | return string.Format(CultureInfo.InvariantCulture, "{0}\\{1}", BaseReferenceNode.TypeGuid.ToString("B"), this.Version); 55 | } 56 | } 57 | public override int MajorVersion 58 | { 59 | get { return BaseReferenceNode.MajorVersionNumber; } 60 | } 61 | public override int MinorVersion 62 | { 63 | get { return BaseReferenceNode.MinorVersionNumber; } 64 | } 65 | public override string Name 66 | { 67 | get { return BaseReferenceNode.Caption; } 68 | } 69 | public override VSLangProj.prjReferenceType Type 70 | { 71 | get 72 | { 73 | return VSLangProj.prjReferenceType.prjReferenceTypeActiveX; 74 | } 75 | } 76 | public override string Version 77 | { 78 | get 79 | { 80 | Version version = new Version(BaseReferenceNode.MajorVersionNumber, BaseReferenceNode.MinorVersionNumber); 81 | return version.ToString(); 82 | } 83 | } 84 | #endregion 85 | } 86 | } 87 | -------------------------------------------------------------------------------- /Mpf/Automation/VSProject/OAProjectReference.cs: -------------------------------------------------------------------------------- 1 | /*************************************************************************** 2 | 3 | Copyright (c) Microsoft Corporation. All rights reserved. 4 | This code is licensed under the Visual Studio SDK license terms. 5 | THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF 6 | ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY 7 | IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR 8 | PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT. 9 | 10 | ***************************************************************************/ 11 | 12 | using System; 13 | using System.Diagnostics.CodeAnalysis; 14 | using System.Runtime.InteropServices; 15 | using Microsoft.VisualStudio; 16 | using Microsoft.VisualStudio.Shell; 17 | using Microsoft.VisualStudio.Shell.Interop; 18 | using VSLangProj; 19 | 20 | namespace Microsoft.VisualStudio.Project.Automation 21 | { 22 | /// 23 | /// Represents a project reference of the solution 24 | /// 25 | [SuppressMessage("Microsoft.Interoperability", "CA1405:ComVisibleTypeBaseTypesShouldBeComVisible")] 26 | [ComVisible(true)] 27 | public class OAProjectReference : OAReferenceBase 28 | { 29 | public OAProjectReference(ProjectReferenceNode projectReference) : 30 | base(projectReference) 31 | { 32 | } 33 | 34 | #region Reference override 35 | public override string Culture 36 | { 37 | get { return string.Empty; } 38 | } 39 | public override string Name 40 | { 41 | get { return BaseReferenceNode.ReferencedProjectName; } 42 | } 43 | public override string Identity 44 | { 45 | get 46 | { 47 | return BaseReferenceNode.Caption; 48 | } 49 | } 50 | public override string Path 51 | { 52 | get 53 | { 54 | return BaseReferenceNode.ReferencedProjectOutputPath; 55 | } 56 | } 57 | public override EnvDTE.Project SourceProject 58 | { 59 | get 60 | { 61 | if(Guid.Empty == BaseReferenceNode.ReferencedProjectGuid) 62 | { 63 | return null; 64 | } 65 | IVsHierarchy hierarchy = VsShellUtilities.GetHierarchy(BaseReferenceNode.ProjectMgr.Site, BaseReferenceNode.ReferencedProjectGuid); 66 | if(null == hierarchy) 67 | { 68 | return null; 69 | } 70 | object extObject; 71 | if(Microsoft.VisualStudio.ErrorHandler.Succeeded( 72 | hierarchy.GetProperty(VSConstants.VSITEMID_ROOT, (int)__VSHPROPID.VSHPROPID_ExtObject, out extObject))) 73 | { 74 | return extObject as EnvDTE.Project; 75 | } 76 | return null; 77 | } 78 | } 79 | public override prjReferenceType Type 80 | { 81 | // TODO: Write the code that finds out the type of the output of the source project. 82 | get { return prjReferenceType.prjReferenceTypeAssembly; } 83 | } 84 | public override string Version 85 | { 86 | get { return string.Empty; } 87 | } 88 | #endregion 89 | } 90 | } 91 | -------------------------------------------------------------------------------- /Mpf/Automation/VSProject/OAReferenceBase.cs: -------------------------------------------------------------------------------- 1 | /*************************************************************************** 2 | 3 | Copyright (c) Microsoft Corporation. All rights reserved. 4 | This code is licensed under the Visual Studio SDK license terms. 5 | THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF 6 | ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY 7 | IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR 8 | PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT. 9 | 10 | ***************************************************************************/ 11 | 12 | using System; 13 | using System.Diagnostics.CodeAnalysis; 14 | using System.Runtime.InteropServices; 15 | using VSLangProj; 16 | 17 | namespace Microsoft.VisualStudio.Project.Automation 18 | { 19 | /// 20 | /// Represents the automation equivalent of ReferenceNode 21 | /// 22 | /// 23 | [SuppressMessage("Microsoft.Naming", "CA1715:IdentifiersShouldHaveCorrectPrefix", MessageId = "T")] 24 | [ComVisible(true)] 25 | public abstract class OAReferenceBase : Reference 26 | where RefType : ReferenceNode 27 | { 28 | #region fields 29 | private RefType referenceNode; 30 | #endregion 31 | 32 | #region ctors 33 | protected OAReferenceBase(RefType referenceNode) 34 | { 35 | this.referenceNode = referenceNode; 36 | } 37 | #endregion 38 | 39 | #region properties 40 | protected RefType BaseReferenceNode 41 | { 42 | get { return referenceNode; } 43 | } 44 | #endregion 45 | 46 | #region Reference Members 47 | public virtual int BuildNumber 48 | { 49 | get { return 0; } 50 | } 51 | 52 | public virtual References Collection 53 | { 54 | get 55 | { 56 | return BaseReferenceNode.Parent.Object as References; 57 | } 58 | } 59 | 60 | public virtual EnvDTE.Project ContainingProject 61 | { 62 | get 63 | { 64 | return BaseReferenceNode.ProjectMgr.GetAutomationObject() as EnvDTE.Project; 65 | } 66 | } 67 | 68 | public virtual bool CopyLocal 69 | { 70 | get 71 | { 72 | throw new NotImplementedException(); 73 | } 74 | set 75 | { 76 | throw new NotImplementedException(); 77 | } 78 | } 79 | 80 | public virtual string Culture 81 | { 82 | get { throw new NotImplementedException(); } 83 | } 84 | 85 | public virtual EnvDTE.DTE DTE 86 | { 87 | get 88 | { 89 | return BaseReferenceNode.ProjectMgr.Site.GetService(typeof(EnvDTE.DTE)) as EnvDTE.DTE; 90 | } 91 | } 92 | 93 | public virtual string Description 94 | { 95 | get 96 | { 97 | return this.Name; 98 | } 99 | } 100 | 101 | public virtual string ExtenderCATID 102 | { 103 | get { throw new NotImplementedException(); } 104 | } 105 | 106 | public virtual object ExtenderNames 107 | { 108 | get { throw new NotImplementedException(); } 109 | } 110 | 111 | public virtual string Identity 112 | { 113 | get { throw new NotImplementedException(); } 114 | } 115 | 116 | public virtual int MajorVersion 117 | { 118 | get { return 0; } 119 | } 120 | 121 | public virtual int MinorVersion 122 | { 123 | get { return 0; } 124 | } 125 | 126 | public virtual string Name 127 | { 128 | get { throw new NotImplementedException(); } 129 | } 130 | 131 | public virtual string Path 132 | { 133 | get 134 | { 135 | return BaseReferenceNode.Url; 136 | } 137 | } 138 | 139 | public virtual string PublicKeyToken 140 | { 141 | get { throw new NotImplementedException(); } 142 | } 143 | 144 | public virtual void Remove() 145 | { 146 | BaseReferenceNode.Remove(false); 147 | } 148 | 149 | public virtual int RevisionNumber 150 | { 151 | get { return 0; } 152 | } 153 | 154 | public virtual EnvDTE.Project SourceProject 155 | { 156 | get { return null; } 157 | } 158 | 159 | public virtual bool StrongName 160 | { 161 | get { return false; } 162 | } 163 | 164 | public virtual prjReferenceType Type 165 | { 166 | get { throw new NotImplementedException(); } 167 | } 168 | 169 | public virtual string Version 170 | { 171 | get { return new Version().ToString(); } 172 | } 173 | 174 | public virtual object get_Extender(string ExtenderName) 175 | { 176 | throw new NotImplementedException(); 177 | } 178 | #endregion 179 | } 180 | } 181 | -------------------------------------------------------------------------------- /Mpf/Automation/VSProject/OAVSProjectItem.cs: -------------------------------------------------------------------------------- 1 | /*************************************************************************** 2 | 3 | Copyright (c) Microsoft Corporation. All rights reserved. 4 | This code is licensed under the Visual Studio SDK license terms. 5 | THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF 6 | ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY 7 | IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR 8 | PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT. 9 | 10 | ***************************************************************************/ 11 | 12 | using System; 13 | using System.Diagnostics.CodeAnalysis; 14 | using System.Runtime.InteropServices; 15 | using EnvDTE; 16 | using VSLangProj; 17 | 18 | namespace Microsoft.VisualStudio.Project.Automation 19 | { 20 | /// 21 | /// Represents a language-specific project item 22 | /// 23 | [SuppressMessage("Microsoft.Naming", "CA1709:IdentifiersShouldBeCasedCorrectly", MessageId = "OAVS")] 24 | [ComVisible(true), CLSCompliant(false)] 25 | public class OAVSProjectItem : VSProjectItem 26 | { 27 | #region fields 28 | private FileNode fileNode; 29 | #endregion 30 | 31 | #region ctors 32 | public OAVSProjectItem(FileNode fileNode) 33 | { 34 | this.FileNode = fileNode; 35 | } 36 | #endregion 37 | 38 | #region VSProjectItem Members 39 | 40 | public virtual EnvDTE.Project ContainingProject 41 | { 42 | get { return fileNode.ProjectMgr.GetAutomationObject() as EnvDTE.Project; } 43 | } 44 | 45 | public virtual ProjectItem ProjectItem 46 | { 47 | get { return fileNode.GetAutomationObject() as ProjectItem; } 48 | } 49 | 50 | public virtual DTE DTE 51 | { 52 | get { return (DTE)this.fileNode.ProjectMgr.Site.GetService(typeof(DTE)); } 53 | } 54 | 55 | public virtual void RunCustomTool() 56 | { 57 | this.FileNode.RunGenerator(); 58 | } 59 | 60 | #endregion 61 | 62 | #region public properties 63 | /// 64 | /// File Node property 65 | /// 66 | public FileNode FileNode 67 | { 68 | get 69 | { 70 | return fileNode; 71 | } 72 | set 73 | { 74 | fileNode = value; 75 | } 76 | } 77 | #endregion 78 | 79 | } 80 | } 81 | -------------------------------------------------------------------------------- /Mpf/BuildDependency.cs: -------------------------------------------------------------------------------- 1 | /*************************************************************************** 2 | 3 | Copyright (c) Microsoft Corporation. All rights reserved. 4 | This code is licensed under the Visual Studio SDK license terms. 5 | THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF 6 | ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY 7 | IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR 8 | PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT. 9 | 10 | ***************************************************************************/ 11 | 12 | using System; 13 | using Microsoft.VisualStudio; 14 | using Microsoft.VisualStudio.Shell; 15 | using Microsoft.VisualStudio.Shell.Interop; 16 | 17 | namespace Microsoft.VisualStudio.Project 18 | { 19 | public class BuildDependency : IVsBuildDependency 20 | { 21 | Guid referencedProjectGuid = Guid.Empty; 22 | ProjectNode projectMgr = null; 23 | 24 | [CLSCompliant(false)] 25 | public BuildDependency(ProjectNode projectMgr, Guid projectReference) 26 | { 27 | this.referencedProjectGuid = projectReference; 28 | this.projectMgr = projectMgr; 29 | } 30 | 31 | #region IVsBuildDependency methods 32 | public int get_CanonicalName(out string canonicalName) 33 | { 34 | canonicalName = null; 35 | return VSConstants.S_OK; 36 | } 37 | 38 | public int get_Type(out System.Guid guidType) 39 | { 40 | // All our dependencies are build projects 41 | guidType = VSConstants.GUID_VS_DEPTYPE_BUILD_PROJECT; 42 | return VSConstants.S_OK; 43 | } 44 | 45 | public int get_Description(out string description) 46 | { 47 | description = null; 48 | return VSConstants.S_OK; 49 | } 50 | 51 | [CLSCompliant(false)] 52 | public int get_HelpContext(out uint helpContext) 53 | { 54 | helpContext = 0; 55 | return VSConstants.E_NOTIMPL; 56 | } 57 | 58 | public int get_HelpFile(out string helpFile) 59 | { 60 | helpFile = null; 61 | return VSConstants.E_NOTIMPL; 62 | } 63 | 64 | public int get_MustUpdateBefore(out int mustUpdateBefore) 65 | { 66 | // Must always update dependencies 67 | mustUpdateBefore = 1; 68 | 69 | return VSConstants.S_OK; 70 | } 71 | 72 | public int get_ReferredProject(out object unknownProject) 73 | { 74 | unknownProject = null; 75 | 76 | unknownProject = this.GetReferencedHierarchy(); 77 | 78 | // If we cannot find the referenced hierarchy return S_FALSE. 79 | return (unknownProject == null) ? VSConstants.S_FALSE : VSConstants.S_OK; 80 | } 81 | 82 | #endregion 83 | 84 | #region helper methods 85 | private IVsHierarchy GetReferencedHierarchy() 86 | { 87 | IVsHierarchy hierarchy = null; 88 | 89 | if(this.referencedProjectGuid == Guid.Empty || this.projectMgr == null || this.projectMgr.IsClosed) 90 | { 91 | return hierarchy; 92 | } 93 | 94 | return VsShellUtilities.GetHierarchy(this.projectMgr.Site, this.referencedProjectGuid); 95 | 96 | } 97 | 98 | #endregion 99 | 100 | } 101 | } 102 | -------------------------------------------------------------------------------- /Mpf/BuildPropertyPage.cs: -------------------------------------------------------------------------------- 1 | /*************************************************************************** 2 | 3 | Copyright (c) Microsoft Corporation. All rights reserved. 4 | This code is licensed under the Visual Studio SDK license terms. 5 | THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF 6 | ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY 7 | IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR 8 | PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT. 9 | 10 | ***************************************************************************/ 11 | 12 | using System; 13 | using System.Diagnostics; 14 | using System.Globalization; 15 | using System.Runtime.InteropServices; 16 | using Microsoft.VisualStudio; 17 | 18 | namespace Microsoft.VisualStudio.Project 19 | { 20 | /// 21 | /// Enumerated list of the properties shown on the build property page 22 | /// 23 | internal enum BuildPropertyPageTag 24 | { 25 | OutputPath 26 | } 27 | 28 | /// 29 | /// Defines the properties on the build property page and the logic the binds the properties to project data (load and save) 30 | /// 31 | [CLSCompliant(false), ComVisible(true), Guid("9B3DEA40-7F29-4a17-87A4-00EE08E8241E")] 32 | public class BuildPropertyPage : SettingsPage 33 | { 34 | #region fields 35 | private string outputPath; 36 | 37 | public BuildPropertyPage() 38 | { 39 | this.Name = SR.GetString(SR.BuildCaption, CultureInfo.CurrentUICulture); 40 | } 41 | #endregion 42 | 43 | #region properties 44 | [SRCategoryAttribute(SR.BuildCaption)] 45 | [LocDisplayName(SR.OutputPath)] 46 | [SRDescriptionAttribute(SR.OutputPathDescription)] 47 | public string OutputPath 48 | { 49 | get { return this.outputPath; } 50 | set { this.outputPath = value; this.IsDirty = true; } 51 | } 52 | #endregion 53 | 54 | #region overridden methods 55 | public override string GetClassName() 56 | { 57 | return this.GetType().FullName; 58 | } 59 | 60 | protected override void BindProperties() 61 | { 62 | if(this.ProjectMgr == null) 63 | { 64 | Debug.Assert(false); 65 | return; 66 | } 67 | 68 | this.outputPath = this.GetConfigProperty(BuildPropertyPageTag.OutputPath.ToString()); 69 | } 70 | 71 | protected override int ApplyChanges() 72 | { 73 | if(this.ProjectMgr == null) 74 | { 75 | Debug.Assert(false); 76 | return VSConstants.E_INVALIDARG; 77 | } 78 | 79 | this.SetConfigProperty(BuildPropertyPageTag.OutputPath.ToString(), this.outputPath); 80 | this.IsDirty = false; 81 | return VSConstants.S_OK; 82 | } 83 | #endregion 84 | } 85 | } 86 | -------------------------------------------------------------------------------- /Mpf/BuildStatus.cs: -------------------------------------------------------------------------------- 1 | /*************************************************************************** 2 | 3 | Copyright (c) Microsoft Corporation. All rights reserved. 4 | This code is licensed under the Visual Studio SDK license terms. 5 | THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF 6 | ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY 7 | IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR 8 | PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT. 9 | 10 | ***************************************************************************/ 11 | 12 | 13 | 14 | namespace Microsoft.VisualStudio.Project 15 | { 16 | using System; 17 | using System.Diagnostics; 18 | using System.Diagnostics.CodeAnalysis; 19 | using System.Runtime.InteropServices; 20 | using Microsoft.VisualStudio.Shell.Interop; 21 | 22 | /// 23 | /// Provides information about the current build status. 24 | /// 25 | internal static class BuildStatus 26 | { 27 | private static BuildKind? currentBuild; 28 | 29 | private static volatile object Mutex = new object(); 30 | 31 | /// 32 | /// Gets a value whether a build is in progress. 33 | /// 34 | internal static bool IsInProgress 35 | { 36 | get { return BuildStatus.currentBuild.HasValue; } 37 | } 38 | 39 | /// 40 | /// Called when a build has started 41 | /// 42 | /// 43 | /// 44 | public static bool StartBuild(BuildKind kind) 45 | { 46 | if (!BuildStatus.currentBuild.HasValue) 47 | { 48 | lock(BuildStatus.Mutex) 49 | { 50 | BuildStatus.currentBuild = kind; 51 | } 52 | 53 | return true; 54 | } 55 | 56 | BuildKind currentBuildKind = BuildStatus.currentBuild.Value; 57 | 58 | switch (currentBuildKind) 59 | { 60 | case BuildKind.Sync: 61 | // Attempt to start a build during sync build indicate reentrancy 62 | Debug.Fail("Message pumping during sync build"); 63 | return false; 64 | 65 | case BuildKind.Async: 66 | if (kind == BuildKind.Sync) 67 | { 68 | // if we need to do a sync build during async build, there is not much we can do: 69 | // - the async build is user-invoked build 70 | // - during that build UI thread is by design not blocked and messages are being pumped 71 | // - therefore it is legitimate for other code to call Project System APIs and query for stuff 72 | // In that case we just fail gracefully 73 | return false; 74 | } 75 | else 76 | { 77 | // Somebody attempted to start a build while build is in progress, perhaps and Addin via 78 | // the API. Inform them of an error in their ways. 79 | throw new InvalidOperationException("Build is already in progress"); 80 | } 81 | default: 82 | Debug.Fail("Unreachable"); 83 | return false; 84 | 85 | } 86 | } 87 | 88 | /// 89 | /// Called when a build is ended. 90 | /// 91 | internal static void EndBuild() 92 | { 93 | Debug.Assert(IsInProgress, "Attempt to end a build that is not started"); 94 | lock (Mutex) 95 | { 96 | BuildStatus.currentBuild = null; 97 | } 98 | } 99 | } 100 | } -------------------------------------------------------------------------------- /Mpf/ConfigurationProperties.cs: -------------------------------------------------------------------------------- 1 | /*************************************************************************** 2 | 3 | Copyright (c) Microsoft Corporation. All rights reserved. 4 | This code is licensed under the Visual Studio SDK license terms. 5 | THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF 6 | ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY 7 | IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR 8 | PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT. 9 | 10 | ***************************************************************************/ 11 | 12 | using System; 13 | using System.Runtime.InteropServices; 14 | 15 | namespace Microsoft.VisualStudio.Project 16 | { 17 | /// 18 | /// Defines the config dependent properties exposed through automation 19 | /// 20 | [ComVisible(true)] 21 | [Guid("21f73a8f-91d7-4085-9d4f-c48ee235ee5b")] 22 | public interface IProjectConfigProperties 23 | { 24 | string OutputPath { get; set; } 25 | } 26 | 27 | /// 28 | /// Implements the configuration dependent properties interface 29 | /// 30 | [CLSCompliant(false), ComVisible(true)] 31 | [ClassInterface(ClassInterfaceType.None)] 32 | public class ProjectConfigProperties : IProjectConfigProperties 33 | { 34 | #region fields 35 | private ProjectConfig projectConfig; 36 | #endregion 37 | 38 | #region ctors 39 | public ProjectConfigProperties(ProjectConfig projectConfig) 40 | { 41 | this.projectConfig = projectConfig; 42 | } 43 | #endregion 44 | 45 | #region IProjectConfigProperties Members 46 | 47 | public virtual string OutputPath 48 | { 49 | get 50 | { 51 | return this.projectConfig.GetConfigurationProperty(BuildPropertyPageTag.OutputPath.ToString(), true); 52 | } 53 | set 54 | { 55 | this.projectConfig.SetConfigurationProperty(BuildPropertyPageTag.OutputPath.ToString(), value); 56 | } 57 | } 58 | 59 | #endregion 60 | } 61 | } 62 | -------------------------------------------------------------------------------- /Mpf/DependentFileNode.cs: -------------------------------------------------------------------------------- 1 | /*************************************************************************** 2 | 3 | Copyright (c) Microsoft Corporation. All rights reserved. 4 | This code is licensed under the Visual Studio SDK license terms. 5 | THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF 6 | ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY 7 | IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR 8 | PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT. 9 | 10 | ***************************************************************************/ 11 | 12 | using System; 13 | using System.Diagnostics.CodeAnalysis; 14 | using System.Runtime.InteropServices; 15 | using System.Text; 16 | using Microsoft.VisualStudio; 17 | using OleConstants = Microsoft.VisualStudio.OLE.Interop.Constants; 18 | using VsCommands = Microsoft.VisualStudio.VSConstants.VSStd97CmdID; 19 | using VsCommands2K = Microsoft.VisualStudio.VSConstants.VSStd2KCmdID; 20 | 21 | namespace Microsoft.VisualStudio.Project 22 | { 23 | /// 24 | /// Defines the logic for all dependent file nodes (solution explorer icon, commands etc.) 25 | /// 26 | [CLSCompliant(false)] 27 | [ComVisible(true)] 28 | public class DependentFileNode : FileNode 29 | { 30 | #region fields 31 | /// 32 | /// Defines if the node has a name relation to its parent node 33 | /// e.g. Form1.ext and Form1.resx are name related (until first occurence of extention separator) 34 | /// 35 | #endregion 36 | 37 | #region Properties 38 | public override int ImageIndex 39 | { 40 | get { return (this.CanShowDefaultIcon() ? (int)ProjectNode.ImageName.DependentFile : (int)ProjectNode.ImageName.MissingFile); } 41 | } 42 | #endregion 43 | 44 | #region ctor 45 | /// 46 | /// Constructor for the DependentFileNode 47 | /// 48 | /// Root of the hierarchy 49 | /// Associated project element 50 | public DependentFileNode(ProjectNode root, ProjectElement element) 51 | : base(root, element) 52 | { 53 | this.HasParentNodeNameRelation = false; 54 | } 55 | 56 | 57 | #endregion 58 | 59 | #region overridden methods 60 | /// 61 | /// Disable rename 62 | /// 63 | /// new label 64 | /// E_NOTIMPLE in order to tell the call that we do not support rename 65 | public override string GetEditLabel() 66 | { 67 | throw new NotImplementedException(); 68 | } 69 | 70 | /// 71 | /// Gets a handle to the icon that should be set for this node 72 | /// 73 | /// Whether the folder is open, ignored here. 74 | /// Handle to icon for the node 75 | public override object GetIconHandle(bool open) 76 | { 77 | return this.ProjectMgr.ImageHandler.GetIconHandle(this.ImageIndex); 78 | } 79 | 80 | /// 81 | /// Disable certain commands for dependent file nodes 82 | /// 83 | protected override int QueryStatusOnNode(Guid cmdGroup, uint cmd, IntPtr pCmdText, ref QueryStatusResult result) 84 | { 85 | if(cmdGroup == VsMenus.guidStandardCommandSet97) 86 | { 87 | switch((VsCommands)cmd) 88 | { 89 | case VsCommands.Copy: 90 | case VsCommands.Paste: 91 | case VsCommands.Cut: 92 | case VsCommands.Rename: 93 | result |= QueryStatusResult.NOTSUPPORTED; 94 | return VSConstants.S_OK; 95 | 96 | case VsCommands.ViewCode: 97 | case VsCommands.Open: 98 | case VsCommands.OpenWith: 99 | result |= QueryStatusResult.SUPPORTED | QueryStatusResult.ENABLED; 100 | return VSConstants.S_OK; 101 | } 102 | } 103 | else if(cmdGroup == VsMenus.guidStandardCommandSet2K) 104 | { 105 | if((VsCommands2K)cmd == VsCommands2K.EXCLUDEFROMPROJECT) 106 | { 107 | result |= QueryStatusResult.NOTSUPPORTED; 108 | return VSConstants.S_OK; 109 | } 110 | } 111 | else 112 | { 113 | return (int)OleConstants.OLECMDERR_E_UNKNOWNGROUP; 114 | } 115 | return base.QueryStatusOnNode(cmdGroup, cmd, pCmdText, ref result); 116 | } 117 | 118 | /// 119 | /// DependentFileNodes node cannot be dragged. 120 | /// 121 | /// null 122 | protected internal override StringBuilder PrepareSelectedNodesForClipBoard() 123 | { 124 | return null; 125 | } 126 | 127 | protected override NodeProperties CreatePropertiesObject() 128 | { 129 | return new DependentFileNodeProperties(this); 130 | } 131 | 132 | /// 133 | /// Redraws the state icon if the node is not excluded from source control. 134 | /// 135 | [SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", MessageId = "Scc")] 136 | protected internal override void UpdateSccStateIcons() 137 | { 138 | if(!this.ExcludeNodeFromScc) 139 | { 140 | this.Parent.ReDraw(UIHierarchyElement.SccState); 141 | } 142 | } 143 | #endregion 144 | 145 | } 146 | } 147 | -------------------------------------------------------------------------------- /Mpf/Diagrams/AutomationClasses.cd: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | AAAAAJAAAAAAMAAAAAAAAAAAAAAAAAACgBABAAAAAAA= 7 | Automation\OAFileItem.cs 8 | 9 | 10 | 11 | 12 | 13 | AEQAAAAAEABACBAAAAgASAQkCAgAIAAAAgAAAAAAACQ= 14 | Automation\OANavigableProjectItems.cs 15 | 16 | 17 | 18 | 19 | 20 | 21 | AAQAAJQAAABEUIIhQAAcCAQAAAkAAAAAIBgFCABCAAA= 22 | Automation\OAProject.cs 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | AQQAQJAAAABEYAAgQACMDCQBCAkAAAACgBAFAAECAAA= 33 | Automation\OAProjectItem.cs 34 | 35 | 36 | 37 | 38 | 39 | 40 | AEAAAAAAEAAAAAAAAAAgAAAggAAAAAAAAAAAAAAAACA= 41 | Automation\OAProjectItems.cs 42 | 43 | 44 | 45 | 46 | 47 | EAYAAAACABAAABAAIAAAQCQEAAIAAAAIAAAAAAECAAA= 48 | Automation\OAProperties.cs 49 | 50 | 51 | 52 | 53 | 54 | 55 | AQSAAAAAABAAQAJgAAAQQAQAgAAAAAAAAAAgAAAAAAA= 56 | Automation\OAProperty.cs 57 | 58 | 59 | 60 | 61 | 62 | 63 | AAAAABAAAAAAAAAAAAAAACAAAAAACAAAAAAAAAAAAAA= 64 | Automation\OANestedProjectItem.cs 65 | 66 | 67 | 68 | 69 | 70 | AAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQ= 71 | Automation\OAReferenceFolderItem.cs 72 | 73 | 74 | 75 | 76 | 77 | AUQAAAAAAAAAAAAAAAAAQAAgAAIAAAAAAAQAAAAEAAA= 78 | Automation\OASolutionFolder.cs 79 | 80 | 81 | 82 | 83 | 84 | 85 | AAAAAAAAAAAAYAAAAAAAAAQAAAEAAAAAAAAAAAAAAAA= 86 | Automation\OAReferenceItem.cs 87 | 88 | 89 | 90 | -------------------------------------------------------------------------------- /Mpf/Diagrams/ConfigurationClasses.cd: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | AAAAAQQAAAAAAAAAAAAAgAAACAgAQBAAAAAAAACAABA= 7 | Output.cs 8 | 9 | 10 | 11 | 12 | 13 | 14 | AAAAIgABgwTAAAAAAAAAiAAAAIgEQAAggAAAEASAABA= 15 | OutputGroup.cs 16 | 17 | 18 | 19 | 20 | 21 | 22 | AAgCEEJABBAAkaSFCGCkAAEAAEiBYEEKACAAGRDJUEA= 23 | ProjectConfig.cs 24 | 25 | 26 | 27 | 28 | 29 | 30 | AABCAAAACgAACAAAAABABAEIAAQAgAAAIABAEABQAAA= 31 | ProjectConfig.cs 32 | 33 | 34 | 35 | 36 | 37 | 38 | gAWAgFQBAAJIAhACAAgCABAEAQ5MAAAABCAEEAAAEQQ= 39 | ConfigProvider.cs 40 | 41 | 42 | 43 | 44 | 45 | 46 | AgAEAEACAAAAAAQApAQAAgAUABAAA4AAQAIAAAAAgiA= 47 | ProjectElement.cs 48 | 49 | 50 | 51 | 52 | 53 | PcP89b7sGr3/n1KfHv7+dr/f9h//71+3/xPdS+fRan4= 54 | ProjectNode.CopyPaste.cs 55 | 56 | 57 | 58 | 59 | -------------------------------------------------------------------------------- /Mpf/Diagrams/DocumentManagerClasses.cd: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | FileDocumentManager.cs 8 | AACAAAAAAAAAIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA= 9 | 10 | 11 | 12 | 13 | 14 | DocumentManager.cs 15 | AQCAQIQAAAAAIAEAAAAAAAAAIAAAAAAAAAAAACGAAAE= 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | ProjectDesignerDocumentManager.cs 28 | AACAAAAAAAAAIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA= 29 | 30 | 31 | 32 | 33 | 34 | HierarchyNode.cs 35 | NKl4a26oCodRuoDQodAKZKQQxKtwgtmAOJLYAHLHccE= 36 | 37 | 38 | 39 | -------------------------------------------------------------------------------- /Mpf/Diagrams/HierarchyClasses.cd: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | BolBCECAAgFAAIEAgBACZAAAAAAAAAAQyAQQAIRGQIA= 7 | FileNode.cs 8 | 9 | 10 | 11 | 12 | 13 | PcP89b7sGr3/n1KfHv7+dr/f9h//71+3/xPdS+fRan4= 14 | ProjectNode.CopyPaste.cs 15 | 16 | 17 | 18 | 19 | 20 | 21 | NKl4K26oqqdRuqD4sdAKZLc0zKtxgtmgOJLYADLHccE= 22 | HierarchyNode.cs 23 | 24 | 25 | 26 | 27 | 28 | 29 | AABFCBAAAAYgAAAgQAAAAAAEQMABAAAATAWAAAABAAE= 30 | ProjectContainerNode.cs 31 | 32 | 33 | 34 | 35 | 36 | 37 | BIAQEAKAAgFAAAAAgIACJAAABAICAAAACAAQAAACAQA= 38 | FolderNode.cs 39 | 40 | 41 | 42 | 43 | 44 | AIBAAGagAAFAAAAAgACiIAAAAAAQAAEAGAAQAABAAAA= 45 | ReferenceNode.cs 46 | 47 | 48 | 49 | 50 | 51 | AABICACgAAUAAIAgggACIABAAAYQQAAAGEIQAABAARA= 52 | ReferenceContainerNode.cs 53 | 54 | 55 | 56 | 57 | 58 | 59 | AACACCIAAAIAACQgQAAEBAQAgACAAAABCAgQAQACIAA= 60 | ComReferenceNode.cs 61 | 62 | 63 | 64 | 65 | 66 | CIACCFYCAgAAgAEgAIACBAQAAAAQABAACAAAAECACgA= 67 | ProjectReferenceNode.cs 68 | 69 | 70 | 71 | 72 | 73 | AAACCCJAACAACAAgEAoAAAACBABACIAIGAAAEACAABw= 74 | AssemblyReferenceNode.cs 75 | 76 | 77 | 78 | -------------------------------------------------------------------------------- /Mpf/Diagrams/PropertiesClasses.cd: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | AAAACAAACAAAAAAgAAAAgAAAABAEIAAAAERAAAAACAA= 7 | LocalizableProperties.cs 8 | 9 | 10 | 11 | 12 | 13 | 14 | CAAAAAAgAAAAAAAAAAAAAAAAAAAAIQAAAAAAAABAAAA= 15 | NodeProperties.cs 16 | 17 | 18 | 19 | 20 | 21 | CAAAAAAAAAAAAAAAAAAAAAQAAAAAIAAAAAAAAAAAAAA= 22 | NodeProperties.cs 23 | 24 | 25 | 26 | 27 | 28 | EQACAAAAAAAAAQAAAAAECAQAAAkgAggAAAhECAEAAAA= 29 | NodeProperties.cs 30 | 31 | 32 | 33 | 34 | 35 | 36 | CAAAAAAgAAAAAAAAAAAAAAAAAAAAIAAAAAAAAABAAAA= 37 | NodeProperties.cs 38 | 39 | 40 | 41 | 42 | 43 | AAABhAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQAAgQAYA= 44 | NodeProperties.cs 45 | 46 | 47 | 48 | 49 | 50 | CAAAAAAAABAAAAAAAAAAAAAAAAAgIAgAAAQAAABAAAA= 51 | NodeProperties.cs 52 | 53 | 54 | 55 | 56 | 57 | CAAAAAAABAAAAAAAAAAAAAAAAAAAIAAAAAAAAABAAAA= 58 | NodeProperties.cs 59 | 60 | 61 | 62 | 63 | 64 | CAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA= 65 | NodeProperties.cs 66 | 67 | 68 | 69 | -------------------------------------------------------------------------------- /Mpf/Diagrams/ReferenceClasses.cd: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | ReferenceNode.cs 9 | 10 | 11 | 12 | 13 | AIBAAGagAAFAAAAAgACiIAAAAAAQAAEAGAAQAABAAAA= 14 | ReferenceNode.cs 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | CIACCFYCAgAAgAEgAIACBAQAAAAQABAACAAAAECACgA= 30 | ProjectReferenceNode.cs 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | AAAQAAYAAAQAgAAQAEAAAAAAAAAAAAAAEQAAAACAAAA= 43 | BuildDependency.cs 44 | 45 | 46 | 47 | 48 | 49 | 50 | AACACCIAAAIAACQgQAAEBAQAgACAAAABCAgQAQACIAA= 51 | ComReferenceNode.cs 52 | 53 | 54 | 55 | 56 | 57 | AAAAAAAAAAAAAAAAAQAAIAAAAgAAAAAIAAAAgABAAAA= 58 | SolutionListenerForProjectReferenceUpdate.cs 59 | 60 | 61 | 62 | 63 | 64 | AAIACRBQoCAQCCAAEAIAJAAACgQBAAAYAQAiiAIAAAA= 65 | SolutionListener.cs 66 | 67 | 68 | 69 | 70 | 71 | 72 | AAACCCJAACAACAAgEAoAAAACBABACIAIGAAAEACAABw= 73 | AssemblyReferenceNode.cs 74 | 75 | 76 | 77 | -------------------------------------------------------------------------------- /Mpf/EnumDependencies.cs: -------------------------------------------------------------------------------- 1 | /*************************************************************************** 2 | 3 | Copyright (c) Microsoft Corporation. All rights reserved. 4 | This code is licensed under the Visual Studio SDK license terms. 5 | THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF 6 | ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY 7 | IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR 8 | PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT. 9 | 10 | ***************************************************************************/ 11 | 12 | using System; 13 | using System.Collections.Generic; 14 | using Microsoft.VisualStudio; 15 | using Microsoft.VisualStudio.Shell.Interop; 16 | 17 | namespace Microsoft.VisualStudio.Project 18 | { 19 | [CLSCompliant(false)] 20 | public class EnumDependencies : IVsEnumDependencies 21 | { 22 | private List dependencyList = new List(); 23 | 24 | private uint nextIndex; 25 | 26 | public EnumDependencies(IList dependencyList) 27 | { 28 | if (dependencyList == null) 29 | { 30 | throw new ArgumentNullException("dependencyList"); 31 | } 32 | 33 | foreach(IVsDependency dependency in dependencyList) 34 | { 35 | this.dependencyList.Add(dependency); 36 | } 37 | } 38 | 39 | public EnumDependencies(IList dependencyList) 40 | { 41 | if (dependencyList == null) 42 | { 43 | throw new ArgumentNullException("dependencyList"); 44 | } 45 | 46 | foreach(IVsBuildDependency dependency in dependencyList) 47 | { 48 | this.dependencyList.Add(dependency); 49 | } 50 | } 51 | 52 | public int Clone(out IVsEnumDependencies enumDependencies) 53 | { 54 | enumDependencies = new EnumDependencies(this.dependencyList); 55 | ErrorHandler.ThrowOnFailure(enumDependencies.Skip(this.nextIndex)); 56 | return VSConstants.S_OK; 57 | } 58 | 59 | public int Next(uint elements, IVsDependency[] dependencies, out uint elementsFetched) 60 | { 61 | elementsFetched = 0; 62 | if (dependencies == null) 63 | { 64 | throw new ArgumentNullException("dependencies"); 65 | } 66 | 67 | uint fetched = 0; 68 | int count = this.dependencyList.Count; 69 | 70 | while(this.nextIndex < count && elements > 0 && fetched < count) 71 | { 72 | dependencies[fetched] = this.dependencyList[(int)this.nextIndex]; 73 | this.nextIndex++; 74 | fetched++; 75 | elements--; 76 | 77 | } 78 | 79 | elementsFetched = fetched; 80 | 81 | // Did we get 'em all? 82 | return (elements == 0 ? VSConstants.S_OK : VSConstants.S_FALSE); 83 | } 84 | 85 | public int Reset() 86 | { 87 | this.nextIndex = 0; 88 | return VSConstants.S_OK; 89 | } 90 | 91 | public int Skip(uint elements) 92 | { 93 | this.nextIndex += elements; 94 | uint count = (uint)this.dependencyList.Count; 95 | 96 | if(this.nextIndex > count) 97 | { 98 | this.nextIndex = count; 99 | return VSConstants.S_FALSE; 100 | } 101 | 102 | return VSConstants.S_OK; 103 | } 104 | } 105 | } 106 | -------------------------------------------------------------------------------- /Mpf/Key.snk: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/brentspell/NuBuild/d6b6088758eda10bd412eae8ce5bbed5b1cd3565/Mpf/Key.snk -------------------------------------------------------------------------------- /Mpf/LocalizableProperties.cs: -------------------------------------------------------------------------------- 1 | /*************************************************************************** 2 | 3 | Copyright (c) Microsoft Corporation. All rights reserved. 4 | This code is licensed under the Visual Studio SDK license terms. 5 | THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF 6 | ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY 7 | IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR 8 | PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT. 9 | 10 | ***************************************************************************/ 11 | 12 | using System; 13 | using System.Collections; 14 | using System.ComponentModel; 15 | using System.Runtime.InteropServices; 16 | 17 | namespace Microsoft.VisualStudio.Project 18 | { 19 | /// 20 | /// Enables a managed object to expose properties and attributes for COM objects. 21 | /// 22 | [ComVisible(true)] 23 | public class LocalizableProperties : ICustomTypeDescriptor 24 | { 25 | #region ICustomTypeDescriptor 26 | public virtual AttributeCollection GetAttributes() 27 | { 28 | AttributeCollection col = TypeDescriptor.GetAttributes(this, true); 29 | return col; 30 | } 31 | 32 | public virtual EventDescriptor GetDefaultEvent() 33 | { 34 | EventDescriptor ed = TypeDescriptor.GetDefaultEvent(this, true); 35 | return ed; 36 | } 37 | 38 | public virtual PropertyDescriptor GetDefaultProperty() 39 | { 40 | PropertyDescriptor pd = TypeDescriptor.GetDefaultProperty(this, true); 41 | return pd; 42 | } 43 | 44 | public virtual object GetEditor(Type editorBaseType) 45 | { 46 | object o = TypeDescriptor.GetEditor(this, editorBaseType, true); 47 | return o; 48 | } 49 | 50 | public virtual EventDescriptorCollection GetEvents() 51 | { 52 | EventDescriptorCollection edc = TypeDescriptor.GetEvents(this, true); 53 | return edc; 54 | } 55 | 56 | public virtual EventDescriptorCollection GetEvents(System.Attribute[] attributes) 57 | { 58 | EventDescriptorCollection edc = TypeDescriptor.GetEvents(this, attributes, true); 59 | return edc; 60 | } 61 | 62 | public virtual object GetPropertyOwner(PropertyDescriptor pd) 63 | { 64 | return this; 65 | } 66 | 67 | public virtual PropertyDescriptorCollection GetProperties() 68 | { 69 | PropertyDescriptorCollection pcol = GetProperties(null); 70 | return pcol; 71 | } 72 | 73 | public virtual PropertyDescriptorCollection GetProperties(System.Attribute[] attributes) 74 | { 75 | ArrayList newList = new ArrayList(); 76 | PropertyDescriptorCollection props = TypeDescriptor.GetProperties(this, attributes, true); 77 | 78 | for(int i = 0; i < props.Count; i++) 79 | newList.Add(CreateDesignPropertyDescriptor(props[i])); 80 | 81 | return new PropertyDescriptorCollection((PropertyDescriptor[])newList.ToArray(typeof(PropertyDescriptor))); ; 82 | } 83 | 84 | public virtual DesignPropertyDescriptor CreateDesignPropertyDescriptor(PropertyDescriptor propertyDescriptor) 85 | { 86 | return new DesignPropertyDescriptor(propertyDescriptor); 87 | } 88 | 89 | public virtual string GetComponentName() 90 | { 91 | string name = TypeDescriptor.GetComponentName(this, true); 92 | return name; 93 | } 94 | 95 | public virtual TypeConverter GetConverter() 96 | { 97 | TypeConverter tc = TypeDescriptor.GetConverter(this, true); 98 | return tc; 99 | } 100 | 101 | public virtual string GetClassName() 102 | { 103 | return this.GetType().FullName; 104 | } 105 | 106 | #endregion ICustomTypeDescriptor 107 | } 108 | } 109 | -------------------------------------------------------------------------------- /Mpf/MPFProjectAll.files: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | . 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /Mpf/Misc/ConnectionPointContainer.cs: -------------------------------------------------------------------------------- 1 | /*************************************************************************** 2 | 3 | Copyright (c) Microsoft Corporation. All rights reserved. 4 | This code is licensed under the Visual Studio SDK license terms. 5 | THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF 6 | ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY 7 | IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR 8 | PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT. 9 | 10 | ***************************************************************************/ 11 | 12 | using System; 13 | using System.Collections.Generic; 14 | using System.Runtime.InteropServices; 15 | using Microsoft.VisualStudio; 16 | using Microsoft.VisualStudio.OLE.Interop; 17 | 18 | namespace Microsoft.VisualStudio.Project 19 | { 20 | /// 21 | /// Class used to identify a source of events of type SinkType. 22 | /// 23 | [ComVisible(false)] 24 | internal interface IEventSource 25 | where SinkType : class 26 | { 27 | void OnSinkAdded(SinkType sink); 28 | void OnSinkRemoved(SinkType sink); 29 | } 30 | 31 | [ComVisible(true)] 32 | public class ConnectionPointContainer : IConnectionPointContainer 33 | { 34 | private Dictionary connectionPoints; 35 | internal ConnectionPointContainer() 36 | { 37 | connectionPoints = new Dictionary(); 38 | } 39 | internal void AddEventSource(IEventSource source) 40 | where SinkType : class 41 | { 42 | if(null == source) 43 | { 44 | throw new ArgumentNullException("source"); 45 | } 46 | if(connectionPoints.ContainsKey(typeof(SinkType).GUID)) 47 | { 48 | throw new ArgumentException("EventSource guid already added to the list of connection points", "source"); 49 | } 50 | connectionPoints.Add(typeof(SinkType).GUID, new ConnectionPoint(this, source)); 51 | } 52 | 53 | #region IConnectionPointContainer Members 54 | void IConnectionPointContainer.EnumConnectionPoints(out IEnumConnectionPoints ppEnum) 55 | { 56 | throw new NotImplementedException(); ; 57 | } 58 | void IConnectionPointContainer.FindConnectionPoint(ref Guid riid, out IConnectionPoint ppCP) 59 | { 60 | ppCP = connectionPoints[riid]; 61 | } 62 | #endregion 63 | } 64 | 65 | internal class ConnectionPoint : IConnectionPoint 66 | where SinkType : class 67 | { 68 | Dictionary sinks; 69 | private uint nextCookie; 70 | private ConnectionPointContainer container; 71 | private IEventSource source; 72 | internal ConnectionPoint(ConnectionPointContainer container, IEventSource source) 73 | { 74 | if(null == container) 75 | { 76 | throw new ArgumentNullException("container"); 77 | } 78 | if(null == source) 79 | { 80 | throw new ArgumentNullException("source"); 81 | } 82 | this.container = container; 83 | this.source = source; 84 | sinks = new Dictionary(); 85 | nextCookie = 1; 86 | } 87 | #region IConnectionPoint Members 88 | public void Advise(object pUnkSink, out uint pdwCookie) 89 | { 90 | SinkType sink = pUnkSink as SinkType; 91 | if(null == sink) 92 | { 93 | Marshal.ThrowExceptionForHR(VSConstants.E_NOINTERFACE); 94 | } 95 | sinks.Add(nextCookie, sink); 96 | pdwCookie = nextCookie; 97 | source.OnSinkAdded(sink); 98 | nextCookie += 1; 99 | } 100 | 101 | public void EnumConnections(out IEnumConnections ppEnum) 102 | { 103 | throw new NotImplementedException(); ; 104 | } 105 | 106 | public void GetConnectionInterface(out Guid pIID) 107 | { 108 | pIID = typeof(SinkType).GUID; 109 | } 110 | 111 | public void GetConnectionPointContainer(out IConnectionPointContainer ppCPC) 112 | { 113 | ppCPC = this.container; 114 | } 115 | 116 | public void Unadvise(uint dwCookie) 117 | { 118 | // This will throw if the cookie is not in the list. 119 | SinkType sink = sinks[dwCookie]; 120 | sinks.Remove(dwCookie); 121 | source.OnSinkRemoved(sink); 122 | } 123 | #endregion 124 | } 125 | } 126 | -------------------------------------------------------------------------------- /Mpf/Misc/ExternDll.cs: -------------------------------------------------------------------------------- 1 | /*************************************************************************** 2 | 3 | Copyright (c) Microsoft Corporation. All rights reserved. 4 | This code is licensed under the Visual Studio SDK license terms. 5 | THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF 6 | ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY 7 | IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR 8 | PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT. 9 | 10 | ***************************************************************************/ 11 | 12 | namespace Microsoft.VisualStudio.Project 13 | { 14 | internal static class ExternDll 15 | { 16 | 17 | #if FEATURE_PAL 18 | 19 | #if !PLATFORM_UNIX 20 | internal const String DLLPREFIX = ""; 21 | internal const String DLLSUFFIX = ".dll"; 22 | #else // !PLATFORM_UNIX 23 | #if __APPLE__ 24 | internal const String DLLPREFIX = "lib"; 25 | internal const String DLLSUFFIX = ".dylib"; 26 | #elif _AIX 27 | internal const String DLLPREFIX = "lib"; 28 | internal const String DLLSUFFIX = ".a"; 29 | #elif __hppa__ || IA64 30 | internal const String DLLPREFIX = "lib"; 31 | internal const String DLLSUFFIX = ".sl"; 32 | #else 33 | internal const String DLLPREFIX = "lib"; 34 | internal const String DLLSUFFIX = ".so"; 35 | #endif 36 | #endif // !PLATFORM_UNIX 37 | 38 | public const string Kernel32 = DLLPREFIX + "rotor_pal" + DLLSUFFIX; 39 | public const string User32 = DLLPREFIX + "rotor_pal" + DLLSUFFIX; 40 | public const string Mscoree = DLLPREFIX + "sscoree" + DLLSUFFIX; 41 | #else 42 | public const string Activeds = "activeds.dll"; 43 | public const string Advapi32 = "advapi32.dll"; 44 | public const string Comctl32 = "comctl32.dll"; 45 | public const string Comdlg32 = "comdlg32.dll"; 46 | public const string Gdi32 = "gdi32.dll"; 47 | public const string Gdiplus = "gdiplus.dll"; 48 | public const string Hhctrl = "hhctrl.ocx"; 49 | public const string Imm32 = "imm32.dll"; 50 | public const string Kernel32 = "kernel32.dll"; 51 | public const string Loadperf = "Loadperf.dll"; 52 | public const string Mscoree = "mscoree.dll"; 53 | public const string Mscorwks = "mscorwks.dll"; 54 | public const string Msi = "msi.dll"; 55 | public const string Mqrt = "mqrt.dll"; 56 | public const string Ntdll = "ntdll.dll"; 57 | public const string Ole32 = "ole32.dll"; 58 | public const string Oleacc = "oleacc.dll"; 59 | public const string Oleaut32 = "oleaut32.dll"; 60 | public const string Olepro32 = "olepro32.dll"; 61 | public const string PerfCounter = "perfcounter.dll"; 62 | public const string Powrprof = "Powrprof.dll"; 63 | public const string Psapi = "psapi.dll"; 64 | public const string Shell32 = "shell32.dll"; 65 | public const string Shfolder = "shfolder.dll"; 66 | public const string User32 = "user32.dll"; 67 | public const string Uxtheme = "uxtheme.dll"; 68 | public const string WinMM = "winmm.dll"; 69 | public const string Winspool = "winspool.drv"; 70 | public const string Wtsapi32 = "wtsapi32.dll"; 71 | public const string Version = "version.dll"; 72 | public const string Vsassert = "vsassert.dll"; 73 | public const string Shlwapi = "shlwapi.dll"; 74 | public const string Crypt32 = "crypt32.dll"; 75 | 76 | // system.data specific 77 | internal const string Odbc32 = "odbc32.dll"; 78 | internal const string SNI = "System.Data.dll"; 79 | 80 | // system.data.oracleclient specific 81 | internal const string OciDll = "oci.dll"; 82 | internal const string OraMtsDll = "oramts.dll"; 83 | #endif //!FEATURE_PAL 84 | } 85 | } 86 | -------------------------------------------------------------------------------- /Mpf/Misc/UnsafeNativeMethods.cs: -------------------------------------------------------------------------------- 1 | /*************************************************************************** 2 | 3 | Copyright (c) Microsoft Corporation. All rights reserved. 4 | This code is licensed under the Visual Studio SDK license terms. 5 | THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF 6 | ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY 7 | IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR 8 | PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT. 9 | 10 | ***************************************************************************/ 11 | 12 | using System; 13 | using System.Runtime.InteropServices; 14 | 15 | namespace Microsoft.VisualStudio.Project 16 | { 17 | internal static class UnsafeNativeMethods 18 | { 19 | [DllImport(ExternDll.Kernel32, EntryPoint = "GlobalLock", SetLastError = true, CharSet = CharSet.Unicode, ExactSpelling = true, CallingConvention = CallingConvention.StdCall)] 20 | internal static extern IntPtr GlobalLock(IntPtr h); 21 | 22 | [DllImport(ExternDll.Kernel32, EntryPoint = "GlobalUnlock", SetLastError = true, CharSet = CharSet.Unicode, ExactSpelling = true, CallingConvention = CallingConvention.StdCall)] 23 | internal static extern bool GlobalUnLock(IntPtr h); 24 | 25 | [DllImport(ExternDll.Kernel32, EntryPoint = "GlobalSize", SetLastError = true, CharSet = CharSet.Unicode, ExactSpelling = true, CallingConvention = CallingConvention.StdCall)] 26 | internal static extern int GlobalSize(IntPtr h); 27 | 28 | [DllImport(ExternDll.Ole32, ExactSpelling = true, CharSet = CharSet.Unicode)] 29 | internal static extern int OleSetClipboard(Microsoft.VisualStudio.OLE.Interop.IDataObject dataObject); 30 | 31 | [DllImport(ExternDll.Ole32, ExactSpelling = true, CharSet = CharSet.Unicode)] 32 | internal static extern int OleGetClipboard(out Microsoft.VisualStudio.OLE.Interop.IDataObject dataObject); 33 | 34 | [DllImport(ExternDll.Ole32, ExactSpelling = true, CharSet = CharSet.Unicode)] 35 | internal static extern int OleFlushClipboard(); 36 | 37 | [DllImport(ExternDll.User32, ExactSpelling = true, CharSet = CharSet.Unicode)] 38 | internal static extern int OpenClipboard(IntPtr newOwner); 39 | 40 | [DllImport(ExternDll.User32, ExactSpelling = true, CharSet = CharSet.Unicode)] 41 | internal static extern int EmptyClipboard(); 42 | 43 | [DllImport(ExternDll.User32, ExactSpelling = true, CharSet = CharSet.Unicode)] 44 | internal static extern int CloseClipboard(); 45 | 46 | [DllImport(ExternDll.Comctl32, CharSet = CharSet.Auto)] 47 | internal static extern int ImageList_GetImageCount(HandleRef himl); 48 | 49 | [DllImport(ExternDll.Comctl32, CharSet = CharSet.Auto)] 50 | internal static extern bool ImageList_Draw(HandleRef himl, int i, HandleRef hdcDst, int x, int y, int fStyle); 51 | 52 | [DllImport(ExternDll.Shell32, EntryPoint = "DragQueryFileW", SetLastError = true, CharSet = CharSet.Unicode, ExactSpelling = true, CallingConvention = CallingConvention.StdCall)] 53 | internal static extern uint DragQueryFile(IntPtr hDrop, uint iFile, char[] lpszFile, uint cch); 54 | 55 | [DllImport(ExternDll.User32, EntryPoint = "RegisterClipboardFormatW", SetLastError = true, CharSet = CharSet.Unicode, ExactSpelling = true, CallingConvention = CallingConvention.StdCall)] 56 | internal static extern ushort RegisterClipboardFormat(string format); 57 | 58 | [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode"), DllImport(ExternDll.Shell32, EntryPoint = "SHGetSpecialFolderLocation")] 59 | internal static extern int SHGetSpecialFolderLocation(IntPtr hwnd, int csidl, [Out, MarshalAs(UnmanagedType.LPArray)] IntPtr[] ppidl); 60 | 61 | [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode"), DllImport(ExternDll.Shell32, EntryPoint = "SHGetPathFromIDList", CharSet = System.Runtime.InteropServices.CharSet.Auto)] 62 | internal static extern bool SHGetPathFromIDList(IntPtr pidl, IntPtr pszPath); 63 | } 64 | } 65 | 66 | -------------------------------------------------------------------------------- /Mpf/NestedProjectBuildDependency.cs: -------------------------------------------------------------------------------- 1 | /*************************************************************************** 2 | 3 | Copyright (c) Microsoft Corporation. All rights reserved. 4 | This code is licensed under the Visual Studio SDK license terms. 5 | THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF 6 | ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY 7 | IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR 8 | PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT. 9 | 10 | ***************************************************************************/ 11 | 12 | using System; 13 | using Microsoft.VisualStudio; 14 | using Microsoft.VisualStudio.Shell.Interop; 15 | 16 | namespace Microsoft.VisualStudio.Project 17 | { 18 | /// 19 | /// Used for adding a build dependency to nested project (not a real project reference) 20 | /// 21 | public class NestedProjectBuildDependency : IVsBuildDependency 22 | { 23 | IVsHierarchy dependentHierarchy = null; 24 | 25 | #region ctors 26 | [CLSCompliant(false)] 27 | public NestedProjectBuildDependency(IVsHierarchy dependentHierarchy) 28 | { 29 | this.dependentHierarchy = dependentHierarchy; 30 | } 31 | #endregion 32 | 33 | #region IVsBuildDependency methods 34 | public int get_CanonicalName(out string canonicalName) 35 | { 36 | canonicalName = null; 37 | return VSConstants.S_OK; 38 | } 39 | 40 | public int get_Type(out System.Guid guidType) 41 | { 42 | // All our dependencies are build projects 43 | guidType = VSConstants.GUID_VS_DEPTYPE_BUILD_PROJECT; 44 | 45 | return VSConstants.S_OK; 46 | } 47 | 48 | public int get_Description(out string description) 49 | { 50 | description = null; 51 | return VSConstants.S_OK; 52 | } 53 | 54 | [CLSCompliant(false)] 55 | public int get_HelpContext(out uint helpContext) 56 | { 57 | helpContext = 0; 58 | return VSConstants.E_NOTIMPL; 59 | } 60 | 61 | public int get_HelpFile(out string helpFile) 62 | { 63 | helpFile = null; 64 | return VSConstants.E_NOTIMPL; 65 | } 66 | 67 | public int get_MustUpdateBefore(out int mustUpdateBefore) 68 | { 69 | // Must always update dependencies 70 | mustUpdateBefore = 1; 71 | 72 | return VSConstants.S_OK; 73 | } 74 | 75 | public int get_ReferredProject(out object unknownProject) 76 | { 77 | unknownProject = this.dependentHierarchy; 78 | 79 | return (unknownProject == null) ? VSConstants.E_FAIL : VSConstants.S_OK; 80 | } 81 | #endregion 82 | 83 | } 84 | } 85 | -------------------------------------------------------------------------------- /Mpf/Output.cs: -------------------------------------------------------------------------------- 1 | /*************************************************************************** 2 | 3 | Copyright (c) Microsoft Corporation. All rights reserved. 4 | This code is licensed under the Visual Studio SDK license terms. 5 | THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF 6 | ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY 7 | IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR 8 | PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT. 9 | 10 | ***************************************************************************/ 11 | 12 | using System; 13 | using System.Diagnostics; 14 | using Microsoft.VisualStudio; 15 | using Microsoft.VisualStudio.Shell; 16 | using Microsoft.VisualStudio.Shell.Interop; 17 | using Microsoft.Build.Execution; 18 | 19 | namespace Microsoft.VisualStudio.Project 20 | { 21 | class Output : IVsOutput2 22 | { 23 | private ProjectNode project; 24 | private ProjectItemInstance output; 25 | 26 | /// 27 | /// Constructor for IVSOutput2 implementation 28 | /// 29 | /// Project that produce this output 30 | /// MSBuild generated item corresponding to the output assembly (by default, these would be of type MainAssembly 31 | public Output(ProjectNode projectManager, ProjectItemInstance outputAssembly) 32 | { 33 | if(projectManager == null) 34 | throw new ArgumentNullException("projectManager"); 35 | if(outputAssembly == null) 36 | throw new ArgumentNullException("outputAssembly"); 37 | 38 | project = projectManager; 39 | output = outputAssembly; 40 | } 41 | 42 | #region IVsOutput2 Members 43 | 44 | public int get_CanonicalName(out string pbstrCanonicalName) 45 | { 46 | // Get the output assembly path (including the name) 47 | pbstrCanonicalName = output.GetMetadataValue(ProjectFileConstants.FinalOutputPath); 48 | Debug.Assert(!String.IsNullOrEmpty(pbstrCanonicalName), "Output Assembly not defined"); 49 | 50 | // Make sure we have a full path 51 | if(!System.IO.Path.IsPathRooted(pbstrCanonicalName)) 52 | { 53 | pbstrCanonicalName = new Url(project.BaseURI, pbstrCanonicalName).AbsoluteUrl; 54 | } 55 | return VSConstants.S_OK; 56 | } 57 | 58 | /// 59 | /// This path must start with file:/// if it wants other project 60 | /// to be able to reference the output on disk. 61 | /// If the output is not on disk, then this requirement does not 62 | /// apply as other projects probably don't know how to access it. 63 | /// 64 | public virtual int get_DeploySourceURL(out string pbstrDeploySourceURL) 65 | { 66 | string path = output.GetMetadataValue(ProjectFileConstants.FinalOutputPath); 67 | if(string.IsNullOrEmpty(path)) 68 | { 69 | throw new InvalidOperationException(); 70 | } 71 | if(path.Length < 9 || String.Compare(path.Substring(0, 8), "file:///", StringComparison.OrdinalIgnoreCase) != 0) 72 | path = "file:///" + path; // TODO: does not work with '#' char, see e.g. bug 641942 73 | pbstrDeploySourceURL = path; 74 | return VSConstants.S_OK; 75 | } 76 | 77 | public int get_DisplayName(out string pbstrDisplayName) 78 | { 79 | return this.get_CanonicalName(out pbstrDisplayName); 80 | } 81 | 82 | public virtual int get_Property(string szProperty, out object pvar) 83 | { 84 | if (string.IsNullOrEmpty(szProperty)) 85 | { 86 | pvar = null; 87 | return VSConstants.E_INVALIDARG; 88 | } 89 | 90 | if (string.Equals(szProperty, "OUTPUTLOC", StringComparison.OrdinalIgnoreCase)) 91 | { 92 | szProperty = ProjectFileConstants.FinalOutputPath; 93 | } 94 | 95 | string value = output.GetMetadataValue(szProperty); 96 | pvar = value; 97 | 98 | // If we don't have a value, we are expected to return unimplemented 99 | if (string.IsNullOrEmpty(value)) 100 | { 101 | return VSConstants.E_NOTIMPL; 102 | } 103 | 104 | // Special hack for COM2REG property: it's a bool rather than a string, and always true, for some reason. 105 | if (string.Equals(szProperty, "COM2REG", StringComparison.OrdinalIgnoreCase)) 106 | { 107 | pvar = true; 108 | } 109 | 110 | return VSConstants.S_OK; 111 | } 112 | 113 | public int get_RootRelativeURL(out string pbstrRelativePath) 114 | { 115 | pbstrRelativePath = String.Empty; 116 | object variant; 117 | // get the corresponding property 118 | 119 | if(ErrorHandler.Succeeded(this.get_Property("TargetPath", out variant))) 120 | { 121 | string var = variant as String; 122 | 123 | if(var != null) 124 | { 125 | pbstrRelativePath = var; 126 | } 127 | } 128 | 129 | return VSConstants.S_OK; 130 | } 131 | 132 | public virtual int get_Type(out Guid pguidType) 133 | { 134 | pguidType = Guid.Empty; 135 | throw new NotImplementedException(); 136 | } 137 | 138 | #endregion 139 | } 140 | } 141 | -------------------------------------------------------------------------------- /Mpf/ProjectDesignerDocumentManager.cs: -------------------------------------------------------------------------------- 1 | /*************************************************************************** 2 | 3 | Copyright (c) Microsoft Corporation. All rights reserved. 4 | This code is licensed under the Visual Studio SDK license terms. 5 | THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF 6 | ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY 7 | IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR 8 | PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT. 9 | 10 | ***************************************************************************/ 11 | 12 | using System; 13 | using System.Diagnostics; 14 | using Microsoft.VisualStudio; 15 | using Microsoft.VisualStudio.Shell.Interop; 16 | using IOleServiceProvider = Microsoft.VisualStudio.OLE.Interop.IServiceProvider; 17 | 18 | namespace Microsoft.VisualStudio.Project 19 | { 20 | class ProjectDesignerDocumentManager : DocumentManager 21 | { 22 | #region ctors 23 | public ProjectDesignerDocumentManager(ProjectNode node) 24 | : base(node) 25 | { 26 | } 27 | #endregion 28 | 29 | #region overriden methods 30 | 31 | public override int Open(ref Guid logicalView, IntPtr docDataExisting, out IVsWindowFrame windowFrame, WindowFrameShowAction windowFrameAction) 32 | { 33 | Guid editorGuid = VSConstants.GUID_ProjectDesignerEditor; 34 | return this.OpenWithSpecific(0, ref editorGuid, String.Empty, ref logicalView, docDataExisting, out windowFrame, windowFrameAction); 35 | } 36 | 37 | public override int OpenWithSpecific(uint editorFlags, ref Guid editorType, string physicalView, ref Guid logicalView, IntPtr docDataExisting, out IVsWindowFrame frame, WindowFrameShowAction windowFrameAction) 38 | { 39 | frame = null; 40 | Debug.Assert(editorType == VSConstants.GUID_ProjectDesignerEditor, "Cannot open project designer with guid " + editorType.ToString()); 41 | 42 | 43 | if(this.Node == null || this.Node.ProjectMgr == null || this.Node.ProjectMgr.IsClosed) 44 | { 45 | return VSConstants.E_FAIL; 46 | } 47 | 48 | IVsUIShellOpenDocument uiShellOpenDocument = this.Node.ProjectMgr.Site.GetService(typeof(SVsUIShellOpenDocument)) as IVsUIShellOpenDocument; 49 | IOleServiceProvider serviceProvider = this.Node.ProjectMgr.Site.GetService(typeof(IOleServiceProvider)) as IOleServiceProvider; 50 | 51 | if(serviceProvider != null && uiShellOpenDocument != null) 52 | { 53 | string fullPath = this.GetFullPathForDocument(); 54 | string caption = this.GetOwnerCaption(); 55 | 56 | IVsUIHierarchy parentHierarchy = this.Node.ProjectMgr.GetProperty((int)__VSHPROPID.VSHPROPID_ParentHierarchy) as IVsUIHierarchy; 57 | 58 | int parentHierarchyItemId = (int)this.Node.ProjectMgr.GetProperty((int)__VSHPROPID.VSHPROPID_ParentHierarchyItemid); 59 | 60 | ErrorHandler.ThrowOnFailure(uiShellOpenDocument.OpenSpecificEditor(editorFlags, fullPath, ref editorType, physicalView, ref logicalView, caption, parentHierarchy, (uint)parentHierarchyItemId, docDataExisting, serviceProvider, out frame)); 61 | 62 | if(frame != null) 63 | { 64 | if(windowFrameAction == WindowFrameShowAction.Show) 65 | { 66 | ErrorHandler.ThrowOnFailure(frame.Show()); 67 | } 68 | } 69 | } 70 | 71 | return VSConstants.S_OK; 72 | } 73 | #endregion 74 | 75 | } 76 | } 77 | -------------------------------------------------------------------------------- /Mpf/ProjectNode.Events.cs: -------------------------------------------------------------------------------- 1 | /*************************************************************************** 2 | 3 | Copyright (c) Microsoft Corporation. All rights reserved. 4 | This code is licensed under the Visual Studio SDK license terms. 5 | THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF 6 | ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY 7 | IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR 8 | PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT. 9 | 10 | ***************************************************************************/ 11 | 12 | using System; 13 | 14 | namespace Microsoft.VisualStudio.Project 15 | { 16 | public partial class ProjectNode 17 | { 18 | #region fields 19 | private EventHandler projectPropertiesListeners; 20 | #endregion 21 | 22 | #region events 23 | public event EventHandler OnProjectPropertyChanged 24 | { 25 | add { projectPropertiesListeners += value; } 26 | remove { projectPropertiesListeners -= value; } 27 | } 28 | #endregion 29 | 30 | #region methods 31 | [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1030:UseEventsWhereAppropriate")] 32 | protected void RaiseProjectPropertyChanged(string propertyName, string oldValue, string newValue) 33 | { 34 | if(null != projectPropertiesListeners) 35 | { 36 | projectPropertiesListeners(this, new ProjectPropertyChangedArgs(propertyName, oldValue, newValue)); 37 | } 38 | } 39 | #endregion 40 | } 41 | 42 | } -------------------------------------------------------------------------------- /Mpf/ProjectNode.cs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/brentspell/NuBuild/d6b6088758eda10bd412eae8ce5bbed5b1cd3565/Mpf/ProjectNode.cs -------------------------------------------------------------------------------- /Mpf/ProjectOptions.cs: -------------------------------------------------------------------------------- 1 | /*************************************************************************** 2 | 3 | Copyright (c) Microsoft Corporation. All rights reserved. 4 | This code is licensed under the Visual Studio SDK license terms. 5 | THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF 6 | ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY 7 | IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR 8 | PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT. 9 | 10 | ***************************************************************************/ 11 | 12 | using System.Collections.Specialized; 13 | using System.Diagnostics.CodeAnalysis; 14 | using System.Runtime.Versioning; 15 | 16 | namespace Microsoft.VisualStudio.Project 17 | { 18 | public class ProjectOptions : System.CodeDom.Compiler.CompilerParameters 19 | { 20 | public string Config { get; set; } 21 | 22 | public ModuleKindFlags ModuleKind { get; set; } 23 | 24 | public bool EmitManifest { get; set; } 25 | 26 | [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")] 27 | public StringCollection DefinedPreprocessorSymbols { get; set; } 28 | 29 | public string XmlDocFileName { get; set; } 30 | 31 | public string RecursiveWildcard { get; set; } 32 | 33 | [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")] 34 | public StringCollection ReferencedModules { get; set; } 35 | 36 | public string Win32Icon { get; set; } 37 | 38 | public bool PdbOnly { get; set; } 39 | 40 | public bool Optimize { get; set; } 41 | 42 | public bool IncrementalCompile { get; set; } 43 | 44 | [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Performance", "CA1819:PropertiesShouldNotReturnArrays")] 45 | public int[] SuppressedWarnings { get; set; } 46 | 47 | public bool CheckedArithmetic { get; set; } 48 | 49 | public bool AllowUnsafeCode { get; set; } 50 | 51 | public bool DisplayCommandLineHelp { get; set; } 52 | 53 | public bool SuppressLogo { get; set; } 54 | 55 | public long BaseAddress { get; set; } 56 | 57 | public string BugReportFileName { get; set; } 58 | 59 | /// must be an int if not null 60 | public object CodePage { get; set; } 61 | 62 | public bool EncodeOutputInUtf8 { get; set; } 63 | 64 | public bool FullyQualifyPaths { get; set; } 65 | 66 | public int FileAlignment { get; set; } 67 | 68 | public bool NoStandardLibrary { get; set; } 69 | 70 | [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")] 71 | public StringCollection AdditionalSearchPaths { get; set; } 72 | 73 | public bool HeuristicReferenceResolution { get; set; } 74 | 75 | public string RootNamespace { get; set; } 76 | 77 | public bool CompileAndExecute { get; set; } 78 | 79 | /// must be an int if not null. 80 | public object UserLocaleId { get; set; } 81 | 82 | public FrameworkName TargetFrameworkMoniker { get; set; } 83 | 84 | public ProjectOptions() 85 | { 86 | EmitManifest = true; 87 | ModuleKind = ModuleKindFlags.ConsoleApplication; 88 | } 89 | 90 | public virtual string GetOptionHelp() 91 | { 92 | return null; 93 | } 94 | } 95 | } 96 | -------------------------------------------------------------------------------- /Mpf/ProjectPackage.cs: -------------------------------------------------------------------------------- 1 | /*************************************************************************** 2 | 3 | Copyright (c) Microsoft Corporation. All rights reserved. 4 | This code is licensed under the Visual Studio SDK license terms. 5 | THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF 6 | ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY 7 | IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR 8 | PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT. 9 | 10 | ***************************************************************************/ 11 | 12 | using System; 13 | using System.Collections.Generic; 14 | using System.Globalization; 15 | using System.IO; 16 | using System.Runtime.InteropServices; 17 | using Microsoft.VisualStudio; 18 | using Microsoft.VisualStudio.Shell.Interop; 19 | 20 | namespace Microsoft.VisualStudio.Project 21 | { 22 | /// 23 | /// Defines abstract package. 24 | /// 25 | [ComVisible(true)] 26 | [CLSCompliant(false)] 27 | public abstract class ProjectPackage : Microsoft.VisualStudio.Shell.Package 28 | { 29 | #region fields 30 | /// 31 | /// This is the place to register all the solution listeners. 32 | /// 33 | private List solutionListeners = new List(); 34 | #endregion 35 | 36 | #region properties 37 | /// 38 | /// Add your listener to this list. They should be added in the overridden Initialize befaore calling the base. 39 | /// 40 | protected internal IList SolutionListeners 41 | { 42 | get 43 | { 44 | return this.solutionListeners; 45 | } 46 | } 47 | 48 | public abstract string ProductUserContext { get; } 49 | 50 | #endregion 51 | 52 | #region methods 53 | protected override void Initialize() 54 | { 55 | base.Initialize(); 56 | 57 | // Subscribe to the solution events 58 | this.solutionListeners.Add(new SolutionListenerForProjectReferenceUpdate(this)); 59 | this.solutionListeners.Add(new SolutionListenerForProjectOpen(this)); 60 | this.solutionListeners.Add(new SolutionListenerForBuildDependencyUpdate(this)); 61 | this.solutionListeners.Add(new SolutionListenerForProjectEvents(this)); 62 | 63 | foreach(SolutionListener solutionListener in this.solutionListeners) 64 | { 65 | solutionListener.Init(); 66 | } 67 | } 68 | 69 | protected override void Dispose(bool disposing) 70 | { 71 | // Unadvise solution listeners. 72 | try 73 | { 74 | if(disposing) 75 | { 76 | foreach(SolutionListener solutionListener in this.solutionListeners) 77 | { 78 | solutionListener.Dispose(); 79 | } 80 | 81 | // Dispose the UIThread singleton. 82 | UIThread.Instance.Dispose(); 83 | } 84 | } 85 | finally 86 | { 87 | 88 | base.Dispose(disposing); 89 | } 90 | } 91 | #endregion 92 | } 93 | } 94 | -------------------------------------------------------------------------------- /Mpf/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Diagnostics; 3 | using System.Reflection; 4 | using System.Runtime.InteropServices; 5 | using System.Security.Permissions; 6 | using System.Resources; 7 | 8 | [assembly: AssemblyTitle("Microsoft.VisualStudio.Project")] 9 | [assembly: AssemblyDescription("MPF Implementation of VS Projects")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("Microsoft")] 12 | [assembly: AssemblyProduct("Microsoft.VisualStudio.Project")] 13 | [assembly: AssemblyCopyright("Copyright © Microsoft 2009")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | [assembly: ComVisible(false)] 18 | [assembly: CLSCompliant(false)] 19 | 20 | [assembly: Guid("084954ec-af04-4ea3-b166-b1fced604dc8")] 21 | 22 | [assembly: AssemblyVersion("1.0.0.0")] 23 | [assembly: AssemblyFileVersion("1.0.0.0")] 24 | 25 | [assembly: NeutralResourcesLanguageAttribute("en")] 26 | -------------------------------------------------------------------------------- /Mpf/PropertiesEditorLauncher.cs: -------------------------------------------------------------------------------- 1 | /*************************************************************************** 2 | 3 | Copyright (c) Microsoft Corporation. All rights reserved. 4 | This code is licensed under the Visual Studio SDK license terms. 5 | THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF 6 | ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY 7 | IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR 8 | PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT. 9 | 10 | ***************************************************************************/ 11 | 12 | using System; 13 | using System.ComponentModel; 14 | using Microsoft.VisualStudio.Shell; 15 | using Microsoft.VisualStudio.Shell.Interop; 16 | using ErrorHandler = Microsoft.VisualStudio.ErrorHandler; 17 | 18 | namespace Microsoft.VisualStudio.Project 19 | { 20 | /// 21 | /// This class is used to enable launching the project properties 22 | /// editor from the Properties Browser. 23 | /// 24 | [CLSCompliant(false)] 25 | public class PropertiesEditorLauncher : ComponentEditor 26 | { 27 | private ServiceProvider serviceProvider; 28 | 29 | #region ctor 30 | public PropertiesEditorLauncher(ServiceProvider serviceProvider) 31 | { 32 | if(serviceProvider == null) 33 | throw new ArgumentNullException("serviceProvider"); 34 | 35 | this.serviceProvider = serviceProvider; 36 | } 37 | #endregion 38 | #region overridden methods 39 | /// 40 | /// Launch the Project Properties Editor (properties pages) 41 | /// 42 | /// If we succeeded or not 43 | public override bool EditComponent(ITypeDescriptorContext context, object component) 44 | { 45 | if(component is ProjectNodeProperties) 46 | { 47 | IVsPropertyPageFrame propertyPageFrame = (IVsPropertyPageFrame)serviceProvider.GetService((typeof(SVsPropertyPageFrame))); 48 | 49 | int hr = propertyPageFrame.ShowFrame(Guid.Empty); 50 | if(ErrorHandler.Succeeded(hr)) 51 | return true; 52 | else 53 | ErrorHandler.ThrowOnFailure(propertyPageFrame.ReportError(hr)); 54 | } 55 | 56 | return false; 57 | } 58 | #endregion 59 | 60 | } 61 | } 62 | -------------------------------------------------------------------------------- /Mpf/Resources/imagelis.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/brentspell/NuBuild/d6b6088758eda10bd412eae8ce5bbed5b1cd3565/Mpf/Resources/imagelis.bmp -------------------------------------------------------------------------------- /Mpf/SelectionListener.cs: -------------------------------------------------------------------------------- 1 | /*************************************************************************** 2 | 3 | Copyright (c) Microsoft Corporation. All rights reserved. 4 | This code is licensed under the Visual Studio SDK license terms. 5 | THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF 6 | ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY 7 | IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR 8 | PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT. 9 | 10 | ***************************************************************************/ 11 | 12 | using System; 13 | using System.Diagnostics; 14 | using Microsoft.VisualStudio; 15 | using Microsoft.VisualStudio.Shell; 16 | using Microsoft.VisualStudio.Shell.Interop; 17 | using ShellConstants = Microsoft.VisualStudio.Shell.Interop.Constants; 18 | 19 | namespace Microsoft.VisualStudio.Project 20 | { 21 | 22 | [CLSCompliant(false)] 23 | public abstract class SelectionListener : IVsSelectionEvents, IDisposable 24 | { 25 | #region fields 26 | private uint eventsCookie; 27 | private IVsMonitorSelection monSel; 28 | private ServiceProvider serviceProvider; 29 | private bool isDisposed; 30 | /// 31 | /// Defines an object that will be a mutex for this object for synchronizing thread calls. 32 | /// 33 | private static volatile object Mutex = new object(); 34 | #endregion 35 | 36 | #region ctors 37 | protected SelectionListener(ServiceProvider serviceProviderParameter) 38 | { 39 | if (serviceProviderParameter == null) 40 | { 41 | throw new ArgumentNullException("serviceProviderParameter"); 42 | } 43 | 44 | this.serviceProvider = serviceProviderParameter; 45 | this.monSel = this.serviceProvider.GetService(typeof(SVsShellMonitorSelection)) as IVsMonitorSelection; 46 | 47 | if(this.monSel == null) 48 | { 49 | throw new InvalidOperationException(); 50 | } 51 | } 52 | #endregion 53 | 54 | #region properties 55 | protected uint EventsCookie 56 | { 57 | get 58 | { 59 | return this.eventsCookie; 60 | } 61 | } 62 | 63 | protected IVsMonitorSelection SelectionMonitor 64 | { 65 | get 66 | { 67 | return this.monSel; 68 | } 69 | } 70 | 71 | protected ServiceProvider ServiceProvider 72 | { 73 | get 74 | { 75 | return this.serviceProvider; 76 | } 77 | } 78 | #endregion 79 | 80 | #region IVsSelectionEvents Members 81 | 82 | public virtual int OnCmdUIContextChanged(uint dwCmdUICookie, int fActive) 83 | { 84 | return VSConstants.E_NOTIMPL; 85 | } 86 | 87 | public virtual int OnElementValueChanged(uint elementid, object varValueOld, object varValueNew) 88 | { 89 | return VSConstants.E_NOTIMPL; 90 | } 91 | 92 | public virtual int OnSelectionChanged(IVsHierarchy pHierOld, uint itemidOld, IVsMultiItemSelect pMISOld, ISelectionContainer pSCOld, IVsHierarchy pHierNew, uint itemidNew, IVsMultiItemSelect pMISNew, ISelectionContainer pSCNew) 93 | { 94 | return VSConstants.E_NOTIMPL; 95 | } 96 | 97 | #endregion 98 | 99 | #region IDisposable Members 100 | /// 101 | /// The IDispose interface Dispose method for disposing the object determinastically. 102 | /// 103 | public void Dispose() 104 | { 105 | this.Dispose(true); 106 | GC.SuppressFinalize(this); 107 | } 108 | #endregion 109 | 110 | #region methods 111 | public void Init() 112 | { 113 | if(this.SelectionMonitor != null) 114 | { 115 | ErrorHandler.ThrowOnFailure(this.SelectionMonitor.AdviseSelectionEvents(this, out this.eventsCookie)); 116 | } 117 | } 118 | 119 | /// 120 | /// The method that does the cleanup. 121 | /// 122 | /// 123 | [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA1806:DoNotIgnoreMethodResults", MessageId = "Microsoft.VisualStudio.Shell.Interop.IVsMonitorSelection.UnadviseSelectionEvents(System.UInt32)")] 124 | protected virtual void Dispose(bool disposing) 125 | { 126 | // Everybody can go here. 127 | if(!this.isDisposed) 128 | { 129 | // Synchronize calls to the Dispose simulteniously. 130 | lock(Mutex) 131 | { 132 | if(disposing && this.eventsCookie != (uint)ShellConstants.VSCOOKIE_NIL && this.SelectionMonitor != null) 133 | { 134 | this.SelectionMonitor.UnadviseSelectionEvents((uint)this.eventsCookie); 135 | this.eventsCookie = (uint)ShellConstants.VSCOOKIE_NIL; 136 | } 137 | 138 | this.isDisposed = true; 139 | } 140 | } 141 | } 142 | #endregion 143 | 144 | } 145 | } 146 | -------------------------------------------------------------------------------- /Mpf/SolutionListenerForProjectEvents.cs: -------------------------------------------------------------------------------- 1 | /*************************************************************************** 2 | 3 | Copyright (c) Microsoft Corporation. All rights reserved. 4 | This code is licensed under the Visual Studio SDK license terms. 5 | THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF 6 | ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY 7 | IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR 8 | PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT. 9 | 10 | ***************************************************************************/ 11 | 12 | using System; 13 | using Microsoft.VisualStudio; 14 | using Microsoft.VisualStudio.Shell.Interop; 15 | using IServiceProvider = System.IServiceProvider; 16 | 17 | namespace Microsoft.VisualStudio.Project 18 | { 19 | /// 20 | /// This class triggers the project events for "our" hierrachies. 21 | /// 22 | internal class SolutionListenerForProjectEvents : SolutionListener, IProjectEvents 23 | { 24 | #region events 25 | /// Event raised just after the project file opened. 26 | /// 27 | public event EventHandler AfterProjectFileOpened; 28 | 29 | /// 30 | /// Event raised before the project file closed. 31 | /// 32 | public event EventHandler BeforeProjectFileClosed; 33 | #endregion 34 | 35 | #region ctor 36 | internal SolutionListenerForProjectEvents(IServiceProvider serviceProvider) 37 | : base(serviceProvider) 38 | { 39 | } 40 | #endregion 41 | 42 | #region overridden methods 43 | public override int OnAfterOpenProject(IVsHierarchy hierarchy, int added) 44 | { 45 | IProjectEventsListener projectEventListener = hierarchy as IProjectEventsListener; 46 | if(projectEventListener != null && projectEventListener.IsProjectEventsListener) 47 | { 48 | this.RaiseAfterProjectFileOpened((added != 0) ? true : false); 49 | } 50 | 51 | return VSConstants.S_OK; 52 | } 53 | 54 | public override int OnBeforeCloseProject(IVsHierarchy hierarchy, int removed) 55 | { 56 | IProjectEventsListener projectEvents = hierarchy as IProjectEventsListener; 57 | if(projectEvents != null && projectEvents.IsProjectEventsListener) 58 | { 59 | this.RaiseBeforeProjectFileClosed((removed != 0) ? true : false); 60 | } 61 | 62 | return VSConstants.S_OK; 63 | } 64 | #endregion 65 | 66 | #region helpers 67 | /// 68 | /// Raises after project file opened event. 69 | /// 70 | /// True if the project is added to the solution after the solution is opened. false if the project is added to the solution while the solution is being opened. 71 | private void RaiseAfterProjectFileOpened(bool added) 72 | { 73 | // Save event in temporary variable to avoid race condition. 74 | EventHandler tempEvent = this.AfterProjectFileOpened; 75 | if(tempEvent != null) 76 | { 77 | tempEvent(this, new AfterProjectFileOpenedEventArgs(added)); 78 | } 79 | } 80 | 81 | 82 | 83 | 84 | /// 85 | /// Raises the before project file closed event. 86 | /// 87 | /// true if the project was removed from the solution before the solution was closed. false if the project was removed from the solution while the solution was being closed. 88 | private void RaiseBeforeProjectFileClosed(bool removed) 89 | { 90 | // Save event in temporary variable to avoid race condition. 91 | EventHandler tempEvent = this.BeforeProjectFileClosed; 92 | if(tempEvent != null) 93 | { 94 | tempEvent(this, new BeforeProjectFileClosedEventArgs(removed)); 95 | } 96 | } 97 | } 98 | #endregion 99 | } 100 | -------------------------------------------------------------------------------- /Mpf/SolutionListenerForProjectOpen.cs: -------------------------------------------------------------------------------- 1 | /*************************************************************************** 2 | 3 | Copyright (c) Microsoft Corporation. All rights reserved. 4 | This code is licensed under the Visual Studio SDK license terms. 5 | THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF 6 | ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY 7 | IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR 8 | PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT. 9 | 10 | ***************************************************************************/ 11 | 12 | using System; 13 | using System.Diagnostics; 14 | using Microsoft.VisualStudio; 15 | using Microsoft.VisualStudio.Shell.Interop; 16 | using IServiceProvider = System.IServiceProvider; 17 | 18 | namespace Microsoft.VisualStudio.Project 19 | { 20 | 21 | [CLSCompliant(false)] 22 | public class SolutionListenerForProjectOpen : SolutionListener 23 | { 24 | public SolutionListenerForProjectOpen(IServiceProvider serviceProvider) 25 | : base(serviceProvider) 26 | { 27 | } 28 | 29 | public override int OnAfterOpenProject(IVsHierarchy hierarchy, int added) 30 | { 31 | // If this is a new project and our project. We use here that it is only our project that will implemnet the "internal" IBuildDependencyOnProjectContainer. 32 | if(added != 0 && hierarchy is IBuildDependencyUpdate) 33 | { 34 | IVsUIHierarchy uiHierarchy = hierarchy as IVsUIHierarchy; 35 | Debug.Assert(uiHierarchy != null, "The ProjectNode should implement IVsUIHierarchy"); 36 | // Expand and select project node 37 | IVsUIHierarchyWindow uiWindow = UIHierarchyUtilities.GetUIHierarchyWindow(this.ServiceProvider, HierarchyNode.SolutionExplorer); 38 | if(uiWindow != null) 39 | { 40 | __VSHIERARCHYITEMSTATE state; 41 | uint stateAsInt; 42 | if(uiWindow.GetItemState(uiHierarchy, VSConstants.VSITEMID_ROOT, (uint)__VSHIERARCHYITEMSTATE.HIS_Expanded, out stateAsInt) == VSConstants.S_OK) 43 | { 44 | state = (__VSHIERARCHYITEMSTATE)stateAsInt; 45 | if(state != __VSHIERARCHYITEMSTATE.HIS_Expanded) 46 | { 47 | int hr; 48 | hr = uiWindow.ExpandItem(uiHierarchy, VSConstants.VSITEMID_ROOT, EXPANDFLAGS.EXPF_ExpandParentsToShowItem); 49 | if(ErrorHandler.Failed(hr)) 50 | Trace.WriteLine("Failed to expand project node"); 51 | hr = uiWindow.ExpandItem(uiHierarchy, VSConstants.VSITEMID_ROOT, EXPANDFLAGS.EXPF_SelectItem); 52 | if(ErrorHandler.Failed(hr)) 53 | Trace.WriteLine("Failed to select project node"); 54 | 55 | return hr; 56 | } 57 | } 58 | } 59 | } 60 | return VSConstants.S_OK; 61 | } 62 | } 63 | } 64 | -------------------------------------------------------------------------------- /Mpf/SuspendFileChanges.cs: -------------------------------------------------------------------------------- 1 | /*************************************************************************** 2 | 3 | Copyright (c) Microsoft Corporation. All rights reserved. 4 | This code is licensed under the Visual Studio SDK license terms. 5 | THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF 6 | ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY 7 | IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR 8 | PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT. 9 | 10 | ***************************************************************************/ 11 | 12 | using System; 13 | using System.Diagnostics; 14 | using System.Runtime.InteropServices; 15 | using Microsoft.VisualStudio; 16 | using Microsoft.VisualStudio.Shell.Interop; 17 | using IServiceProvider = System.IServiceProvider; 18 | using ShellConstants = Microsoft.VisualStudio.Shell.Interop.Constants; 19 | 20 | namespace Microsoft.VisualStudio.Project 21 | { 22 | /// 23 | /// helper to make the editor ignore external changes 24 | /// 25 | internal class SuspendFileChanges 26 | { 27 | private string documentFileName; 28 | 29 | private bool isSuspending; 30 | 31 | private IServiceProvider site; 32 | 33 | private IVsDocDataFileChangeControl fileChangeControl; 34 | 35 | public SuspendFileChanges(IServiceProvider site, string document) 36 | { 37 | this.site = site; 38 | this.documentFileName = document; 39 | } 40 | 41 | 42 | [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Performance", "CA1800:DoNotCastUnnecessarily")] 43 | public void Suspend() 44 | { 45 | if(this.isSuspending) 46 | return; 47 | 48 | IntPtr docData = IntPtr.Zero; 49 | try 50 | { 51 | IVsRunningDocumentTable rdt = this.site.GetService(typeof(SVsRunningDocumentTable)) as IVsRunningDocumentTable; 52 | 53 | IVsHierarchy hierarchy; 54 | uint itemId; 55 | uint docCookie; 56 | IVsFileChangeEx fileChange; 57 | 58 | 59 | if(rdt == null) return; 60 | 61 | ErrorHandler.ThrowOnFailure(rdt.FindAndLockDocument((uint)_VSRDTFLAGS.RDT_NoLock, this.documentFileName, out hierarchy, out itemId, out docData, out docCookie)); 62 | 63 | if((docCookie == (uint)ShellConstants.VSDOCCOOKIE_NIL) || docData == IntPtr.Zero) 64 | return; 65 | 66 | fileChange = this.site.GetService(typeof(SVsFileChangeEx)) as IVsFileChangeEx; 67 | 68 | if(fileChange != null) 69 | { 70 | this.isSuspending = true; 71 | ErrorHandler.ThrowOnFailure(fileChange.IgnoreFile(0, this.documentFileName, 1)); 72 | if(docData != IntPtr.Zero) 73 | { 74 | IVsPersistDocData persistDocData = null; 75 | 76 | // if interface is not supported, return null 77 | object unknown = Marshal.GetObjectForIUnknown(docData); 78 | if(unknown is IVsPersistDocData) 79 | { 80 | persistDocData = (IVsPersistDocData)unknown; 81 | if(persistDocData is IVsDocDataFileChangeControl) 82 | { 83 | this.fileChangeControl = (IVsDocDataFileChangeControl)persistDocData; 84 | if(this.fileChangeControl != null) 85 | { 86 | ErrorHandler.ThrowOnFailure(this.fileChangeControl.IgnoreFileChanges(1)); 87 | } 88 | } 89 | } 90 | } 91 | } 92 | } 93 | catch(InvalidCastException e) 94 | { 95 | Trace.WriteLine("Exception" + e.Message); 96 | } 97 | finally 98 | { 99 | if(docData != IntPtr.Zero) 100 | { 101 | Marshal.Release(docData); 102 | } 103 | } 104 | return; 105 | } 106 | 107 | public void Resume() 108 | { 109 | if(!this.isSuspending) 110 | return; 111 | IVsFileChangeEx fileChange; 112 | fileChange = this.site.GetService(typeof(SVsFileChangeEx)) as IVsFileChangeEx; 113 | if(fileChange != null) 114 | { 115 | this.isSuspending = false; 116 | ErrorHandler.ThrowOnFailure(fileChange.IgnoreFile(0, this.documentFileName, 0)); 117 | if(this.fileChangeControl != null) 118 | { 119 | ErrorHandler.ThrowOnFailure(this.fileChangeControl.IgnoreFileChanges(0)); 120 | } 121 | } 122 | } 123 | } 124 | } 125 | -------------------------------------------------------------------------------- /Mpf/Tracing.cs: -------------------------------------------------------------------------------- 1 | /*************************************************************************** 2 | 3 | Copyright (c) Microsoft Corporation. All rights reserved. 4 | This code is licensed under the Visual Studio SDK license terms. 5 | THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF 6 | ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY 7 | IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR 8 | PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT. 9 | 10 | ***************************************************************************/ 11 | 12 | using System.Diagnostics; 13 | 14 | namespace Microsoft.VisualStudio.Project 15 | { 16 | internal class CCITracing 17 | { 18 | private CCITracing() { } 19 | 20 | [ConditionalAttribute("Enable_CCIDiagnostics")] 21 | static void InternalTraceCall(int levels) 22 | { 23 | System.Diagnostics.StackFrame stack; 24 | stack = new System.Diagnostics.StackFrame(levels); 25 | System.Reflection.MethodBase method = stack.GetMethod(); 26 | if(method != null) 27 | { 28 | string name = method.Name + " \tin class " + method.DeclaringType.Name; 29 | System.Diagnostics.Trace.WriteLine("Call Trace: \t" + name); 30 | } 31 | } 32 | 33 | [ConditionalAttribute("CCI_TRACING")] 34 | static public void TraceCall() 35 | { 36 | // skip this one as well 37 | CCITracing.InternalTraceCall(2); 38 | } 39 | 40 | [ConditionalAttribute("CCI_TRACING")] 41 | static public void TraceCall(string strParameters) 42 | { 43 | CCITracing.InternalTraceCall(2); 44 | System.Diagnostics.Trace.WriteLine("\tParameters: \t" + strParameters); 45 | } 46 | 47 | [ConditionalAttribute("CCI_TRACING")] 48 | static public void Trace(System.Exception e) 49 | { 50 | CCITracing.InternalTraceCall(2); 51 | System.Diagnostics.Trace.WriteLine("ExceptionInfo: \t" + e.ToString()); 52 | } 53 | 54 | [ConditionalAttribute("CCI_TRACING")] 55 | static public void Trace(string strOutput) 56 | { 57 | System.Diagnostics.Trace.WriteLine(strOutput); 58 | } 59 | 60 | [ConditionalAttribute("CCI_TRACING")] 61 | static public void TraceData(string strOutput) 62 | { 63 | System.Diagnostics.Trace.WriteLine("Data Trace: \t" + strOutput); 64 | } 65 | 66 | [ConditionalAttribute("Enable_CCIFileOutput")] 67 | [ConditionalAttribute("CCI_TRACING")] 68 | static public void AddTraceLog(string strFileName) 69 | { 70 | TextWriterTraceListener tw = new TextWriterTraceListener("c:\\mytrace.log"); 71 | System.Diagnostics.Trace.Listeners.Add(tw); 72 | } 73 | } 74 | } 75 | -------------------------------------------------------------------------------- /Mpf/Utilities.cs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/brentspell/NuBuild/d6b6088758eda10bd412eae8ce5bbed5b1cd3565/Mpf/Utilities.cs -------------------------------------------------------------------------------- /Mpf/VSShellUtilities.cs: -------------------------------------------------------------------------------- 1 | /*************************************************************************** 2 | 3 | Copyright (c) Microsoft Corporation. All rights reserved. 4 | This code is licensed under the Visual Studio SDK license terms. 5 | THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF 6 | ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY 7 | IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR 8 | PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT. 9 | 10 | ***************************************************************************/ 11 | 12 | using System; 13 | using System.Diagnostics; 14 | using Microsoft.VisualStudio; 15 | using Microsoft.VisualStudio.Shell.Interop; 16 | 17 | namespace Microsoft.VisualStudio.Project 18 | { 19 | /// 20 | ///This class provides some useful static shell based methods. 21 | /// 22 | [CLSCompliant(false)] 23 | public static class UIHierarchyUtilities 24 | { 25 | /// 26 | /// Get reference to IVsUIHierarchyWindow interface from guid persistence slot. 27 | /// 28 | /// The service provider. 29 | /// Unique identifier for a tool window created using IVsUIShell::CreateToolWindow. 30 | /// The caller of this method can use predefined identifiers that map to tool windows if those tool windows 31 | /// are known to the caller. 32 | /// A reference to an IVsUIHierarchyWindow interface. 33 | public static IVsUIHierarchyWindow GetUIHierarchyWindow(IServiceProvider serviceProvider, Guid persistenceSlot) 34 | { 35 | if(serviceProvider == null) 36 | { 37 | throw new ArgumentNullException("serviceProvider"); 38 | } 39 | 40 | IVsUIShell shell = serviceProvider.GetService(typeof(SVsUIShell)) as IVsUIShell; 41 | 42 | Debug.Assert(shell != null, "Could not get the ui shell from the project"); 43 | if(shell == null) 44 | { 45 | throw new InvalidOperationException(); 46 | } 47 | 48 | object pvar = null; 49 | IVsWindowFrame frame = null; 50 | IVsUIHierarchyWindow uiHierarchyWindow = null; 51 | 52 | try 53 | { 54 | ErrorHandler.ThrowOnFailure(shell.FindToolWindow(0, ref persistenceSlot, out frame)); 55 | ErrorHandler.ThrowOnFailure(frame.GetProperty((int)__VSFPROPID.VSFPROPID_DocView, out pvar)); 56 | } 57 | finally 58 | { 59 | if(pvar != null) 60 | { 61 | uiHierarchyWindow = (IVsUIHierarchyWindow)pvar; 62 | } 63 | } 64 | 65 | return uiHierarchyWindow; 66 | } 67 | } 68 | } 69 | -------------------------------------------------------------------------------- /Mpf/WebProjectBase.Files: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | ProjectBase\Web\CodeBehindCodeGenerator.cs 12 | true 13 | 14 | 15 | ProjectBase\Web\FieldData.cs 16 | true 17 | 18 | 19 | ProjectBase\Web\LockedDocData.cs 20 | true 21 | 22 | 23 | ProjectBase\Web\VsHierarchyItem.cs 24 | true 25 | 26 | 27 | ProjectBase\Web\WAUtilities.cs 28 | true 29 | 30 | 31 | 32 | -------------------------------------------------------------------------------- /NewProj.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/brentspell/NuBuild/d6b6088758eda10bd412eae8ce5bbed5b1cd3565/NewProj.png -------------------------------------------------------------------------------- /NuBuild.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/brentspell/NuBuild/d6b6088758eda10bd412eae8ce5bbed5b1cd3565/NuBuild.png -------------------------------------------------------------------------------- /ProjProp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/brentspell/NuBuild/d6b6088758eda10bd412eae8ce5bbed5b1cd3565/ProjProp.png -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | ![NuBuild](https://raw.githubusercontent.com/bspell1/NuBuild/master/NuBuild.png) NuBuild 2 | ========================================================================= 3 | A NuGet project system for Visual Studio 4 | 5 | Download the latest [version](http://content.brentspell.com/download/nubuild.msi) and check it out on the [gallery](http://visualstudiogallery.msdn.microsoft.com/3efbfdea-7d51-4d45-a954-74a2df51c5d0). 6 | 7 | ##Features## 8 | * Creates a new project type (.nuproj) in Visual Studio, so you can manage your NuGet packages right along with your other projects 9 | * Adds project reference DLLs automatically to the NuGet package, so you don't have to specify them explicitly in the .nuspec file 10 | * Builds incrementally, so the NuGet package is generated only if one of its dependencies changes 11 | * Generates package version numbers automatically from one of several sources 12 | 13 | ##Getting Started## 14 | ![New Project](https://raw.githubusercontent.com/bspell1/NuBuild/master/NewProj.png) 15 | 16 | Once you have installed NuGet and NuBuild, simply click **File**->**New Project**. Under **Installed Templates**, choose the **NuGet** category and the **NuGet Package** project type. This will add a NuBuild project to your solution. 17 | 18 | ![Project Properties](https://raw.githubusercontent.com/bspell1/NuBuild/master/ProjProp.png) 19 | 20 | Right-click the project and select **Properties** to change the build configuration for your NuBuild project. Then, either edit the .nuspec file directly or use the excellent [NuGet Package Explorer](http://npe.codeplex.com/) to configure your package's properties. 21 | 22 | ##Versioning## 23 | NuBuild supports the following options for generating NuGet package version numbers. 24 | 25 | * **Manual:** In this mode, NuBuild will use the version number specified in the .nuspec file for the package version. It will not attempt to generate it from any other source. Use this option if you manage your version numbers by hand or via a text replacement mechanism (as in TeamCity). 26 | * **Library:** (default) NuGet will assign the package version from the first library it finds that contains a version resource. The library must either be a project reference or be specified explicitly within the .nuspec <files> section. Use this option if you automatically version the DLLs in your solution. 27 | * **Auto:** In this mode, the major/minor version numbers are specified manually in the .nuspec file, but NuBuild generates the build number. If the project includes a **$(BuildNumber)** property (as in TFS builds), it will be used as the build number for the package version. Otherwise, NuBuild will create a build.number file and automatically increment it each time the project builds. 28 | 29 | ##Replacement Tokens## 30 | NuBuild also supports the NuGet replacement tokens defined at http://docs.nuget.org/docs/reference/nuspec-reference#Replacement_Tokens. If used, the **version** token behaves according to specification regardless of the versioning mode of the project. 31 | 32 | ##Samples## 33 | The project includes samples for all of the valid project configurations. 34 | 35 | * **Simple:** the simplest configuration - a single library project reference and a manually-maintained version number 36 | * **ReferenceVersion:** in this sample, the NuBuild project references a library project, automatically including its targets in the NuGet package and generating the version number from the DLL 37 | * **LibraryVersion:** this package references a single library within the <files> section of the .nuspec file and generates its version number from the DLL 38 | * **TfsVersion:** generates the version number from the TFS $(BuildNumber) property 39 | * **AutoVersion:** generates the version number automatically from an auto-incremented build.number file 40 | * **MultiPackage:** this sample generates multiple NuGet packages from a single NuBuild project 41 | 42 | ##Miscellaneous## 43 | * If you want to compile/extend NuBuild yourself, you will need to install the Visual Studio 2010 SP1 SDK and WiX 3.6+. The project consists of a Visual Studio package (Vsix\Package), a MSBuild task library (MSBuild\Tasks), and a WiX installer (Install). 44 | -------------------------------------------------------------------------------- /Samples/AutoVersion/Library/Class.cs: -------------------------------------------------------------------------------- 1 | namespace Library 2 | { 3 | public sealed class Class 4 | { 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /Samples/AutoVersion/Library/Library.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | {159AAAA0-CC13-41B1-9BAE-477B649EFEEF} 5 | Library 6 | Library 7 | Library 8 | v4.0 9 | Properties 10 | 11 | 12 | ..\Bin\ 13 | 4 14 | true 15 | TRACE 16 | false 17 | 18 | 19 | false 20 | $(DefineConstants);DEBUG 21 | 22 | 23 | true 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | -------------------------------------------------------------------------------- /Samples/AutoVersion/Library/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | [assembly: AssemblyVersion("1.0.1.1")] 3 | -------------------------------------------------------------------------------- /Samples/AutoVersion/Package/Package.nuproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | {B3AE8184-5376-4F1E-A818-2A66A747FC13} 5 | ..\Bin\ 6 | 7 | 8 | 9 | 10 | 11 | 12 | auto 13 | 14 | 15 | 16 | 17 | 18 | 19 | Library 20 | {159aaaa0-cc13-41b1-9bae-477b649efeef} 21 | True 22 | 23 | 24 | 25 | -------------------------------------------------------------------------------- /Samples/AutoVersion/Package/Package.nuspec: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/brentspell/NuBuild/d6b6088758eda10bd412eae8ce5bbed5b1cd3565/Samples/AutoVersion/Package/Package.nuspec -------------------------------------------------------------------------------- /Samples/LibraryVersion/Package/Package.nuproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | {715A33C3-4C68-40E3-95B4-1B23FDE6340E} 5 | ..\Bin\ 6 | library 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /Samples/LibraryVersion/Package/Package.nuspec: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/brentspell/NuBuild/d6b6088758eda10bd412eae8ce5bbed5b1cd3565/Samples/LibraryVersion/Package/Package.nuspec -------------------------------------------------------------------------------- /Samples/MultiPackage/Library1/Class.cs: -------------------------------------------------------------------------------- 1 | namespace Library 2 | { 3 | public sealed class Class 4 | { 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /Samples/MultiPackage/Library1/Library1.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | {00BFFC28-24AA-4909-86ED-0F3435B9ECB6} 5 | Library 6 | Library 7 | Library1 8 | v4.0 9 | 10 | 11 | ..\Bin\ 12 | 4 13 | true 14 | TRACE 15 | false 16 | 17 | 18 | false 19 | $(DefineConstants);DEBUG 20 | 21 | 22 | true 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | -------------------------------------------------------------------------------- /Samples/MultiPackage/Library2/Class.cs: -------------------------------------------------------------------------------- 1 | namespace Library 2 | { 3 | public sealed class Class 4 | { 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /Samples/MultiPackage/Library2/Library2.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | {D6DBDE30-C538-4C0D-8E46-589CB85C5D68} 5 | Library 6 | Library 7 | Library2 8 | v4.0 9 | 10 | 11 | ..\Bin\ 12 | 4 13 | true 14 | TRACE 15 | false 16 | 17 | 18 | false 19 | $(DefineConstants);DEBUG 20 | 21 | 22 | true 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | -------------------------------------------------------------------------------- /Samples/MultiPackage/Library3/Class.cs: -------------------------------------------------------------------------------- 1 | namespace Library 2 | { 3 | public sealed class Class 4 | { 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /Samples/MultiPackage/Library3/Library3.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | {C623471C-9C60-4A74-9BB1-DCF49AFC3CB3} 5 | Library 6 | Library 7 | Library3 8 | v4.0 9 | 10 | 11 | ..\Bin\ 12 | 4 13 | true 14 | TRACE 15 | false 16 | 17 | 18 | false 19 | $(DefineConstants);DEBUG 20 | 21 | 22 | true 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | -------------------------------------------------------------------------------- /Samples/MultiPackage/Package/Package.nuproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | {222D3622-ACC2-4AD7-8F22-FBB0CA7B17A6} 5 | ..\Bin\ 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | Library3 18 | {c623471c-9c60-4a74-9bb1-dcf49afc3cb3} 19 | True 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /Samples/MultiPackage/Package/Package1.nuspec: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/brentspell/NuBuild/d6b6088758eda10bd412eae8ce5bbed5b1cd3565/Samples/MultiPackage/Package/Package1.nuspec -------------------------------------------------------------------------------- /Samples/MultiPackage/Package/Package2.nuspec: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/brentspell/NuBuild/d6b6088758eda10bd412eae8ce5bbed5b1cd3565/Samples/MultiPackage/Package/Package2.nuspec -------------------------------------------------------------------------------- /Samples/NoReference/Package/Package.nuproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | {8FBB5ACA-AAC0-49BE-B752-47067EB05BD9} 5 | ..\Bin\ 6 | Manual 7 | True 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | Content 19 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /Samples/NoReference/Package/Package.nuspec: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/brentspell/NuBuild/d6b6088758eda10bd412eae8ce5bbed5b1cd3565/Samples/NoReference/Package/Package.nuspec -------------------------------------------------------------------------------- /Samples/NoReference/Package/test.txt: -------------------------------------------------------------------------------- 1 | test -------------------------------------------------------------------------------- /Samples/Pcl/Library/Class.cs: -------------------------------------------------------------------------------- 1 | namespace Library 2 | { 3 | public sealed class Class 4 | { 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /Samples/Pcl/Library/Library.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 11.0 6 | Debug 7 | AnyCPU 8 | {B1E5658E-57F3-4344-9B67-E638E76ABBAE} 9 | Library 10 | Properties 11 | Library 12 | Library 13 | v4.5 14 | Profile7 15 | 512 16 | {786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} 17 | 18 | 19 | true 20 | full 21 | false 22 | ..\Bin\ 23 | DEBUG;TRACE 24 | prompt 25 | 4 26 | 27 | 28 | pdbonly 29 | true 30 | ..\Bin\ 31 | TRACE 32 | prompt 33 | 4 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | -------------------------------------------------------------------------------- /Samples/Pcl/Library/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | [assembly: AssemblyVersion("1.0.1.0")] 3 | [assembly: AssemblyCompany("Acme, Inc.")] 4 | [assembly: AssemblyDescription("Library Assembly")] 5 | -------------------------------------------------------------------------------- /Samples/Pcl/Package/Package.nuproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | {4BC9CC8F-04B2-4B37-BCC5-0C89F2470C34} 5 | ..\Bin\ 6 | v4.5 7 | Manual 8 | False 9 | False 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | Library 21 | {B1E5658E-57F3-4344-9B67-E638E76ABBAE} 22 | True 23 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /Samples/Pcl/Package/Package.nuspec: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/brentspell/NuBuild/d6b6088758eda10bd412eae8ce5bbed5b1cd3565/Samples/Pcl/Package/Package.nuspec -------------------------------------------------------------------------------- /Samples/ReferenceVersion/Library/Class.cs: -------------------------------------------------------------------------------- 1 | namespace Library 2 | { 3 | public sealed class Class 4 | { 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /Samples/ReferenceVersion/Library/Library.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | {379A8017-488F-4234-B2D4-E0854EE6411F} 5 | Library 6 | Library 7 | Library 8 | v4.0 9 | Properties 10 | 11 | 12 | ..\Bin\ 13 | 4 14 | true 15 | TRACE 16 | false 17 | 18 | 19 | false 20 | $(DefineConstants);DEBUG 21 | 22 | 23 | true 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | -------------------------------------------------------------------------------- /Samples/ReferenceVersion/Library/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | [assembly: AssemblyVersion("1.0.1.1")] 3 | -------------------------------------------------------------------------------- /Samples/ReferenceVersion/Package/Package.nuproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | {90B0A935-D903-4CF5-9E87-BC7B82EE0F52} 5 | ..\Bin\ 6 | Library 7 | False 8 | True 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | Library 20 | {379a8017-488f-4234-b2d4-e0854ee6411f} 21 | True 22 | lib\net45 23 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /Samples/ReferenceVersion/Package/Package.nuspec: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/brentspell/NuBuild/d6b6088758eda10bd412eae8ce5bbed5b1cd3565/Samples/ReferenceVersion/Package/Package.nuspec -------------------------------------------------------------------------------- /Samples/Replacements/Library/Class.cs: -------------------------------------------------------------------------------- 1 | namespace Library 2 | { 3 | public sealed class Class 4 | { 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /Samples/Replacements/Library/Library.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | {CED45FCE-5AA6-42ED-91DB-0864AA13AD0F} 5 | Library 6 | Library 7 | Library 8 | v4.0 9 | Properties 10 | 11 | 12 | ..\Bin\ 13 | 4 14 | true 15 | TRACE 16 | false 17 | 18 | 19 | false 20 | $(DefineConstants);DEBUG 21 | 22 | 23 | true 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | -------------------------------------------------------------------------------- /Samples/Replacements/Library/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | [assembly: AssemblyVersion("1.0.1.0")] 3 | [assembly: AssemblyCompany("Acme, Inc.")] 4 | [assembly: AssemblyDescription("Library Assembly")] 5 | -------------------------------------------------------------------------------- /Samples/Replacements/Package/Package.nuproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | {234D4185-294E-4EEC-87A9-7495EB2EB862} 5 | ..\Bin\ 6 | Manual 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | Library 18 | {CED45FCE-5AA6-42ED-91DB-0864AA13AD0F} 19 | True 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /Samples/Replacements/Package/Package.nuspec: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/brentspell/NuBuild/d6b6088758eda10bd412eae8ce5bbed5b1cd3565/Samples/Replacements/Package/Package.nuspec -------------------------------------------------------------------------------- /Samples/Simple/Library/Class.cs: -------------------------------------------------------------------------------- 1 | namespace Library 2 | { 3 | public sealed class Class 4 | { 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /Samples/Simple/Library/Library.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | {D73E2F24-E4E9-4D0B-B3D8-A725A10363C5} 5 | Library 6 | Library 7 | Library 8 | v4.0 9 | 10 | 11 | ..\Bin\ 12 | 4 13 | true 14 | TRACE 15 | false 16 | 17 | 18 | false 19 | $(DefineConstants);DEBUG 20 | 21 | 22 | true 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | -------------------------------------------------------------------------------- /Samples/Simple/Package/Package.nuproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | {f192b0ac-34d2-4405-acf6-d72f180956e5} 5 | ..\Bin\ 6 | v4.5 7 | Manual 8 | False 9 | False 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | Library 21 | {d73e2f24-e4e9-4d0b-b3d8-a725a10363c5} 22 | True 23 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /Samples/Simple/Package/Package.nuspec: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/brentspell/NuBuild/d6b6088758eda10bd412eae8ce5bbed5b1cd3565/Samples/Simple/Package/Package.nuspec -------------------------------------------------------------------------------- /Samples/TfsVersion/Library/Class.cs: -------------------------------------------------------------------------------- 1 | namespace Library 2 | { 3 | public sealed class Class 4 | { 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /Samples/TfsVersion/Library/Library.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | {D75ED236-F51A-4A28-B09C-E7A13AEC4AF2} 5 | Library 6 | Library 7 | Library 8 | v4.0 9 | Properties 10 | 11 | 12 | ..\Bin\ 13 | 4 14 | true 15 | TRACE 16 | false 17 | 18 | 19 | false 20 | $(DefineConstants);DEBUG 21 | 22 | 23 | true 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | -------------------------------------------------------------------------------- /Samples/TfsVersion/Library/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | [assembly: AssemblyVersion("1.0.1.1")] 3 | -------------------------------------------------------------------------------- /Samples/TfsVersion/Package/Package.nuproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | {DFA71399-1721-4735-9DB9-7781245C50FF} 5 | ..\Bin\ 6 | auto 7 | 42 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | Library 19 | {d75ed236-f51a-4a28-b09c-e7a13aec4af2} 20 | True 21 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /Samples/TfsVersion/Package/Package.nuspec: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/brentspell/NuBuild/d6b6088758eda10bd412eae8ce5bbed5b1cd3565/Samples/TfsVersion/Package/Package.nuspec -------------------------------------------------------------------------------- /VS/ItemTemplate/ItemTemplate.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | {82b43b9b-a64c-4715-b499-d71e9ca2bd60};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} 5 | {6045E4AC-6183-42B4-9880-AD01F46A36ED} 6 | Library 7 | Properties 8 | NuBuild.VS.ItemTemplate 9 | NuBuild.VS.ItemTemplate 10 | v4.0 11 | 512 12 | false 13 | false 14 | false 15 | false 16 | false 17 | false 18 | false 19 | false 20 | false 21 | false 22 | NuGet 23 | 12.0 24 | AnyCPU 25 | 26 | 27 | 28 | 29 | 4.0 30 | 31 | 32 | true 33 | full 34 | false 35 | bin\Debug\ 36 | DEBUG;TRACE 37 | prompt 38 | 4 39 | 40 | 41 | pdbonly 42 | true 43 | bin\Release\ 44 | TRACE 45 | prompt 46 | 4 47 | 48 | 49 | 50 | Designer 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | -------------------------------------------------------------------------------- /VS/ItemTemplate/NuSpec/NuSpec.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/brentspell/NuBuild/d6b6088758eda10bd412eae8ce5bbed5b1cd3565/VS/ItemTemplate/NuSpec/NuSpec.ico -------------------------------------------------------------------------------- /VS/ItemTemplate/NuSpec/NuSpec.nuspec: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/brentspell/NuBuild/d6b6088758eda10bd412eae8ce5bbed5b1cd3565/VS/ItemTemplate/NuSpec/NuSpec.nuspec -------------------------------------------------------------------------------- /VS/ItemTemplate/NuSpec/NuSpec.vstemplate: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | NuGet Package Specification 5 | NuGet package specification 6 | NuSpec.ico 7 | NuGet 8 | Package.nuspec 9 | true 10 | 11 | 12 | NuSpec.nuspec 13 | 14 | 15 | -------------------------------------------------------------------------------- /VS/Package/NuBuild/NuBuildFactory.cs: -------------------------------------------------------------------------------- 1 | //=========================================================================== 2 | // MODULE: NuBuildFactory.cs 3 | // PURPOSE: NuBuild project node factory 4 | // 5 | // Copyright © 2012 6 | // Brent M. Spell. All rights reserved. 7 | // 8 | // This library is free software; you can redistribute it and/or modify it 9 | // under the terms of the GNU Lesser General Public License as published 10 | // by the Free Software Foundation; either version 3 of the License, or 11 | // (at your option) any later version. This library is distributed in the 12 | // hope that it will be useful, but WITHOUT ANY WARRANTY; without even the 13 | // implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 14 | // See the GNU Lesser General Public License for more details. You should 15 | // have received a copy of the GNU Lesser General Public License along with 16 | // this library; if not, write to 17 | // Free Software Foundation, Inc. 18 | // 51 Franklin Street, Fifth Floor 19 | // Boston, MA 02110-1301 USA 20 | //=========================================================================== 21 | // System References 22 | using System; 23 | using System.Collections.Generic; 24 | using System.Linq; 25 | using System.Runtime.InteropServices; 26 | using Microsoft.VisualStudio.Project; 27 | using IOleServiceProvider = Microsoft.VisualStudio.OLE.Interop.IServiceProvider; 28 | // Project References 29 | 30 | namespace NuBuild.VS 31 | { 32 | /// 33 | /// Project node factory 34 | /// 35 | /// 36 | /// This class represents the .nuproj project type and creates instances 37 | /// of the NuBuildNode project node for each NuBuild project loaded in 38 | /// Visual Studio. 39 | /// 40 | [Guid(NuBuildFactory.FactoryGuidString)] 41 | public sealed class NuBuildFactory : ProjectFactory 42 | { 43 | public const String FactoryGuidString = "e09dd79a-4488-4ab9-8d3f-a7eee78bf432"; 44 | public static readonly Guid FactoryGuid = new Guid(FactoryGuidString); 45 | NuBuildPackage package; 46 | 47 | /// 48 | /// Initializes a new factory instance 49 | /// 50 | /// 51 | /// The current NuBuild VS package 52 | /// 53 | public NuBuildFactory (NuBuildPackage package) : base(package) 54 | { 55 | this.package = package; 56 | } 57 | /// 58 | /// Creates a new project instance 59 | /// 60 | /// 61 | /// The NuBuildNode project node 62 | /// 63 | protected override ProjectNode CreateProject () 64 | { 65 | var project = new NuBuildNode(this.package); 66 | var provider = (IServiceProvider)this.package; 67 | var olesite = (IOleServiceProvider)provider.GetService( 68 | typeof(IOleServiceProvider) 69 | ); 70 | project.SetSite(olesite); 71 | return project; 72 | } 73 | } 74 | } 75 | -------------------------------------------------------------------------------- /VS/Package/NuBuild/NuBuildPackage.cs: -------------------------------------------------------------------------------- 1 | //=========================================================================== 2 | // MODULE: NuBuildPackage.cs 3 | // PURPOSE: NuBuild visual studio package 4 | // 5 | // Copyright © 2012 6 | // Brent M. Spell. All rights reserved. 7 | // 8 | // This library is free software; you can redistribute it and/or modify it 9 | // under the terms of the GNU Lesser General Public License as published 10 | // by the Free Software Foundation; either version 3 of the License, or 11 | // (at your option) any later version. This library is distributed in the 12 | // hope that it will be useful, but WITHOUT ANY WARRANTY; without even the 13 | // implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 14 | // See the GNU Lesser General Public License for more details. You should 15 | // have received a copy of the GNU Lesser General Public License along with 16 | // this library; if not, write to 17 | // Free Software Foundation, Inc. 18 | // 51 Franklin Street, Fifth Floor 19 | // Boston, MA 02110-1301 USA 20 | //=========================================================================== 21 | // System References 22 | using System; 23 | using System.Collections.Generic; 24 | using System.Linq; 25 | using System.Runtime.InteropServices; 26 | using Microsoft.VisualStudio.Project; 27 | using Microsoft.VisualStudio.Shell; 28 | // Project References 29 | 30 | namespace NuBuild.VS 31 | { 32 | /// 33 | /// Visual Studio package 34 | /// 35 | /// 36 | /// This class is the entry point into the NuBuild project system from 37 | /// Visual Studio. It registers the project node factory with VS for 38 | /// servicing requests for the .nuproj project type. 39 | /// 40 | [PackageRegistration(UseManagedResourcesOnly = true)] 41 | [InstalledProductRegistration("#110", "#112", "1.0", IconResourceID = 400)] 42 | [Guid(NuBuildPackage.PackageGuidString)] 43 | [ProvideProjectFactory( 44 | typeof(NuBuildFactory), 45 | null, 46 | "NuBuild Project Files (*.nuproj)", 47 | "nuproj", 48 | "nuproj", 49 | @".\NullPath", 50 | LanguageVsTemplate = "NuGet")] 51 | [ProvideObject(typeof(NuBuildPropertyPage))] 52 | public sealed class NuBuildPackage : ProjectPackage 53 | { 54 | public const String PackageGuidString = "e09dd79a-4488-4ab9-8d3f-a7eee78bf432"; 55 | public static readonly Guid PackageGuid = new Guid(PackageGuidString); 56 | 57 | #region ProjectPackage Overrides 58 | /// 59 | /// Initializes a new package instance 60 | /// 61 | protected override void Initialize () 62 | { 63 | base.Initialize(); 64 | RegisterProjectFactory(new NuBuildFactory(this)); 65 | } 66 | /// 67 | /// NuBuild product user context 68 | /// 69 | public override String ProductUserContext 70 | { 71 | get { return null; } 72 | } 73 | #endregion 74 | } 75 | } 76 | -------------------------------------------------------------------------------- /VS/Package/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | //=========================================================================== 2 | // MODULE: AssemblyInfo.cs 3 | // PURPOSE: assembly configuration properties 4 | // 5 | // Copyright © 2012 6 | // Brent M. Spell. All rights reserved. 7 | // 8 | // This library is free software; you can redistribute it and/or modify it 9 | // under the terms of the GNU Lesser General Public License as published 10 | // by the Free Software Foundation; either version 3 of the License, or 11 | // (at your option) any later version. This library is distributed in the 12 | // hope that it will be useful, but WITHOUT ANY WARRANTY; without even the 13 | // implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 14 | // See the GNU Lesser General Public License for more details. You should 15 | // have received a copy of the GNU Lesser General Public License along with 16 | // this library; if not, write to 17 | // Free Software Foundation, Inc. 18 | // 51 Franklin Street, Fifth Floor 19 | // Boston, MA 02110-1301 USA 20 | //=========================================================================== 21 | // System References 22 | using System; 23 | using System.Reflection; 24 | using System.Runtime.CompilerServices; 25 | using System.Runtime.InteropServices; 26 | // Project References 27 | 28 | [assembly:Guid("1E196872-CD2A-41DC-AFDB-4CF0B34EEB26")] 29 | [assembly:AssemblyProduct("NuGet Project System")] 30 | [assembly:AssemblyTitle("NuGet Project System Visual Studio Package")] 31 | [assembly:AssemblyCompany("Brent M. Spell")] 32 | [assembly:AssemblyCopyright("Copyright © 2012 Brent M. Spell. All Rights Reserved.")] 33 | [assembly:CLSCompliant(false)] 34 | [assembly:ComVisible(false)] 35 | #if DEBUG 36 | [assembly:AssemblyConfiguration("Debug")] 37 | #else 38 | [assembly:AssemblyConfiguration("Release")] 39 | #endif 40 | -------------------------------------------------------------------------------- /VS/Package/Resources/Key.snk: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/brentspell/NuBuild/d6b6088758eda10bd412eae8ce5bbed5b1cd3565/VS/Package/Resources/Key.snk -------------------------------------------------------------------------------- /VS/Package/Resources/NuBuild.vsct: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | -------------------------------------------------------------------------------- /VS/Package/source.extension.vsixmanifest: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | NuBuild Project System 5 | NuBuild 6 | 1.12 7 | A NuGet project system for Visual Studio 8 | 1033 9 | http://github.com/bspell1/nubuild 10 | Resources\license.txt 11 | Resources\NuBuild.png 12 | true 13 | 14 | 15 | Ultimate 16 | Premium 17 | Pro 18 | Express_All 19 | 20 | 21 | Ultimate 22 | Premium 23 | Pro 24 | Express_All 25 | 26 | 27 | Ultimate 28 | Premium 29 | Pro 30 | Express_All 31 | 32 | 33 | Ultimate 34 | Premium 35 | Pro 36 | Express_All 37 | 38 | 39 | 40 | 41 | 42 | 43 | Visual Studio MPF 44 | 45 | 46 | 47 | |%CurrentProject%;PkgdefProjectOutputGroup| 48 | ProjectTemplates 49 | ItemTemplates 50 | 51 | 52 | -------------------------------------------------------------------------------- /VS/ProjectTemplate/NuProj/NuProj.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/brentspell/NuBuild/d6b6088758eda10bd412eae8ce5bbed5b1cd3565/VS/ProjectTemplate/NuProj/NuProj.ico -------------------------------------------------------------------------------- /VS/ProjectTemplate/NuProj/NuProj.nuproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | $guid1$ 5 | Bin\ 6 | v4.5 7 | library 8 | true 9 | false 10 | false 11 | true 12 | false 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /VS/ProjectTemplate/NuProj/NuProj.nuspec: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/brentspell/NuBuild/d6b6088758eda10bd412eae8ce5bbed5b1cd3565/VS/ProjectTemplate/NuProj/NuProj.nuspec -------------------------------------------------------------------------------- /VS/ProjectTemplate/NuProj/NuProj.vstemplate: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | NuGet Package 5 | NuGet package project 6 | NuProj.ico 7 | NuGet 8 | Package 9 | true 10 | 11 | 12 | 13 | NuProj.nuspec 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /VS/ProjectTemplate/NuProj/NuSpec1.nuspec: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | $safeprojectname$ 5 | 1.0.0 6 | $safeprojectname$ 7 | Brent M. Spell 8 | Brent M. Spell 9 | 10 | 11 | 12 | false 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /VS/ProjectTemplate/ProjectTemplate.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | {82b43b9b-a64c-4715-b499-d71e9ca2bd60};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} 5 | {8E6F74CF-7D2C-4BDC-979B-23654E2B9587} 6 | Library 7 | Properties 8 | Template 9 | Template 10 | v4.0 11 | 512 12 | false 13 | false 14 | false 15 | false 16 | false 17 | false 18 | false 19 | false 20 | false 21 | false 22 | NuGet 23 | 12.0 24 | AnyCPU 25 | 26 | 27 | 28 | 29 | 4.0 30 | 31 | 32 | true 33 | full 34 | false 35 | bin\Debug\ 36 | DEBUG;TRACE 37 | prompt 38 | 4 39 | 40 | 41 | pdbonly 42 | true 43 | bin\Release\ 44 | TRACE 45 | prompt 46 | 4 47 | 48 | 49 | 50 | Designer 51 | 52 | 53 | Designer 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | -------------------------------------------------------------------------------- /Version.cs: -------------------------------------------------------------------------------- 1 | //=========================================================================== 2 | // MODULE: Version.cs 3 | // PURPOSE: project version assembly properties 4 | // 5 | // Copyright © 2012 6 | // Brent M. Spell. All rights reserved. 7 | // 8 | // This library is free software; you can redistribute it and/or modify it 9 | // under the terms of the GNU Lesser General Public License as published 10 | // by the Free Software Foundation; either version 3 of the License, or 11 | // (at your option) any later version. This library is distributed in the 12 | // hope that it will be useful, but WITHOUT ANY WARRANTY; without even the 13 | // implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 14 | // See the GNU Lesser General Public License for more details. You should 15 | // have received a copy of the GNU Lesser General Public License along with 16 | // this library; if not, write to 17 | // Free Software Foundation, Inc. 18 | // 51 Franklin Street, Fifth Floor 19 | // Boston, MA 02110-1301 USA 20 | //=========================================================================== 21 | // System References 22 | using System.Reflection; 23 | // Project References 24 | [assembly:AssemblyVersion("1.12.2.0")] 25 | [assembly:AssemblyFileVersion("1.12.2.0")] 26 | --------------------------------------------------------------------------------