red-gate / XmlDoc2CmdletDoc

Create cmdlet XML help files from XML doc comments
Other
63 stars 24 forks source link

Any way to disable the Xml generation? #59

Open GeraldLx opened 4 years ago

GeraldLx commented 4 years ago

When I add the NuGet package a targets file is added to the project calling the commandline tool. Is there any way to skip this step on certain conditions? Basically enabling a build like this: msbuild MyCmdletProject.csproj /p:XmlDoc2CmdletDocSkip=true

We use NCrunch for our tests, which works fine, but lets XmlDoc2CmdletDoc fail and in the end there is no reason to create the documentation for that case at all.

ternag commented 2 years ago

NCrunch defines a build variable when it runs, so you can add a condition to the target in your project file like this:

<Target Name="Generate PowerShell help file" BeforeTargets="PostBuildEvent" Condition="$(NCrunch) != '1'">