Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(7)

Unified Diff: lib/src/report/html_reporter.dart

Issue 1422323005: Serve html report in server mode (Closed) Base URL: https://github.com/dart-lang/dev_compiler.git@master
Patch Set: Reformat Created 5 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « lib/src/compiler.dart ('k') | lib/src/runner/v8_runner.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/src/report/html_reporter.dart
diff --git a/lib/src/report/html_reporter.dart b/lib/src/report/html_reporter.dart
index edde31e28a34736026a1f393080cd56e3a0b2399..34971ac775a1c7a3bc26bc94b845095e92760a94 100644
--- a/lib/src/report/html_reporter.dart
+++ b/lib/src/report/html_reporter.dart
@@ -11,6 +11,7 @@ import 'dart:io';
import 'package:analyzer/src/generated/engine.dart';
import 'package:analyzer/src/generated/error.dart';
import 'package:analyzer/src/generated/source.dart';
+import 'package:path/path.dart' as path;
import 'package:source_span/source_span.dart';
import 'package:yaml/yaml.dart' as yaml;
@@ -105,10 +106,16 @@ class HtmlReporter implements AnalysisErrorListener {
}
// Write the html report.
- Page page = new Page(input, input, summaries);
- String path = '${input.replaceAll('.', '_')}_results.html';
- new File(path).writeAsStringSync(page.create());
- print('Compilation report available at ${path}; ${errors.length} issues.');
+ var page = new Page(input, input, summaries);
+ var outPath = '${input.replaceAll('.', '_')}_results.html';
+ var link = outPath;
+ if (options.serverMode) {
+ var base = path.basename(outPath);
+ outPath = path.join(options.codegenOptions.outputDir, base);
+ link = 'http://${options.host}:${options.port}/$base';
+ }
+ new File(outPath).writeAsStringSync(page.create());
+ print('Compilation report available at ${link}; ${errors.length} issues.');
}
String _getPackageName() {
« no previous file with comments | « lib/src/compiler.dart ('k') | lib/src/runner/v8_runner.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698