| OLD | NEW |
| 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, 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 build_dart; | 5 library build_dart; |
| 6 | 6 |
| 7 import "dart:io"; | 7 import "dart:io"; |
| 8 import "package:args/args.dart"; | 8 import "package:args/args.dart"; |
| 9 | 9 |
| 10 bool cleanBuild; | 10 bool cleanBuild; |
| (...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 79 } | 79 } |
| 80 | 80 |
| 81 /** | 81 /** |
| 82 * Recursively scan the current directory looking for .foo files to process. | 82 * Recursively scan the current directory looking for .foo files to process. |
| 83 */ | 83 */ |
| 84 void handleFullBuild() { | 84 void handleFullBuild() { |
| 85 var files = <String>[]; | 85 var files = <String>[]; |
| 86 | 86 |
| 87 Directory.current.list(recursive: true).listen((entity) { | 87 Directory.current.list(recursive: true).listen((entity) { |
| 88 if (entity is File) { | 88 if (entity is File) { |
| 89 files.add((entity as File).fullPathSync()); | 89 files.add((entity as File).resolveSymbolicLinksSync()); |
| 90 } | 90 } |
| 91 }, | 91 }, |
| 92 onDone: () => handleChangedFiles(files)); | 92 onDone: () => handleChangedFiles(files)); |
| 93 } | 93 } |
| 94 | 94 |
| 95 /** | 95 /** |
| 96 * Process the given list of changed files. | 96 * Process the given list of changed files. |
| 97 */ | 97 */ |
| 98 void handleChangedFiles(List<String> files) { | 98 void handleChangedFiles(List<String> files) { |
| 99 files.forEach(_processFile); | 99 files.forEach(_processFile); |
| (...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 149 } | 149 } |
| 150 | 150 |
| 151 /** | 151 /** |
| 152 * If this file is a generated file (based on the extension), delete it. | 152 * If this file is a generated file (based on the extension), delete it. |
| 153 */ | 153 */ |
| 154 void _maybeClean(File file) { | 154 void _maybeClean(File file) { |
| 155 if (file.path.endsWith(".foobar")) { | 155 if (file.path.endsWith(".foobar")) { |
| 156 file.delete(); | 156 file.delete(); |
| 157 } | 157 } |
| 158 } | 158 } |
| OLD | NEW |