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

Side by Side Diff: pkg/analyzer/lib/source/pub_package_map_provider.dart

Issue 966453002: (TBR) fix PubPackageMapProvider to use resourceProvider context for path (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 5 years, 9 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | 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) 2014, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2014, 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 source.pub_package_map_provider; 5 library source.pub_package_map_provider;
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 78 matching lines...) Expand 10 before | Expand all | Expand 10 after
89 } 89 }
90 90
91 /** 91 /**
92 * Create a PackageMapInfo object representing an error condition. 92 * Create a PackageMapInfo object representing an error condition.
93 */ 93 */
94 PackageMapInfo computePackageMapError(Folder folder) { 94 PackageMapInfo computePackageMapError(Folder folder) {
95 // Even if an error occurs, we still need to know the dependencies, so that 95 // Even if an error occurs, we still need to know the dependencies, so that
96 // we'll know when to try running "pub list-package-dirs" again. 96 // we'll know when to try running "pub list-package-dirs" again.
97 // Unfortunately, "pub list-package-dirs" doesn't tell us dependencies when 97 // Unfortunately, "pub list-package-dirs" doesn't tell us dependencies when
98 // an error occurs, so just assume there is one dependency, "pubspec.lock". 98 // an error occurs, so just assume there is one dependency, "pubspec.lock".
99 List<String> dependencies = <String>[join(folder.path, PUBSPEC_LOCK_NAME)]; 99 List<String> dependencies = <String>[
100 resourceProvider.pathContext.join(folder.path, PUBSPEC_LOCK_NAME)];
100 return new PackageMapInfo(null, dependencies.toSet()); 101 return new PackageMapInfo(null, dependencies.toSet());
101 } 102 }
102 103
103 /** 104 /**
104 * Decode the JSON output from pub into a package map. Paths in the 105 * Decode the JSON output from pub into a package map. Paths in the
105 * output are considered relative to [folder]. 106 * output are considered relative to [folder].
106 */ 107 */
107 PackageMapInfo parsePackageMap(Map obj, Folder folder) { 108 PackageMapInfo parsePackageMap(Map obj, Folder folder) {
108 // The output of pub looks like this: 109 // The output of pub looks like this:
109 // { 110 // {
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
154 /** 155 /**
155 * Run pub list to determine the packages and input files. 156 * Run pub list to determine the packages and input files.
156 */ 157 */
157 io.ProcessResult _runPubListDefault(Folder folder) { 158 io.ProcessResult _runPubListDefault(Folder folder) {
158 return io.Process.runSync( 159 return io.Process.runSync(
159 sdk.pubExecutable.getAbsolutePath(), 160 sdk.pubExecutable.getAbsolutePath(),
160 [PUB_LIST_COMMAND], 161 [PUB_LIST_COMMAND],
161 workingDirectory: folder.path); 162 workingDirectory: folder.path);
162 } 163 }
163 } 164 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698