| 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 library fasta.kernel_target; | 5 library fasta.kernel_target; |
| 6 | 6 |
| 7 import 'dart:async' show Future; | 7 import 'dart:async' show Future; |
| 8 | 8 |
| 9 import 'dart:io' show File, IOSink; | 9 import 'dart:io' show File, IOSink; |
| 10 | 10 |
| (...skipping 267 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 278 return await writeLinkedProgram(uri, program, isFullProgram: true); | 278 return await writeLinkedProgram(uri, program, isFullProgram: true); |
| 279 } on InputError catch (e) { | 279 } on InputError catch (e) { |
| 280 return handleInputError(uri, e, isFullProgram: true); | 280 return handleInputError(uri, e, isFullProgram: true); |
| 281 } catch (e, s) { | 281 } catch (e, s) { |
| 282 return reportCrash(e, s, loader?.currentUriForCrashReporting); | 282 return reportCrash(e, s, loader?.currentUriForCrashReporting); |
| 283 } | 283 } |
| 284 } | 284 } |
| 285 | 285 |
| 286 Future writeDepsFile(Uri output, Uri depsFile, | 286 Future writeDepsFile(Uri output, Uri depsFile, |
| 287 {Iterable<Uri> extraDependencies}) async { | 287 {Iterable<Uri> extraDependencies}) async { |
| 288 Uri base = depsFile.resolve("."); | |
| 289 String toRelativeFilePath(Uri uri) { | 288 String toRelativeFilePath(Uri uri) { |
| 290 return Uri.parse(relativizeUri(uri, base: base)).toFilePath(); | 289 return Uri.parse(relativizeUri(uri)).toFilePath(); |
| 291 } | 290 } |
| 292 | 291 |
| 293 if (loader.first == null) return null; | 292 if (loader.first == null) return null; |
| 294 StringBuffer sb = new StringBuffer(); | 293 StringBuffer sb = new StringBuffer(); |
| 295 sb.write(toRelativeFilePath(output)); | 294 sb.write(toRelativeFilePath(output)); |
| 296 sb.write(":"); | 295 sb.write(":"); |
| 297 Set<String> allDependencies = new Set<String>(); | 296 Set<String> allDependencies = new Set<String>(); |
| 298 allDependencies.addAll(loader.getDependencies().map(toRelativeFilePath)); | 297 allDependencies.addAll(loader.getDependencies().map(toRelativeFilePath)); |
| 299 if (extraDependencies != null) { | 298 if (extraDependencies != null) { |
| 300 allDependencies.addAll(extraDependencies.map(toRelativeFilePath)); | 299 allDependencies.addAll(extraDependencies.map(toRelativeFilePath)); |
| (...skipping 398 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 699 } | 698 } |
| 700 for (Constructor constructor in superclass.constructors) { | 699 for (Constructor constructor in superclass.constructors) { |
| 701 if (constructor.name.name.isEmpty) { | 700 if (constructor.name.name.isEmpty) { |
| 702 return constructor.function.requiredParameterCount == 0 | 701 return constructor.function.requiredParameterCount == 0 |
| 703 ? constructor | 702 ? constructor |
| 704 : null; | 703 : null; |
| 705 } | 704 } |
| 706 } | 705 } |
| 707 return null; | 706 return null; |
| 708 } | 707 } |
| OLD | NEW |