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

Side by Side Diff: sdk/lib/_internal/pub/bin/async_compile.dart

Issue 553073002: Add a missing .url. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Regenerate. Created 6 years, 3 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 | sdk/lib/_internal/pub_generated/bin/async_compile.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) 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 import 'dart:io'; 5 import 'dart:io';
6 6
7 import 'package:args/args.dart'; 7 import 'package:args/args.dart';
8 import 'package:analyzer/src/services/formatter_impl.dart'; 8 import 'package:analyzer/src/services/formatter_impl.dart';
9 import 'package:async_await/async_await.dart' as async_await; 9 import 'package:async_await/async_await.dart' as async_await;
10 import 'package:path/path.dart' as p; 10 import 'package:path/path.dart' as p;
(...skipping 158 matching lines...) Expand 10 before | Expand all | Expand 10 after
169 } 169 }
170 170
171 /// Fix relative imports to dart2js libraries. 171 /// Fix relative imports to dart2js libraries.
172 /// 172 ///
173 /// Pub imports dart2js using relative imports that reach outside of pub's 173 /// Pub imports dart2js using relative imports that reach outside of pub's
174 /// source tree. Since the build directory is in a different location, we need 174 /// source tree. Since the build directory is in a different location, we need
175 /// to fix those to be valid relative imports from the build directory. 175 /// to fix those to be valid relative imports from the build directory.
176 String _fixDart2jsImports(String sourcePath, String source, String destPath) { 176 String _fixDart2jsImports(String sourcePath, String source, String destPath) {
177 var compilerDir = p.url.join(sourceUrl, "../compiler"); 177 var compilerDir = p.url.join(sourceUrl, "../compiler");
178 var relative = p.url.relative(compilerDir, 178 var relative = p.url.relative(compilerDir,
179 from: p.dirname(p.toUri(destPath).toString())); 179 from: p.url.dirname(p.toUri(destPath).toString()));
180 return source.replaceAll(_compilerPattern, "import '$relative"); 180 return source.replaceAll(_compilerPattern, "import '$relative");
181 } 181 }
182 182
183 /// Regenerate the pub snapshot from the async/await-compiled output. We do 183 /// Regenerate the pub snapshot from the async/await-compiled output. We do
184 /// this here since the tests need it and it's faster than doing a full SDK 184 /// this here since the tests need it and it's faster than doing a full SDK
185 /// build. 185 /// build.
186 void _generateSnapshot(String buildDir) { 186 void _generateSnapshot(String buildDir) {
187 buildDir = p.normalize(buildDir); 187 buildDir = p.normalize(buildDir);
188 188
189 var entrypoint = p.join(generatedDir, 'bin/pub.dart'); 189 var entrypoint = p.join(generatedDir, 'bin/pub.dart');
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
222 /// 222 ///
223 /// This swallows errors to accommodate multiple compilers running concurrently. 223 /// This swallows errors to accommodate multiple compilers running concurrently.
224 /// Since they will produce the same output anyway, a failure of one is fine. 224 /// Since they will produce the same output anyway, a failure of one is fine.
225 void _writeFile(String path, String contents) { 225 void _writeFile(String path, String contents) {
226 try { 226 try {
227 new File(path).writeAsStringSync(contents); 227 new File(path).writeAsStringSync(contents);
228 } on IOException catch (ex) { 228 } on IOException catch (ex) {
229 // Do nothing. 229 // Do nothing.
230 } 230 }
231 } 231 }
OLDNEW
« no previous file with comments | « no previous file | sdk/lib/_internal/pub_generated/bin/async_compile.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698