From efcc513ea6190fd167d2571962ee97c47b8da8f7 Mon Sep 17 00:00:00 2001 From: Heath Stewart Date: Thu, 2 Mar 2017 23:43:33 -0800 Subject: [PATCH 1/2] Add nuget/choco package project Partial resolution to issue #21. --- .nuget/packages.config | 4 ++ CONTRIBUTING.md | 75 ++++++++++++++++++++++++++++++ pkg/vswhere/packages.config | 4 ++ pkg/vswhere/tools/VERIFICATION.txt | 5 ++ pkg/vswhere/vswhere.nuproj | 67 ++++++++++++++++++++++++++ src/vswhere/packages.config | 1 + src/vswhere/vswhere.vcxproj | 2 + vswhere.sln | 9 ++++ 8 files changed, 167 insertions(+) create mode 100644 .nuget/packages.config create mode 100644 CONTRIBUTING.md create mode 100644 pkg/vswhere/packages.config create mode 100644 pkg/vswhere/tools/VERIFICATION.txt create mode 100644 pkg/vswhere/vswhere.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..44fc225 --- /dev/null +++ b/CONTRIBUTING.md @@ -0,0 +1,75 @@ +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) + +## Coding + +This project uses a Git flow model releasing from the `master` branch with development based on and stabilize in the `develop` branch. You can view current build status in the [README](README.md) document. + +Please follow project code styles including, + +* All requires headers are in the precompiled headers, _stdafx.h_. +* Copyright header including proper file name at top of all non-generated source. +* Tabs are 4 spaces. + +In general, any new code should be stylistically indistinguishable from existing code. + +## 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. + +```batch +nuget install xunit.runner.console -outputdirectory packages +packages\xunit.runner.console.\tools\xunit.runner.console bin\Debug\vswhere.test.dll +``` + +It's also recommended that, if your machine supports it, you install [Docker for Windows](https://www.docker.com/products/overview), switch to Windows containers, and test in isolated containers for runtime behavior. + +```batch +REM You only need to build once unless updating the Dockerfile or files it copies. +docker\build + +REM This will automatically map build output. Defaults to Debug configuration. Pass -? for options. +docker\test +``` + +For a faster development process, you can run `docker\run -detach`, copy the container ID printed to the window, then subsequently run `docker\test -on ` replacing `` with the container ID you copied previously. You can make changes to the test data and even rebuild the project and run this command again as frequently as you need. This is especially handy for quick turn around when debugging and fixing a problem. + +To stop the container, run `docker stop `. If you did not pass `-keep` when you started the container it will be removed automatically. + +### Debugging + +You can also run `docker\run.cmd` to start an interactive shell for exploratory testing. If no other commands are passed when starting the container, the Visual Studio Remote Debugger will launch by default. Remote debugging services are discoverable on your private network. + +You can configure your project to start a remote command on a machine name that matches the short container ID returned if you ran `docker\run -detach`, or that you can discover by running `docker ps` in a separate console. + +## 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/pkg/vswhere/packages.config b/pkg/vswhere/packages.config new file mode 100644 index 0000000..e6a55a5 --- /dev/null +++ b/pkg/vswhere/packages.config @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/pkg/vswhere/tools/VERIFICATION.txt b/pkg/vswhere/tools/VERIFICATION.txt new file mode 100644 index 0000000..e6dbd24 --- /dev/null +++ b/pkg/vswhere/tools/VERIFICATION.txt @@ -0,0 +1,5 @@ +VERIFICATION +Verification is intended to assist the Chocolatey moderators and community +in verifying that this package's contents are trustworthy. + +tools\vswhere.exe is produced by us from the same repository as this package: https://github.com/Microsoft/vswhere diff --git a/pkg/vswhere/vswhere.nuproj b/pkg/vswhere/vswhere.nuproj new file mode 100644 index 0000000..39c5560 --- /dev/null +++ b/pkg/vswhere/vswhere.nuproj @@ -0,0 +1,67 @@ + + + + + Debug + AnyCPU + + + Release + AnyCPU + + + + + Tools + + + + + tools\LICENSE.txt + + + + + + + 87c09ce6-ba2d-4fc3-92e4-44253e87cb69 + $(SolutionDir)bin\$(Configuration)\ + + + $(SolutionDir)packages\NuProj.0.11.14-beta\tools\ + $(MSBuildExtensionsPath)\NuProj\ + $(VersionDependsOn);GetPackageVersion + + + + vswhere + 1.0.0 + Visual Studio Locator + Microsoft Corporation + Microsoft Corporation + Locate Visual Studio 2017 and newer installations + Locate Visual Studio 2017 and newer installations + + + https://github.com/Microsoft/vswhere + https://github.com/Microsoft/vswhere/raw/develop/LICENSE.txt + Copyright (C) Microsoft Corporation. All rights reserved. + vs vs2017 visualstudio + false + + + + $(BuildVersionSimple) + + + + + + + + + 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/vswhere/packages.config b/src/vswhere/packages.config index 022f5e8..5759de6 100644 --- a/src/vswhere/packages.config +++ b/src/vswhere/packages.config @@ -3,4 +3,5 @@ + \ No newline at end of file diff --git a/src/vswhere/vswhere.vcxproj b/src/vswhere/vswhere.vcxproj index 6b2264d..411ba95 100644 --- a/src/vswhere/vswhere.vcxproj +++ b/src/vswhere/vswhere.vcxproj @@ -120,6 +120,7 @@ + @@ -129,5 +130,6 @@ + \ No newline at end of file diff --git a/vswhere.sln b/vswhere.sln index 8780fbc..b02da29 100644 --- a/vswhere.sln +++ b/vswhere.sln @@ -19,6 +19,10 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution README.md = README.md EndProjectSection EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "pkg", "pkg", "{A2C0B2B6-0E25-4A8D-96F6-9F44C615AE00}" +EndProject +Project("{FF286327-C783-4F7A-AB73-9BCBAD0D4460}") = "vswhere", "pkg\vswhere\vswhere.nuproj", "{87C09CE6-BA2D-4FC3-92E4-44253E87CB69}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|x86 = Debug|x86 @@ -37,6 +41,10 @@ Global {4CCF39CB-4794-44E2-AA57-D215F13CF606}.Debug|x86.Build.0 = Debug|Win32 {4CCF39CB-4794-44E2-AA57-D215F13CF606}.Release|x86.ActiveCfg = Release|Win32 {4CCF39CB-4794-44E2-AA57-D215F13CF606}.Release|x86.Build.0 = Release|Win32 + {87C09CE6-BA2D-4FC3-92E4-44253E87CB69}.Debug|x86.ActiveCfg = Debug|Any CPU + {87C09CE6-BA2D-4FC3-92E4-44253E87CB69}.Debug|x86.Build.0 = Debug|Any CPU + {87C09CE6-BA2D-4FC3-92E4-44253E87CB69}.Release|x86.ActiveCfg = Release|Any CPU + {87C09CE6-BA2D-4FC3-92E4-44253E87CB69}.Release|x86.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE @@ -45,5 +53,6 @@ Global {210864F0-9A29-4479-B830-B802EE3F4D92} = {20C5861F-C1E5-4BFB-B082-209793FBDCA5} {76268871-D5A5-46BD-9805-41DB1C3072D1} = {2F0C5F28-FD43-4045-85E8-BBD98B6B66B5} {4CCF39CB-4794-44E2-AA57-D215F13CF606} = {20C5861F-C1E5-4BFB-B082-209793FBDCA5} + {87C09CE6-BA2D-4FC3-92E4-44253E87CB69} = {A2C0B2B6-0E25-4A8D-96F6-9F44C615AE00} EndGlobalSection EndGlobal From 123c0c2adbce16b35b61e2a714abc1ada07b2593 Mon Sep 17 00:00:00 2001 From: Heath Stewart Date: Fri, 3 Mar 2017 10:38:02 -0800 Subject: [PATCH 2/2] Fix build break --- src/vswhere.lib/packages.config | 1 + src/vswhere.lib/vswhere.lib.vcxproj | 2 ++ 2 files changed, 3 insertions(+) diff --git a/src/vswhere.lib/packages.config b/src/vswhere.lib/packages.config index 28cef17..f6fa390 100644 --- a/src/vswhere.lib/packages.config +++ b/src/vswhere.lib/packages.config @@ -2,4 +2,5 @@ + \ No newline at end of file diff --git a/src/vswhere.lib/vswhere.lib.vcxproj b/src/vswhere.lib/vswhere.lib.vcxproj index 97a9725..e2aff3e 100644 --- a/src/vswhere.lib/vswhere.lib.vcxproj +++ b/src/vswhere.lib/vswhere.lib.vcxproj @@ -206,6 +206,7 @@ + @@ -214,5 +215,6 @@ + \ No newline at end of file