forked from danielpalme/ReportGenerator
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathusage.html
532 lines (460 loc) · 28.8 KB
/
usage.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
<!DOCTYPE html>
<html lang="en" ng-app="usageApp">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="robots" content="index, follow" />
<title>Usage - ReportGenerator - Converts coverage reports generated by OpenCover, dotCover, Visual Studio, NCover, Cobertura, JaCoCo, Clover, gcov or lcov into human readable reports in various formats</title>
<link rel="SHORTCUT ICON" href="/ReportGenerator/favicon.ico" type="image/x-icon" />
<link href="https://fonts.googleapis.com/css?family=Open+Sans:300,400,700" rel="stylesheet">
<link href="Content/combined.css" rel="stylesheet"/>
</head>
<body ng-controller="UsageController">
<section id="slides">
<div class="brand text-center">
<img src="Content/icon.png" alt="ReportGenerator" />
<h1>ReportGenerator</h1>
</div>
</section>
<div class="container" style="padding-top: 100px">
<div class="row">
<div class="col-md-7">
<form>
<h3>Environment</h3>
<div class="radio" ng-repeat="environment in environments track by environment.name">
<label>
<input type="radio" ng-model="$parent.selectedenvironment" ng-value="environment" ng-change="$parent.selectedpackage = $parent.packages[0]" /> <b>{{ environment.name }}</b><br/>
<div style="margin-bottom: 15px;">{{environment.description}}</div>
</label>
</div>
<h4>NuGet Package</h4>
<div class="radio" ng-repeat="package in packages track by package.name">
<label ng-class="{ 'text-muted': package.runtimes.indexOf($parent.selectedenvironment.name) === -1 }">
<input type="radio" ng-model="$parent.selectedpackage" ng-value="package" ng-disabled="package.runtimes.indexOf($parent.selectedenvironment.name) === -1" /> <b>{{ package.name }}</b><br/>
<div style="margin-bottom: 15px; white-space: pre-line;">{{package.description}}</div>
</label>
</div>
<h3>Reports</h3>
<div class="alert alert-info">Path to the coverage report(s) that should be parsed.<br/>Globbing is supported.</div>
<div class="form-group" ng-repeat="report in reports track by $index">
<div ng-class="{ 'input-group': $index > 0}">
<input type="text" class="form-control" placeholder="The path of the coverage file" ng-model="reports[$index]" required />
<span class="input-group-addon" ng-click="removeReport($index)" ng-if="$index > 0"><a href=""><i class="fa fa-trash text-danger"></i></a></span>
</div>
</div>
<div class="form-group">
<a href="" ng-click="addReport()" class="text-info"><i class="fa fa-plus-circle"></i> Add report</a>
</div>
<br/>
<h3>Target directory</h3>
<div class="alert alert-info">The directory where the generated report(s) should be saved.</div>
<div class="form-group">
<input type="text" class="form-control" placeholder="The target directory" ng-model="targetdir" required />
</div>
<br/>
<h3>Report types</h3>
<div class="alert alert-info">Download <a href="https://danielpalme.github.io/ReportGenerator/resources/SampleReports.zip">sample reports</a></div>
<div class="checkbox" ng-repeat="reporttype in reporttypes track by reporttype.name">
<label>
<input type="checkbox" ng-model="reporttype.checked" /> <b>{{reporttype.name }}</b><br/>
<div style="margin-bottom: 15px;">{{reporttype.description}}</div>
</label>
</div>
<h3>Source directories</h3>
<div class="alert alert-info">Optional directories which contain the corresponding source code.<br />The source directories are used if coverage report contains classes without path information.</div>
<div class="form-group" ng-repeat="sourcedir in sourcedirectories track by $index">
<div class="input-group">
<input type="text" class="form-control" placeholder="The source directory" ng-model="sourcedirectories[$index]" required />
<span class="input-group-addon" ng-click="removeSourceDirectory($index)"><a href=""><i class="fa fa-trash text-danger"></i></a></span>
</div>
</div>
<div class="form-group">
<a href="" ng-click="addSourceDirectory()" class="text-info"><i class="fa fa-plus-circle"></i> Add source directory</a>
</div>
<br/>
<h3>History directory</h3>
<div class="alert alert-info">Optional directory for storing <b>persistent</b> coverage information. Choose a directory which does not get deleted between builds.<br/>Required to show the history chart in the HTML reports.</div>
<div class="form-group">
<input type="text" class="form-control" placeholder="The history directory." ng-model="historydir" ng-required="(reporttypes | filter: { checked: true, requiresHistoryDir: true }).length > 0" />
</div>
<br/>
<h3>Plugins</h3>
<div class="alert alert-info">Optional plugin files for <a href="https://github.com/danielpalme/ReportGenerator/wiki/Custom-reports">custom reports</a> or <a href="https://github.com/danielpalme/ReportGenerator/wiki/Custom-history-storage">custom history storage</a>.</div>
<div class="form-group" ng-repeat="plugin in plugins track by $index">
<div class="input-group">
<input type="text" class="form-control" placeholder="The path of the plugin" ng-model="plugins[$index]" required />
<span class="input-group-addon" ng-click="removePlugin($index)"><a href=""><i class="fa fa-trash text-danger"></i></a></span>
</div>
</div>
<div class="form-group">
<a href="" ng-click="addPlugin()" class="text-info"><i class="fa fa-plus-circle"></i> Add plugin</a>
</div>
<br/>
<h3>Assembly filters</h3>
<div class="alert alert-info">Optional list of <b>assemblies</b> that should be included or excluded in the report.
<br/>Exclusion filters take precedence over inclusion filters.
<br/>Wildcards are allowed.<br/><p>Examples:<br/><code>+Included</code><br/><code>-Excluded</code></p>
</div>
<div class="form-group" ng-repeat="assemblyfilter in assemblyfilters track by $index">
<div class="input-group">
<input type="text" class="form-control" placeholder="The include or exclude filter for assemlies" ng-model="assemblyfilters[$index]" pattern="^[+-].+$" required />
<span class="input-group-addon" ng-click="removeAssemblyFilter($index)"><a href=""><i class="fa fa-trash text-danger"></i></a></span>
</div>
</div>
<div class="form-group">
<a href="" ng-click="addAssemblyFilter()" class="text-info"><i class="fa fa-plus-circle"></i> Add assembly filter</a>
</div>
<br/>
<h3>Class filters</h3>
<div class="alert alert-info">Optional list of <b>classes</b> that should be included or excluded in the report.
<br/>Exclusion filters take precedence over inclusion filters.
<br/>Wildcards are allowed.<br/><p>Examples:<br/><code>+Included</code><br/><code>-Excluded</code></p>
</div>
<div class="form-group" ng-repeat="classfilter in classfilters track by $index">
<div class="input-group">
<input type="text" class="form-control" placeholder="The include or exclude filter for classes" ng-model="classfilters[$index]" pattern="^[+-].+$" required />
<span class="input-group-addon" ng-click="removeClassFilter($index)"><a href=""><i class="fa fa-trash text-danger"></i></a></span>
</div>
</div>
<div class="form-group">
<a href="" ng-click="addClassFilter()" class="text-info"><i class="fa fa-plus-circle"></i> Add class filter</a>
</div>
<br/>
<h3>File filters</h3>
<div class="alert alert-info">Optional list of <b>files</b> that should be included or excluded in the report.
<br/>Exclusion filters take precedence over inclusion filters.
<br/>Wildcards are allowed.<br/><p>Examples:<br/><code>+Included</code><br/><code>-Excluded</code></p>
</div>
<div class="form-group" ng-repeat="filefilter in filefilters track by $index">
<div class="input-group">
<input type="text" class="form-control" placeholder="The include or exclude filter for files" ng-model="filefilters[$index]" pattern="^[+-].+$" required />
<span class="input-group-addon" ng-click="removeFileFilter($index)"><a href=""><i class="fa fa-trash text-danger"></i></a></span>
</div>
</div>
<div class="form-group">
<a href="" ng-click="addFileFilter()" class="text-info"><i class="fa fa-plus-circle"></i> Add file filter</a>
</div>
<br/>
<h3>Verbosity</h3>
<div class="alert alert-info">The verbosity level of the log messages.</div>
<div class="form-group">
<select class="form-control" ng-options="verbosity for verbosity in verbosities track by verbosity" ng-model="selectedverbosity"></select>
</div>
<h3>Title</h3>
<div class="alert alert-info">Optional title.</div>
<div class="form-group">
<input type="text" class="form-control" placeholder="Title" ng-model="title" />
</div>
<h3>Tag</h3>
<div class="alert alert-info">Optional tag or build version.</div>
<div class="form-group">
<input type="text" class="form-control" placeholder="Optional tag or build version" ng-model="tag" />
</div>
</form>
</div>
<div class="col-md-5">
<div class="hidden-md hidden-lg">
<h3>Instructions</h3>
Install <a ng-href="{{selectedpackage.url}}" target="_blank">{{selectedpackage.name}}</a>
<br />
<br />
<div ng-repeat="installoption in selectedpackage.installoptions track by installoption.tool">
<b>{{installoption.tool}}</b><br/>
<div ng-if="installoption.hint">{{installoption.hint}}</div>
<pre>{{installoption.command}}</pre>
</div>
<br />
<h4>Usage</h4>
<pre>{{getUsage()}}</pre>
</div>
<div class="hidden-xs hidden-sm" style="position: fixed;">
<h3>Instructions</h3>
Install <a ng-href="{{selectedpackage.url}}" target="_blank">{{selectedpackage.name}}</a>
<br />
<br />
<div ng-repeat="installoption in selectedpackage.installoptions track by installoption.tool">
<b>{{installoption.tool}}</b><br/>
<div ng-if="installoption.hint">{{installoption.hint}}</div>
<pre>{{installoption.command}}</pre>
</div>
<br />
<h4>Usage</h4>
<pre>{{getUsage()}}</pre>
</div>
</div>
</div>
</div>
<script src="Scripts/angular.min.js"></script>
<script>
var usageApp = angular.module('usageApp', []);
usageApp.controller('UsageController', function UsageController($scope) {
$scope.environments = [
{ name: '.NET Core', description: '.NET Core' },
{ name: '.NET Framework', description: 'The full .NET framework' }
];
$scope.packages = [
{
name: 'ReportGenerator',
url: 'https://www.nuget.org/packages/ReportGenerator',
runtimes: '.NET Framework;.NET Core',
description: 'Use this package if your project is based on .NET Framework or .NET Core and you want to use ReportGenerator via the command line or a build script.',
installoptions: [
{ tool: 'Package Manager', command: 'Install-Package ReportGenerator -Version x.y.z' },
{ tool: '.NET CLI', command: 'dotnet add package ReportGenerator --version x.y.z' }
],
executables: [
{ runtime: '.NET Framework', tool: '$(UserProfile)\\.nuget\\packages\\reportgenerator\\x.y.z\\tools\\net47\\ReportGenerator.exe' },
{ runtime: '.NET Core', tool: 'dotnet $(UserProfile)\\.nuget\\packages\\reportgenerator\\x.y.z\\tools\\netcoreapp3.0\\ReportGenerator.dll' }
]
},
{
name: 'dotnet-reportgenerator-globaltool',
url: 'https://www.nuget.org/packages/dotnet-reportgenerator-globaltool',
runtimes: '.NET Core',
description: 'Use this package if your project is based on .NET Core and you want to use ReportGenerator as a (global) \'DotnetTool\'.',
installoptions: [
{ tool: '.NET CLI', command: 'dotnet tool install --global dotnet-reportgenerator-globaltool --version x.y.z' }
],
executables: [{ runtime: '.NET Core', tool: 'reportgenerator' }]
},
{
name: 'dotnet-reportgenerator-cli',
url: 'https://www.nuget.org/packages/dotnet-reportgenerator-cli',
runtimes: '.NET Core',
description: 'Use this package if your project is based on .NET Core 2.x and you want to use ReportGenerator as a \'DotnetCliTool\'.\r\n\r\nWarning:\r\nThis package is intended for .NET Core 2.x. It will not work with .NET Core 3.x.\r\nConsider the dotnet-reportgenerator-globaltool for .NET Core 3.x.',
installoptions: [
{ tool: 'Manual', hint: 'Add the following element to your project file:', command: '<ItemGroup>\r\n <DotNetCliToolReference Include="dotnet-reportgenerator-cli" Version="x.y.z" />\r\n</ItemGroup>' }
],
executables: [{ runtime: '.NET Core', tool: 'dotnet reportgenerator' }]
}
];
$scope.verbosities = ['Verbose', 'Info', 'Warning', 'Error', 'Off'];
$scope.selectedenvironment = $scope.environments[0];
$scope.selectedpackage = $scope.packages[0];
$scope.reports = ['OpenCover.xml'];
$scope.targetdir = 'coveragereport';
$scope.reporttypes = [
{ name: 'Html', description: 'The default output format. Creates a summary overview (index.htm) and detailed reports for each class.', requiresHistoryDir: false, checked: true },
{ name: 'HtmlSummary', description: 'Creates a single HTML file (summary.htm) without links.', requiresHistoryDir: false, checked: false },
{ name: 'HtmlInline', description: 'Same as HTML but CSS and JavaScript is included in every HTML page. This results in larger file sizes, but can be useful for integration into build servers like Azure DevOps (VSTS), since they may block referenced CSS and JavaScript files.', requiresHistoryDir: false, checked: false },
{ name: 'HtmlInline_AzurePipelines', description: 'Same as HTMLInline but with modified CSS that matches the light look and feel of Azure Pipelines.', requiresHistoryDir: false, checked: false },
{ name: 'HtmlInline_AzurePipelines_Dark', description: 'Same as HTMLInline but with modified CSS that matches the dark look and feel of Azure Pipelines.', requiresHistoryDir: false, checked: false },
{ name: 'HtmlChart', description: 'Creates a single HTML file containing a chart with historic coverage information.', requiresHistoryDir: true, checked: false },
{ name: 'MHtml', description: 'Same as HTML but packaged into a single MHTML file.', requiresHistoryDir: false, checked: false },
{ name: 'Clover', description: 'Creates a XML file in Clover format. This format integrates with tools like Atlassian Bamboo.', requiresHistoryDir: false, checked: false },
{ name: 'Cobertura', description: 'Creates a XML file in Cobertura format. This format integrates with tools like Azure DevOps (VSTS) or Jenkins.', requiresHistoryDir: false, checked: false },
{ name: 'SonarQube', description: 'Creates a XML file in SonarQube \'Generic Test Data\' format.', requiresHistoryDir: false, checked: false },
{ name: 'lcov', description: 'Creates a text file in \'lcov\' format.', requiresHistoryDir: false, checked: false },
{ name: 'XML', description: 'Creates a XML file containing a summary for all classes and detailed reports for each class.', requiresHistoryDir: false, checked: false },
{ name: 'XMLSummary', description: 'Creates a single XML file containing a summary for all classes.', requiresHistoryDir: false, checked: false },
{ name: 'JsonSummary', description: 'Creates a single JSON file containing a summary for all classes.', requiresHistoryDir: false, checked: false },
{ name: 'Latex', description: 'Creates a single TEX file containing a summary for all classes and detailed reports for each class.', requiresHistoryDir: false, checked: false },
{ name: 'LatexSummary', description: 'Creates a single TEX file containing a summary for all classes.', requiresHistoryDir: false, checked: false },
{ name: 'TeamCitySummary', description: 'Command line output interpreted by TeamCity.', requiresHistoryDir: false, checked: false },
{ name: 'TextSummary', description: 'Creates a single TXT file containing coverage information per class.', requiresHistoryDir: false, checked: false },
{ name: 'CsvSummary', description: 'Creates a single CSV file containing coverage information per class.', requiresHistoryDir: false, checked: false },
{ name: 'PngChart', description: 'Creates a single PNG file containing a chart with historic coverage information.', requiresHistoryDir: true, checked: false },
{ name: 'Badges', description: 'Creates three SVG and two PNG files that show line and/or branch coverage information.', requiresHistoryDir: false, checked: false }
];
$scope.sourcedirectories = [];
$scope.historydir = null;
$scope.plugins = [];
$scope.assemblyfilters = [];
$scope.classfilters = [];
$scope.filefilters = [];
$scope.selectedverbosity = 'Verbose';
$scope.title = '';
$scope.tag = '';
$scope.addSourceDirectory = function() {
$scope.sourcedirectories.push(null);
}
$scope.removeSourceDirectory = function(index) {
$scope.sourcedirectories.splice(index, 1);
}
$scope.addReport = function() {
$scope.reports.push(null);
}
$scope.removeReport = function(index) {
$scope.reports.splice(index, 1);
}
$scope.addPlugin = function() {
$scope.plugins.push(null);
}
$scope.removePlugin = function(index) {
$scope.plugins.splice(index, 1);
}
$scope.addAssemblyFilter = function() {
$scope.assemblyfilters.push(null);
}
$scope.removeAssemblyFilter = function(index) {
$scope.assemblyfilters.splice(index, 1);
}
$scope.addClassFilter = function() {
$scope.classfilters.push(null);
}
$scope.removeClassFilter = function(index) {
$scope.classfilters.splice(index, 1);
}
$scope.addFileFilter = function() {
$scope.filefilters.push(null);
}
$scope.removeFileFilter = function(index) {
$scope.filefilters.splice(index, 1);
}
var getCommandLineParameters = function() {
var result = '"-reports:';
for (var i = 0; i < $scope.reports.length; i++) {
if ($scope.reports[i] === null || $scope.reports[i] === undefined || $scope.reports[i].length === 0) {
continue;
}
if (i > 0) {
result += ';';
}
result += $scope.reports[i];
}
result += '"';
result += '\r\n';
result += '"-targetdir:';
result += $scope.targetdir;
result += '"';
var checkedreporttypes = '';
for (var i = 0; i < $scope.reporttypes.length; i++) {
if (!$scope.reporttypes[i].checked) {
continue;
}
if (checkedreporttypes.length > 0) {
checkedreporttypes += ';';
}
checkedreporttypes += $scope.reporttypes[i].name;
}
if (checkedreporttypes.length > 0 && checkedreporttypes !== 'HTML') {
result += '\r\n';
result += '-reporttypes:';
result += checkedreporttypes;
}
if ($scope.sourcedirectories.length > 0) {
result += '\r\n';
result += '"-sourcedirs:';
for (var i = 0; i < $scope.sourcedirectories.length; i++) {
if ($scope.sourcedirectories[i] === null || $scope.sourcedirectories[i] === undefined || $scope.sourcedirectories[i].length === 0) {
continue;
}
if (i > 0) {
result += ';';
}
result += $scope.sourcedirectories[i];
}
result += '"';
}
if ($scope.historydir !== null && $scope.historydir.length > 0) {
result += '\r\n';
result += '"-historydir:';
result += $scope.historydir;
result += '"';
}
if ($scope.plugins.length > 0) {
result += '\r\n';
result += '"-plugins:';
for (var i = 0; i < $scope.plugins.length; i++) {
if ($scope.plugins[i] === null || $scope.plugins[i] === undefined || $scope.plugins[i].length === 0) {
continue;
}
if (i > 0) {
result += ';';
}
result += $scope.plugins[i];
}
result += '"';
}
if ($scope.assemblyfilters.length > 0) {
result += '\r\n';
result += '"-assemblyfilters:';
for (var i = 0; i < $scope.assemblyfilters.length; i++) {
if ($scope.assemblyfilters[i] === null || $scope.assemblyfilters[i] === undefined || $scope.assemblyfilters[i].length === 0) {
continue;
}
if (i > 0) {
result += ';';
}
result += $scope.assemblyfilters[i];
}
result += '"';
}
if ($scope.classfilters.length > 0) {
result += '\r\n';
result += '"-classfilters:';
for (var i = 0; i < $scope.classfilters.length; i++) {
if ($scope.classfilters[i] === null || $scope.classfilters[i] === undefined || $scope.classfilters[i].length === 0) {
continue;
}
if (i > 0) {
result += ';';
}
result += $scope.classfilters[i];
}
result += '"';
}
if ($scope.filefilters.length > 0) {
result += '\r\n';
result += '"-filefilters:';
for (var i = 0; i < $scope.filefilters.length; i++) {
if ($scope.filefilters[i] === null || $scope.filefilters[i] === undefined || $scope.filefilters[i].length === 0) {
continue;
}
if (i > 0) {
result += ';';
}
result += $scope.filefilters[i];
}
result += '"';
}
if ($scope.selectedverbosity !== 'Verbose') {
result += '\r\n';
result += '-verbosity:';
result += $scope.selectedverbosity;
}
if ($scope.title !== '') {
result += '\r\n';
if ($scope.title.indexOf(' ') > -1) {
result += '"-title:';
result += $scope.title;
result += '"';
} else {
result += '-title:';
result += $scope.title;
}
}
if ($scope.tag !== '') {
result += '\r\n';
if ($scope.tag.indexOf(' ') > -1) {
result += '"-tag:';
result += $scope.tag;
result += '"';
} else {
result += '-tag:';
result += $scope.tag;
}
}
return result;
}
$scope.getUsage = function() {
var commandLineParameters = getCommandLineParameters();
var result = '';
for (var i = 0; i < $scope.selectedpackage.executables.length; i++) {
if ($scope.selectedpackage.executables[i].runtime !== $scope.selectedenvironment.name) {
continue;
}
if (result.length > 0) {
result += '\r\n\r\n';
}
result += $scope.selectedpackage.executables[i].tool;
result += '\r\n';
result += commandLineParameters;
}
return result;
}
});
</script>
</body>
</html>