From a58163daf9fa6b2e07f1e2b06dd3d8d8707cc99a Mon Sep 17 00:00:00 2001 From: Heath Stewart Date: Sat, 14 Jan 2017 15:43:17 -0800 Subject: [PATCH] Build PSGallery package with NuProj PowerShell modules on PSGallery using PowerShellGet are just NuGet packages but developers may not have PowerShellGet (WMF 5.0 or separate MSI install for PSv3 and v4). Use NuProj as build-time dependency instead. --- .nuget/packages.config | 4 ++ CONTRIBUTING.md | 44 +++++++++++++ README.md | 9 +-- VSSetup.PowerShell.sln | 8 +++ inc/Common.ruleset | 1 + .../VSSetup.PowerShell.csproj | 18 ++---- src/VSSetup.PowerShell/packages.config | 5 +- src/VSSetup/VSSetup.nuproj | 62 +++++++++++++++++++ .../VSSetup.PowerShell.Test.csproj | 8 +-- 9 files changed, 130 insertions(+), 29 deletions(-) create mode 100644 .nuget/packages.config create mode 100644 CONTRIBUTING.md create mode 100644 src/VSSetup/VSSetup.nuproj diff --git a/.nuget/packages.config b/.nuget/packages.config new file mode 100644 index 0000000..eb5a8e4 --- /dev/null +++ b/.nuget/packages.config @@ -0,0 +1,4 @@ + + + + diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md new file mode 100644 index 0000000..220d66b --- /dev/null +++ b/CONTRIBUTING.md @@ -0,0 +1,44 @@ +Contributing +============ + +## Prerequisites + +This project uses the following software. Newer versions may work but backward compatibility must be maintained. + +* [Visual Studio 2015](https://www.visualstudio.com/en-us/downloads/visual-studio-2015-downloads-vs.aspx) + +### Optional + +Some projects require optional software to open or otherwise use in Visual Studio. They are not required to build the solution using MSBuild. + +* [NuProj Package Project](https://marketplace.visualstudio.com/items?itemName=NuProjTeam.NuGetPackageProject) +* [Visual Studio Spell Checker](https://marketplace.visualstudio.com/items?itemName=EWoodruff.VisualStudioSpellChecker) + +## Building + +Before you can build this project from the command line with MSBuild or within Visual Studio, you must restore packages. + +* In Visual Studio, make sure Package Restore is enabled. +* On the command line and assuming _nuget.exe_ is in your `PATH`, in the solution directory run: `nuget restore` + +Note again that to build the full solution in Visual Studio some optional software may be required. + +## Testing + +All available tests are discovered after a complete build in Test Explorer within Visual Studio. + +On the command line, you can run the following commands from the solution directory. Replace `` with whatever version was downloaded. + +``` +nuget install xunit.runner.console -outputdirectory packages +packages\xunit.runner.console.\tools\xunit.runner.console test\VSSetup.PowerShell.Test\bin\Debug\Microsoft.VisualStudio.Setup.PowerShell.Test.dll +``` + +## Pull Requests + +We welcome pull requests for both bug fixes and new features that solve a common enough problem to benefit the community. Please note the following requirements. + +1. Code changes for bug fixes and new features are accompanied by new tests or, only if required, modifications to existing tests. Modifying existing tests when not required may introduce regressions. +2. All tests must pass. We have automated PR builds that will verify any PRs before they can be merged, but you are encouraged to run all tests in your development environment prior to pushing to your remote. + +Thank you for your contributions! diff --git a/README.md b/README.md index 1410f5b..180d738 100644 --- a/README.md +++ b/README.md @@ -3,8 +3,7 @@ Visual Studio Setup PowerShell Module This PowerShell module contains cmdlets to query instances of Visual Studio 2017 and newer. It also serves as a more useful sample of using the Setup Configuration APIs than the previously [published samples](https://github.com/microsoft/vs-setup-samples) though those also have samples using VB and VC++. -Installing ----------- +## Installing You can download packages from the Releases page for this project on GitHub, but with Windows Management Framework 5.0 or newer (which installs PowerShell and comes with Windows 10), you can download and install this module even easier. @@ -12,8 +11,7 @@ You can download packages from the Releases page for this project on GitHub, but Install-Module VSSetup -Scope CurrentUser ``` -Using ------ +## Using You can query all usable instances of Visual Studio and other products installed by the Visual Studio installer. @@ -33,7 +31,6 @@ If you want to select the latest instance that contains the .NET desktop develop Get-VSSetupInstance -All | Select-VSSetupInstance -Require 'Microsoft.VisualStudio.Workload.ManagedDesktop' -Latest ``` -Feedback --------- +## Feedback To file issues or suggestions, please use the Issues page for this project on GitHub. diff --git a/VSSetup.PowerShell.sln b/VSSetup.PowerShell.sln index dccbb50..61ea87d 100644 --- a/VSSetup.PowerShell.sln +++ b/VSSetup.PowerShell.sln @@ -13,10 +13,13 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "test", "test", "{73C57796-F EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{9AD110B9-8C98-4003-A4DE-EDA52337735D}" ProjectSection(SolutionItems) = preProject + CONTRIBUTING.md = CONTRIBUTING.md LICENSE.txt = LICENSE.txt README.md = README.md EndProjectSection EndProject +Project("{FF286327-C783-4F7A-AB73-9BCBAD0D4460}") = "VSSetup", "src\VSSetup\VSSetup.nuproj", "{E0172143-FCFD-48B3-988D-E9F01A680C21}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -31,6 +34,10 @@ Global {ED12C009-A3E6-4F22-999A-FCA8C84DB41A}.Debug|Any CPU.Build.0 = Debug|Any CPU {ED12C009-A3E6-4F22-999A-FCA8C84DB41A}.Release|Any CPU.ActiveCfg = Release|Any CPU {ED12C009-A3E6-4F22-999A-FCA8C84DB41A}.Release|Any CPU.Build.0 = Release|Any CPU + {E0172143-FCFD-48B3-988D-E9F01A680C21}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {E0172143-FCFD-48B3-988D-E9F01A680C21}.Debug|Any CPU.Build.0 = Debug|Any CPU + {E0172143-FCFD-48B3-988D-E9F01A680C21}.Release|Any CPU.ActiveCfg = Release|Any CPU + {E0172143-FCFD-48B3-988D-E9F01A680C21}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE @@ -38,5 +45,6 @@ Global GlobalSection(NestedProjects) = preSolution {F77937D9-8B7C-46AC-80D3-DFDE39EB3279} = {FEED13D9-C881-407F-A945-7555704789C0} {ED12C009-A3E6-4F22-999A-FCA8C84DB41A} = {73C57796-F1DD-49D8-9A5D-9F58764C0078} + {E0172143-FCFD-48B3-988D-E9F01A680C21} = {FEED13D9-C881-407F-A945-7555704789C0} EndGlobalSection EndGlobal diff --git a/inc/Common.ruleset b/inc/Common.ruleset index 713ce06..db4c7b3 100644 --- a/inc/Common.ruleset +++ b/inc/Common.ruleset @@ -66,5 +66,6 @@ + \ No newline at end of file diff --git a/src/VSSetup.PowerShell/VSSetup.PowerShell.csproj b/src/VSSetup.PowerShell/VSSetup.PowerShell.csproj index 77d8e60..1151622 100644 --- a/src/VSSetup.PowerShell/VSSetup.PowerShell.csproj +++ b/src/VSSetup.PowerShell/VSSetup.PowerShell.csproj @@ -14,7 +14,6 @@ Client - bin\$(Configuration)\$(AssemblyName).xml ..\..\inc\Common.ruleset @@ -37,13 +36,6 @@ false - - - - - - false - ..\..\packages\Microsoft.VisualStudio.Setup.Configuration.Interop.1.3.269-rc\lib\net35\Microsoft.VisualStudio.Setup.Configuration.Interop.dll @@ -53,14 +45,10 @@ ..\..\packages\Microsoft.PowerShell.3.ReferenceAssemblies.1.0.0\lib\net4\System.Management.Automation.dll - True + False - - - - @@ -110,7 +98,9 @@ This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}. + + - \ No newline at end of file + diff --git a/src/VSSetup.PowerShell/packages.config b/src/VSSetup.PowerShell/packages.config index 7428a40..881e6c3 100644 --- a/src/VSSetup.PowerShell/packages.config +++ b/src/VSSetup.PowerShell/packages.config @@ -1,7 +1,8 @@  - + + - \ No newline at end of file + diff --git a/src/VSSetup/VSSetup.nuproj b/src/VSSetup/VSSetup.nuproj new file mode 100644 index 0000000..a54a7e8 --- /dev/null +++ b/src/VSSetup/VSSetup.nuproj @@ -0,0 +1,62 @@ + + + + + Debug + AnyCPU + + + Release + AnyCPU + + + + + + \ + + + + e0172143-fcfd-48b3-988d-e9f01a680c21 + ..\..\packages\nuproj.0.11.14-beta\tools + $(VersionDependsOn);GetNuPkgVersion + + + $(MSBuildExtensionsPath)\NuProj\ + + + + VSSetup + Visual Studio Setup PowerShell Module + Microsoft Corporation + Microsoft Corporation + Visual Studio Setup PowerShell Module + PowerShell module to interact with Visual Studio Setup + + + https://github.com/Microsoft/vssetup.powershell + https://github.com/Microsoft/vssetup.powershell/raw/$GitCommitIdShort$/LICENSE.txt + Copyright (C) Microsoft Corporation. All rights reserved. + PSModule PSIncludes_Cmdlet PSCmdlet_Get-VSSetupInstance PSCmdlet_Select-VSSetupInstance PSCommand_Get-VSSetupInstance PSCommand_Select-VSSetupInstance + true + + + + + + + + + This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}. + + + + + + + + $(AssemblyFileVersion) + $(NuSpecProperties);GitCommitIdShort=$(GitCommitIdShort) + + + diff --git a/test/VSSetup.PowerShell.Test/VSSetup.PowerShell.Test.csproj b/test/VSSetup.PowerShell.Test/VSSetup.PowerShell.Test.csproj index 17bf9b1..abdae0e 100644 --- a/test/VSSetup.PowerShell.Test/VSSetup.PowerShell.Test.csproj +++ b/test/VSSetup.PowerShell.Test/VSSetup.PowerShell.Test.csproj @@ -17,7 +17,6 @@ - bin\$(Configuration)\$(AssemblyName).xml ..\..\inc\Common.ruleset $(NoWarn);CS1591;SA1600;SA1652 @@ -60,12 +59,7 @@ ..\..\packages\Microsoft.PowerShell.3.ReferenceAssemblies.1.0.0\lib\net4\System.Management.Automation.dll True - - - - - ..\..\packages\xunit.abstractions.2.0.0\lib\net35\xunit.abstractions.dll True @@ -128,4 +122,4 @@ --> - \ No newline at end of file +