Developer's How-To
March 14, 2017 ยท View on GitHub
Build from command-line on Windows
-
build with
DefaulttargetPS> .\build.ps1Target
Defaultincludes the next steps (Cake tasks):Info- outputs the current version of Sharpbrake (version is calculated using GitVersion), configuration (DebugorRelease) and target (DefaultorCoverity)Clean- cleanups directories for artifacts (artifacts/VERSION), test results (artifacts/VERSION/test-results) and NuGet packages (artifacts/VERSION/nuget)Patch-Version- sets calculated SemVer into AssemblyInfo.cs and project.json files for non-test projects and updates version number for "Sharpbrake.Client" dependencyRestore-Packages- restores packages for all projects using "project.json" filesBuild- builds all projects using "project.json" filesRun-Unit-Tests- runs unit tests and calculates code coverage (OpenCover tool is used for code coverage)Publish-Coverage- publishes coverage report to codecov.io (if coverage is not skipped and this is neither a local build nor a pull request)Create-Packages- creates NuGet packages for uploading to NuGet-based repositoriesPublish-MyGet- publishes packages to MyGet repo if this is Merge Request to masterPublish-NuGet- publishes packages to NuGet repo if master is tagged
Locally test coverage results can be checked here: artifacts/VERSION/test-results/report/index.htm
NuGet packages can be found in this folder: artifacts/VERSION/nuget
Build with this target is performed automatically each time when new code is pushed to the repo or master branch is tagged. A build can be forced manually by using AppVeyor's "New Build" command. If a build on AppVeyor should be performed with some other target like
Coverityfor static code analysis, then the TARGET environment variable should be defined with the desired target (AppVeyor => Settings => Environment => Add variable). -
build with
CoveritytargetPS> .\build.ps1 -Target CoverityBuild with
Coveritytarget can be used when you need to analyze code (static analysis) with Coverity Scan. The next steps should be performed to use AppVeyor for such build:- Set TARGET environment variable to
Coverityon AppVeyor. - Run build manually using "New Build" command on AppVeyor or push some code changes to trigger build automatically.
- Go to https://scan.coverity.com/projects/sharpbrake and check static analysis results.
- Remove TARGET environment variable to "restore" normal build ("Default" target).
- Set TARGET environment variable to