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

Side by Side Diff: pkg/front_end/lib/src/incremental_kernel_generator_impl.dart

Issue 2931603003: Set main procedure for Program. (Closed)
Patch Set: Created 3 years, 6 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/front_end/test/incremental_kernel_generator_test.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) 2017, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2017, 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:async'; 5 import 'dart:async';
6 import 'dart:io'; 6 import 'dart:io';
7 7
8 import 'package:front_end/file_system.dart'; 8 import 'package:front_end/file_system.dart';
9 import 'package:front_end/incremental_kernel_generator.dart'; 9 import 'package:front_end/incremental_kernel_generator.dart';
10 import 'package:front_end/src/base/api_signature.dart'; 10 import 'package:front_end/src/base/api_signature.dart';
(...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after
128 library.parent = program; 128 library.parent = program;
129 } 129 }
130 } 130 }
131 } 131 }
132 132
133 // TODO(scheglov) Add libraries which import changed libraries. 133 // TODO(scheglov) Add libraries which import changed libraries.
134 // For now the corresponding test works because we use full library 134 // For now the corresponding test works because we use full library
135 // contents to compute signatures (not just API parts). So, every library 135 // contents to compute signatures (not just API parts). So, every library
136 // that imports a changed one, is affected. 136 // that imports a changed one, is affected.
137 137
138 // Set the main procedure.
139 for (var library in program.libraries) {
140 if (library.fileUri == _entryPoint.toString()) {
141 program.mainMethod = library.procedures.firstWhere(
142 (procedure) => procedure.name.name == 'main',
143 orElse: () => null);
144 break;
145 }
146 }
147
138 return new DeltaProgram(program); 148 return new DeltaProgram(program);
139 }); 149 });
140 } 150 }
141 151
142 @override 152 @override
143 void invalidate(Uri uri) { 153 void invalidate(Uri uri) {
144 _invalidatedFiles.add(uri); 154 _invalidatedFiles.add(uri);
145 } 155 }
146 156
147 @override 157 @override
(...skipping 161 matching lines...) Expand 10 before | Expand all | Expand 10 after
309 /// TODO(scheglov) Use API signatures. 319 /// TODO(scheglov) Use API signatures.
310 /// TODO(scheglov) Or use tree shaking and compute signatures of outlines. 320 /// TODO(scheglov) Or use tree shaking and compute signatures of outlines.
311 final String signature; 321 final String signature;
312 322
313 /// Kernel libraries for libraries in the [cycle]. Bodies of dependencies 323 /// Kernel libraries for libraries in the [cycle]. Bodies of dependencies
314 /// are not included, but but references to those dependencies are included. 324 /// are not included, but but references to those dependencies are included.
315 final List<Library> kernelLibraries; 325 final List<Library> kernelLibraries;
316 326
317 _LibraryCycleResult(this.cycle, this.signature, this.kernelLibraries); 327 _LibraryCycleResult(this.cycle, this.signature, this.kernelLibraries);
318 } 328 }
OLDNEW
« no previous file with comments | « no previous file | pkg/front_end/test/incremental_kernel_generator_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698