| OLD | NEW |
| 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2013, 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 library analyze_api; | 5 library analyze_api; |
| 6 | 6 |
| 7 import 'dart:uri'; | 7 import 'dart:uri'; |
| 8 import 'dart:io'; | 8 import 'dart:io'; |
| 9 import '../../../sdk/lib/_internal/compiler/compiler.dart' as api; | 9 import '../../../sdk/lib/_internal/compiler/compiler.dart' as api; |
| 10 import '../../../sdk/lib/_internal/compiler/implementation/apiimpl.dart'; | 10 import '../../../sdk/lib/_internal/compiler/implementation/apiimpl.dart'; |
| (...skipping 25 matching lines...) Expand all Loading... |
| 36 Uri currentWorkingDirectory = getCurrentDirectory(); | 36 Uri currentWorkingDirectory = getCurrentDirectory(); |
| 37 var libraryRoot = currentWorkingDirectory.resolve('sdk/'); | 37 var libraryRoot = currentWorkingDirectory.resolve('sdk/'); |
| 38 var uriList = new List<Uri>(); | 38 var uriList = new List<Uri>(); |
| 39 LIBRARIES.forEach((String name, LibraryInfo info) { | 39 LIBRARIES.forEach((String name, LibraryInfo info) { |
| 40 if (info.documented) { | 40 if (info.documented) { |
| 41 uriList.add(new Uri.fromComponents(scheme: 'dart', path: name)); | 41 uriList.add(new Uri.fromComponents(scheme: 'dart', path: name)); |
| 42 } | 42 } |
| 43 }); | 43 }); |
| 44 var provider = new SourceFileProvider(); | 44 var provider = new SourceFileProvider(); |
| 45 var handler = new CollectingDiagnosticHandler(provider); | 45 var handler = new CollectingDiagnosticHandler(provider); |
| 46 handler.verbose = true; | |
| 47 var compiler = new Compiler( | 46 var compiler = new Compiler( |
| 48 provider.readStringFromUri, | 47 provider.readStringFromUri, |
| 49 handler.diagnosticHandler, | 48 handler.diagnosticHandler, |
| 50 libraryRoot, libraryRoot, | 49 libraryRoot, libraryRoot, |
| 51 <String>['--analyze-only', '--analyze-all']); | 50 <String>['--analyze-only', '--analyze-all', |
| 51 '--categories=Client,Server']); |
| 52 compiler.librariesToAnalyzeWhenRun = uriList; | 52 compiler.librariesToAnalyzeWhenRun = uriList; |
| 53 compiler.run(null); | 53 compiler.run(null); |
| 54 Expect.isFalse(handler.hasWarnings); | 54 Expect.isFalse(handler.hasWarnings); |
| 55 Expect.isFalse(handler.hasErrors); | 55 Expect.isFalse(handler.hasErrors); |
| 56 } | 56 } |
| OLD | NEW |