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 import 'dart:async'; | 5 import 'dart:async'; |
6 | 6 |
7 import 'package:barback/barback.dart'; | 7 import 'package:barback/barback.dart'; |
8 import 'package:path/path.dart' as path; | 8 import 'package:path/path.dart' as path; |
9 | 9 |
10 import '../command.dart'; | 10 import '../command.dart'; |
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
104 // Make sure all of the source directories exist. | 104 // Make sure all of the source directories exist. |
105 var missing = sourceDirectories.where( | 105 var missing = sourceDirectories.where( |
106 (dir) => !dirExists(entrypoint.root.path(dir))); | 106 (dir) => !dirExists(entrypoint.root.path(dir))); |
107 | 107 |
108 if (missing.isNotEmpty) { | 108 if (missing.isNotEmpty) { |
109 dataError(_directorySentence(missing, "does", "do", "not exist")); | 109 dataError(_directorySentence(missing, "does", "do", "not exist")); |
110 } | 110 } |
111 | 111 |
112 // Make sure the directories don't overlap. | 112 // Make sure the directories don't overlap. |
113 var sources = sourceDirectories.toList(); | 113 var sources = sourceDirectories.toList(); |
114 var overlapping = new Set(); | 114 var overlapping = new Set<String>(); |
115 for (var i = 0; i < sources.length; i++) { | 115 for (var i = 0; i < sources.length; i++) { |
116 for (var j = i + 1; j < sources.length; j++) { | 116 for (var j = i + 1; j < sources.length; j++) { |
117 if (path.isWithin(sources[i], sources[j]) || | 117 if (path.isWithin(sources[i], sources[j]) || |
118 path.isWithin(sources[j], sources[i])) { | 118 path.isWithin(sources[j], sources[i])) { |
119 overlapping.add(sources[i]); | 119 overlapping.add(sources[i]); |
120 overlapping.add(sources[j]); | 120 overlapping.add(sources[j]); |
121 } | 121 } |
122 } | 122 } |
123 } | 123 } |
124 | 124 |
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
187 var verb = pluralize(singularVerb, directoryNames.length, | 187 var verb = pluralize(singularVerb, directoryNames.length, |
188 plural: pluralVerb); | 188 plural: pluralVerb); |
189 | 189 |
190 var result = "$directories $names $verb"; | 190 var result = "$directories $names $verb"; |
191 if (suffix != null) result += " $suffix"; | 191 if (suffix != null) result += " $suffix"; |
192 result += "."; | 192 result += "."; |
193 | 193 |
194 return result; | 194 return result; |
195 } | 195 } |
196 } | 196 } |
OLD | NEW |