Create a Project
The Import Project command can be used to create a new project from a settings file.
Create a Project Template
The simplest way to create a project is to export project settings from an existing NCover project, which can be used as a template.
The Export command creates a zip file in JSON format, which can be modified as desired.
Then, use the NCover Import command to load the JSON file and create a new project from those settings.
Process Overview
Here's an overview of whole process:
ncover project-export --project="ProjectName" --file="C:\MyPath\project-settings"
<Modify the exported JSON file to change the project settings>
ncover project-import --project="NewProject" --file="C:\MyPath\project-settings.json" --overwrite
Note: If --overwrite is not used, the command will use the original project name, plus a number.
Sample JSON
Below is a sample JSON file. To import it:
- Save as a text file.
- Change file extension to ".json"
- Load using the ncover project-import syntax above.
{"Name":"CodeBlaster","Config": {"branchCvgThreshold":40.0, "sequencePtCvgThreshold":35.0, "complexityThreshold":20.0, "satComplexityThreshold":80.0, "crappyMethodThreshold":10.0, "crapThreshold":30.0, "isCodeCentralProject":false, "enabled":true, "name":"CodeBlaster", {"matchData":"CodeBlaster.exe","type":"Regex"}], {"id":"0E4C58648A7346951ACE0EC565A7C8CF7E563647", "name":null, "description":null, "serverFilter":false, "enabled":true, {"include":false, "field":"Class", "condition":"Matches", "value":"Box2DX.Collision.AABB", "serverRule":false}, {"include":false, "field":"Method", "condition":"Contains", "value":"AddProxyResult", {"include":false, "field":"Method", "condition":"StartsWith", "value":"ctor() void", "serverRule":false}]}, {"id":"9DA3F9ACF6E1A066483AE4683601C45340352950", "name":"Box2DX", "description":"", "serverFilter":false, "enabled":true, {"include":true, "field":"Module", "condition":"StartsWith", "value":"Box", {"id":"7FDD87C39F4C1D0B1978089F1A33BDC0E39691F4", "name":"MethodThresholds", "description":"", "serverFilter":false, "enabled":true, {"include":true, "field":"BrnchCvgPcnt", "condition":"GTE", "value":"70", {"id":"04E3BAD39D8B34CD9DA421A45AFB8B4888B0DD81", "name":"ClassTest", "description":"", "serverFilter":false, "enabled":true, {"include":false, "field":"Class", "condition":"Contains", "value":"SwapSorter", "serverRule":false}]}], "logLevel":"Verbose", "mergeAppDomains":true, "aggregateEnabled":true, "mergeMode":"None", "syncWithCC":true, "conditionCvgThreshold":60.0, "visibility":"Private"}}