OLD | NEW |
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 import 'package:analyzer/src/context/cache.dart'; | 6 import 'package:analyzer/src/context/cache.dart'; |
7 import 'package:analyzer/task/model.dart'; | 7 import 'package:analyzer/task/model.dart'; |
8 import 'package:args/args.dart'; | 8 import 'package:args/args.dart'; |
9 import 'package:kernel/analyzer/loader.dart'; | 9 import 'package:kernel/analyzer/loader.dart'; |
10 import 'package:kernel/kernel.dart'; | 10 import 'package:kernel/kernel.dart'; |
(...skipping 30 matching lines...) Expand all Loading... |
41 } | 41 } |
42 | 42 |
43 String sdk = options['sdk']; | 43 String sdk = options['sdk']; |
44 String packagePath = options['packages']; | 44 String packagePath = options['packages']; |
45 bool strongMode = options['strong']; | 45 bool strongMode = options['strong']; |
46 | 46 |
47 String path = options.rest.single; | 47 String path = options.rest.single; |
48 var uri = new Uri(scheme: 'file', path: new File(path).absolute.path); | 48 var uri = new Uri(scheme: 'file', path: new File(path).absolute.path); |
49 var packages = | 49 var packages = |
50 getPackagesDirectory(new Uri(scheme: 'file', path: packagePath)); | 50 getPackagesDirectory(new Uri(scheme: 'file', path: packagePath)); |
51 Repository repository = new Repository(); | 51 Program repository = new Program(); |
52 | 52 |
53 new DartLoader( | 53 new DartLoader( |
54 repository, | 54 repository, |
55 new DartOptions( | 55 new DartOptions( |
56 strongMode: strongMode, sdk: sdk, packagePath: packagePath), | 56 strongMode: strongMode, sdk: sdk, packagePath: packagePath), |
57 packages) | 57 packages) |
58 .loadProgram(uri); | 58 .loadProgram(uri); |
59 | 59 |
60 CacheEntry.recomputedCounts.forEach((key, value) { | 60 CacheEntry.recomputedCounts.forEach((key, value) { |
61 print('Recomputed $key $value times'); | 61 print('Recomputed $key $value times'); |
62 }); | 62 }); |
63 | 63 |
64 AnalysisTask.stopwatchMap.forEach((key, Stopwatch watch) { | 64 AnalysisTask.stopwatchMap.forEach((key, Stopwatch watch) { |
65 print('$key took ${watch.elapsedMilliseconds} ms'); | 65 print('$key took ${watch.elapsedMilliseconds} ms'); |
66 }); | 66 }); |
67 } | 67 } |
OLD | NEW |