| 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('entrypoint'); | 5 #library('entrypoint'); |
| 6 | 6 |
| 7 #import('io.dart'); | 7 #import('io.dart'); |
| 8 #import('lock_file.dart'); | 8 #import('lock_file.dart'); |
| 9 #import('package.dart'); | 9 #import('package.dart'); |
| 10 #import('root_source.dart'); | 10 #import('root_source.dart'); |
| (...skipping 215 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 226 }); | 226 }); |
| 227 } | 227 } |
| 228 | 228 |
| 229 /** | 229 /** |
| 230 * Validate that the pubspec for the entrypoint exists and specifies the name | 230 * Validate that the pubspec for the entrypoint exists and specifies the name |
| 231 * of the root package. | 231 * of the root package. |
| 232 */ | 232 */ |
| 233 Future _validatePubspec() { | 233 Future _validatePubspec() { |
| 234 var future = new Future.immediate(null);; | 234 var future = new Future.immediate(null);; |
| 235 if (root.pubspec.isEmpty) { | 235 if (root.pubspec.isEmpty) { |
| 236 future = exists(join(path, "pubspec.yaml")).transform((exists) { | 236 future = exists(join(root.dir, "pubspec.yaml")).transform((exists) { |
| 237 if (exists) return; | 237 if (exists) return; |
| 238 throw 'Could not find a file named "pubspec.yaml" in the directory' | 238 throw 'Could not find a file named "pubspec.yaml" in the directory ' |
| 239 '$path.'; | 239 '$path.'; |
| 240 }); | 240 }); |
| 241 } | 241 } |
| 242 | 242 |
| 243 return future.transform((_) { | 243 return future.transform((_) { |
| 244 if (root.pubspec.name != null) return; | 244 if (root.pubspec.name != null) return; |
| 245 throw '"pubspec.yaml" must contain a "name" key.'; | 245 throw '"pubspec.yaml" is missing the required "name" field (e.g. "name: ' |
| 246 '${root.name}").'; |
| 246 }); | 247 }); |
| 247 } | 248 } |
| 248 } | 249 } |
| OLD | NEW |