|
| 1 | +Contributing to this project |
| 2 | +============================ |
| 3 | + |
| 4 | +## Prerequisites |
| 5 | + |
| 6 | +This project is actively developed using the following software. |
| 7 | +It is highly recommended that anyone contributing to this library use the same |
| 8 | +software. |
| 9 | + |
| 10 | +1. [Visual Studio 2015][VS] |
| 11 | +2. [Node.js][NodeJs] |
| 12 | + |
| 13 | +### Optional additional software |
| 14 | + |
| 15 | +Some projects in the Visual Studio solution require optional or 3rd party components to open. |
| 16 | +They are not required to build the full solution from the command line using MSBuild, |
| 17 | +but installing this software will facilitate an enhanced developer experience in Visual Studio. |
| 18 | + |
| 19 | +1. [Node.js Tools for Visual Studio][NodeJsTools] |
| 20 | +2. [NuProj for VS2015][NuProj] |
| 21 | + |
| 22 | +All other dependencies are acquired via NuGet or NPM. |
| 23 | + |
| 24 | +## Building |
| 25 | + |
| 26 | +To build this repository from the command line, you must first execute our init.ps1 script, |
| 27 | +which downloads NuGet.exe and uses it to restore packages. |
| 28 | +Assuming your working directory is the root directory of this git repo, |
| 29 | +and you are running Windows PowerShell, the command is: |
| 30 | + |
| 31 | + .\init.ps1 |
| 32 | + |
| 33 | +Everything in the repo may be built via building the solution file |
| 34 | +either from Visual Studio 2015 or the VS2015 Developer Command Prompt: |
| 35 | + |
| 36 | + .\build.ps1 |
| 37 | + |
| 38 | +This repo is structured such that it builds the NuGet package first, using MSBuild. |
| 39 | +It then builds an NPM package that includes some of the outputs of MSBuild, along with |
| 40 | +some javascript, for our NPM consumers who want a reasonable versioning story for their |
| 41 | +NPM packages too. |
| 42 | + |
| 43 | +### Important notice when developing with Visual Studio |
| 44 | + |
| 45 | +The NuGet package restore functionality in Visual Studio does not work for this project, which relies |
| 46 | +on newer functionality than comes with Visual Studio 2015 Update 3. You should disable automatic |
| 47 | +package restore on build in Visual Studio in order to build successfully and have a useful Error List |
| 48 | +while developing. |
| 49 | + |
| 50 | +Follow these steps to disable automatic package restore in Visual Studio: |
| 51 | + |
| 52 | +1. Tools -> Options -> NuGet Package Manager -> General |
| 53 | +2. *Clear* the checkbox for "Automatically check for missing packages during build in Visual Studio |
| 54 | + |
| 55 | +With this setting, you can still execute a package restore within Visual Studio by right-clicking |
| 56 | +on the _solution_ node in Solution Explorer and clicking "Restore NuGet Packages". But do not ever |
| 57 | +execute that on this project as that will corrupt the result of `init.ps1`. |
| 58 | + |
| 59 | +Before developing this project in Visual Studio, or after making project or project.json changes, |
| 60 | +or to recover after Visual Studio executes a package restore, run the `init` script again. |
| 61 | + |
| 62 | +## Testing |
| 63 | + |
| 64 | +The Visual Studio 2015 Test Explorer will list and execute all tests. |
| 65 | + |
| 66 | +## Pull requests |
| 67 | + |
| 68 | +Pull requests are welcome! They may contain additional test cases (e.g. to demonstrate a failure), |
| 69 | +and/or product changes (with bug fixes or features). All product changes should be accompanied by |
| 70 | +additional tests to cover and justify the product change unless the product change is strictly an |
| 71 | +efficiency improvement and no outwardly observable change is expected. |
| 72 | + |
| 73 | +In the master branch, all tests should always pass. Added tests that fail should be marked as Skip |
| 74 | +via `[Fact(Skip = "Test does not pass yet")]` or similar message to keep our test pass rate at 100%. |
| 75 | + |
| 76 | +## Self-service releases for contributors |
| 77 | + |
| 78 | +As soon as you send a pull request, a build is executed and updated NuGet packages |
| 79 | +are published to this Package Feed: |
| 80 | + |
| 81 | + https://ci.appveyor.com/nuget/nerdbank-gitversioning |
| 82 | + |
| 83 | +By adding this URL to your package sources you can immediately install your version |
| 84 | +of the NuGet packages to your project. This can be done by adding a nuget.config file |
| 85 | +with the following content to the root of your project's repo: |
| 86 | + |
| 87 | +```xml |
| 88 | +<?xml version="1.0" encoding="utf-8"?> |
| 89 | +<configuration> |
| 90 | + <packageSources> |
| 91 | + <add key="Nerdbank.GitVersioning CI" value="https://ci.appveyor.com/nuget/nerdbank-gitversioning" /> |
| 92 | + </packageSources> |
| 93 | +</configuration> |
| 94 | +``` |
| 95 | + |
| 96 | +You can then install the package(s) while you have your new "Nerdbank.GitVersioning CI" package source selected: |
| 97 | + |
| 98 | +```powershell |
| 99 | +Install-Package Nerdbank.GitVersioning -Pre -Version 0.1.41-g02f355c05d |
| 100 | +``` |
| 101 | + |
| 102 | +Take care to set the package version such that it exactly matches the AppVeyor build |
| 103 | +for your pull request. You can get the version number by reviewing the result of the |
| 104 | +validation build for your pull request, clicking ARTIFACTS, and noting the version |
| 105 | +of the produced packages. |
| 106 | + |
| 107 | + [VS]: https://www.visualstudio.com/en-us/downloads/visual-studio-2015-downloads-vs.aspx |
| 108 | + [NodeJs]: https://nodejs.org |
| 109 | + [NuProj]: https://onedrive.live.com/redir?resid=63D0C265F96E43D!2477835&authkey=!AHh2k9FoNR-nFHo&ithint=file%2cmsi |
| 110 | + [NodeJsTools]: https://www.visualstudio.com/vs/node-js/ |
| 111 | + [NuGetClient]: https://dist.nuget.org/win-x86-commandline/v3.3.0/nuget.exe |
0 commit comments