OLD | NEW |
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2013, 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 /** | 5 /** |
6 * Definitions used to run the polymer linter and deploy tools without using | 6 * Definitions used to run the polymer linter and deploy tools without using |
7 * pub serve or pub deploy. | 7 * pub serve or pub deploy. |
8 */ | 8 */ |
9 library polymer.src.barback_runner; | 9 library polymer.src.build.runner; |
10 | 10 |
11 import 'dart:async'; | 11 import 'dart:async'; |
12 import 'dart:convert'; | 12 import 'dart:convert'; |
13 import 'dart:io'; | 13 import 'dart:io'; |
14 | 14 |
15 import 'package:args/args.dart'; | 15 import 'package:args/args.dart'; |
16 import 'package:barback/barback.dart'; | 16 import 'package:barback/barback.dart'; |
17 import 'package:path/path.dart' as path; | 17 import 'package:path/path.dart' as path; |
18 import 'package:stack_trace/stack_trace.dart'; | 18 import 'package:stack_trace/stack_trace.dart'; |
19 import 'package:yaml/yaml.dart'; | 19 import 'package:yaml/yaml.dart'; |
(...skipping 283 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
303 return writer.addStream(new File(inpath).openRead()) | 303 return writer.addStream(new File(inpath).openRead()) |
304 .then((_) => writer.close()); | 304 .then((_) => writer.close()); |
305 } | 305 } |
306 | 306 |
307 /** Write contents of an [asset] into a file at [filepath]. */ | 307 /** Write contents of an [asset] into a file at [filepath]. */ |
308 Future _writeAsset(String filepath, Asset asset) { | 308 Future _writeAsset(String filepath, Asset asset) { |
309 _ensureDir(path.dirname(filepath)); | 309 _ensureDir(path.dirname(filepath)); |
310 var writer = new File(filepath).openWrite(); | 310 var writer = new File(filepath).openWrite(); |
311 return writer.addStream(asset.read()).then((_) => writer.close()); | 311 return writer.addStream(asset.read()).then((_) => writer.close()); |
312 } | 312 } |
OLD | NEW |