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 analyzer.src.generated.sdk2; | 5 library analyzer.src.generated.sdk2; |
6 | 6 |
7 import 'dart:collection'; | 7 import 'dart:collection'; |
8 import 'dart:convert'; | 8 import 'dart:convert'; |
9 import 'dart:io' as io; | 9 import 'dart:io' as io; |
10 | 10 |
(...skipping 680 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
691 exec = exec.substring(2); | 691 exec = exec.substring(2); |
692 } else if (resourceProvider is MemoryResourceProvider) { | 692 } else if (resourceProvider is MemoryResourceProvider) { |
693 exec = resourceProvider.convertPath(exec); | 693 exec = resourceProvider.convertPath(exec); |
694 } | 694 } |
695 exec = pathContext.fromUri(pathos.context.toUri(exec)); | 695 exec = pathContext.fromUri(pathos.context.toUri(exec)); |
696 } | 696 } |
697 // Might be "xcodebuild/ReleaseIA32/dart" with "sdk" sibling | 697 // Might be "xcodebuild/ReleaseIA32/dart" with "sdk" sibling |
698 String outDir = pathContext.dirname(pathContext.dirname(exec)); | 698 String outDir = pathContext.dirname(pathContext.dirname(exec)); |
699 String sdkPath = pathContext.join(pathContext.dirname(outDir), "sdk"); | 699 String sdkPath = pathContext.join(pathContext.dirname(outDir), "sdk"); |
700 if (resourceProvider.getFolder(sdkPath).exists) { | 700 if (resourceProvider.getFolder(sdkPath).exists) { |
701 return sdkPath; | 701 // We are executing in the context of a test. sdkPath is the path to the |
702 // *source* files for the SDK. But we want to test using the path to the | |
703 // *built* SDK if possible. | |
704 String builtSdkPath = | |
705 pathContext.join(pathContext.dirname(exec), 'dart-sdk'); | |
706 if (resourceProvider.getFolder(sdkPath).exists) { | |
zra
2016/12/12 19:16:17
Shouldn't this be checking the existence of buildS
Paul Berry
2016/12/12 19:24:39
Yes, I just noticed this as well. Thanks.
Paul Berry
2016/12/12 19:27:50
Fix is here: https://codereview.chromium.org/25682
| |
707 return builtSdkPath; | |
708 } else { | |
709 return sdkPath; | |
710 } | |
702 } | 711 } |
703 // probably be "dart-sdk/bin/dart" | 712 // probably be "dart-sdk/bin/dart" |
704 return pathContext.dirname(pathContext.dirname(exec)); | 713 return pathContext.dirname(pathContext.dirname(exec)); |
705 } | 714 } |
706 } | 715 } |
707 | 716 |
708 /** | 717 /** |
709 * An object used to locate SDK extensions. | 718 * An object used to locate SDK extensions. |
710 * | 719 * |
711 * Given a package map, it will check in each package's `lib` directory for the | 720 * Given a package map, it will check in each package's `lib` directory for the |
(...skipping 171 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
883 SdkLibrariesReader_LibraryBuilder libraryBuilder = | 892 SdkLibrariesReader_LibraryBuilder libraryBuilder = |
884 new SdkLibrariesReader_LibraryBuilder(_useDart2jsPaths); | 893 new SdkLibrariesReader_LibraryBuilder(_useDart2jsPaths); |
885 // If any syntactic errors were found then don't try to visit the AST | 894 // If any syntactic errors were found then don't try to visit the AST |
886 // structure. | 895 // structure. |
887 if (!errorListener.errorReported) { | 896 if (!errorListener.errorReported) { |
888 unit.accept(libraryBuilder); | 897 unit.accept(libraryBuilder); |
889 } | 898 } |
890 return libraryBuilder.librariesMap; | 899 return libraryBuilder.librariesMap; |
891 } | 900 } |
892 } | 901 } |
OLD | NEW |