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

Side by Side Diff: pkg/compiler/bin/resolver.dart

Issue 2237543002: Improve error reporting: use colors and associate the appropiate file with (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 years, 4 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 unified diff | Download patch
« no previous file with comments | « no previous file | pkg/compiler/lib/src/source_file_provider.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 import 'dart:io'; 5 import 'dart:io';
6 6
7 import 'package:args/args.dart'; 7 import 'package:args/args.dart';
8 import 'package:compiler/src/apiimpl.dart'; 8 import 'package:compiler/src/apiimpl.dart';
9 import 'package:compiler/src/filenames.dart'; 9 import 'package:compiler/src/filenames.dart';
10 import 'package:compiler/src/null_compiler_output.dart'; 10 import 'package:compiler/src/null_compiler_output.dart';
(...skipping 27 matching lines...) Expand all
38 resolveOnly: true, 38 resolveOnly: true,
39 resolutionInputs: resolutionInputs, 39 resolutionInputs: resolutionInputs,
40 packagesDiscoveryProvider: findPackages); 40 packagesDiscoveryProvider: findPackages);
41 41
42 var bazelSearchPaths = args['bazel-paths']; 42 var bazelSearchPaths = args['bazel-paths'];
43 var inputProvider = bazelSearchPaths != null 43 var inputProvider = bazelSearchPaths != null
44 ? new BazelInputProvider(bazelSearchPaths) 44 ? new BazelInputProvider(bazelSearchPaths)
45 : new CompilerSourceFileProvider(); 45 : new CompilerSourceFileProvider();
46 46
47 var outputProvider = const NullCompilerOutput(); 47 var outputProvider = const NullCompilerOutput();
48 var diagnostics = new FormattingDiagnosticHandler(inputProvider); 48 var diagnostics = new FormattingDiagnosticHandler(inputProvider)
49 ..enableColors = true;
49 var compiler = 50 var compiler =
50 new CompilerImpl(inputProvider, outputProvider, diagnostics, options); 51 new CompilerImpl(inputProvider, outputProvider, diagnostics, options);
51 52
52 if (args.rest.isEmpty) { 53 if (args.rest.isEmpty) {
53 print('missing input files'); 54 print('missing input files');
54 exit(1); 55 exit(1);
55 } 56 }
56 57
57 var inputs = args.rest 58 var inputs = args.rest
58 .map((uri) => currentDirectory.resolve(nativeToUriPath(uri))) 59 .map((uri) => currentDirectory.resolve(nativeToUriPath(uri)))
(...skipping 17 matching lines...) Expand all
76 inputs.map((lib) => compiler.libraryLoader.lookupLibrary(lib)).toList(); 77 inputs.map((lib) => compiler.libraryLoader.lookupLibrary(lib)).toList();
77 78
78 var serializer = 79 var serializer =
79 compiler.serialization.createSerializer(librariesToSerialize); 80 compiler.serialization.createSerializer(librariesToSerialize);
80 var text = serializer.toText(const JsonSerializationEncoder()); 81 var text = serializer.toText(const JsonSerializationEncoder());
81 82
82 var outFile = args['out'] ?? 'out.data'; 83 var outFile = args['out'] ?? 'out.data';
83 84
84 await new File(outFile).writeAsString(text); 85 await new File(outFile).writeAsString(text);
85 } 86 }
OLDNEW
« no previous file with comments | « no previous file | pkg/compiler/lib/src/source_file_provider.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698