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

Unified Diff: sdk/lib/_internal/pub/test/descriptor.dart

Issue 19592015: Get rid of hokey dependencyMapList stuff. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 5 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 side-by-side diff with in-line comments
Download patch
Index: sdk/lib/_internal/pub/test/descriptor.dart
diff --git a/sdk/lib/_internal/pub/test/descriptor.dart b/sdk/lib/_internal/pub/test/descriptor.dart
index bccc72d6191fae2648f696483aecf69fa178b2b9..7893f8805150ef12996a7a0a5996b02d67932b60 100644
--- a/sdk/lib/_internal/pub/test/descriptor.dart
+++ b/sdk/lib/_internal/pub/test/descriptor.dart
@@ -48,25 +48,18 @@ Descriptor pubspec(Map contents) {
/// Describes a file named `pubspec.yaml` for an application package with the
/// given [dependencies].
-Descriptor appPubspec(List dependencies) {
- return pubspec({
- "name": "myapp",
- "dependencies": dependencyListToMap(dependencies)
- });
+Descriptor appPubspec([Map dependencies]) {
+ var map = {"name": "myapp"};
+ if (dependencies != null) map["dependencies"] = dependencies;
+ return pubspec(map);
}
/// Describes a file named `pubspec.yaml` for a library package with the given
/// [name], [version], and [deps]. If "sdk" is given, then it adds an SDK
/// constraint on that version.
-Descriptor libPubspec(String name, String version, {List deps, String sdk}) {
+Descriptor libPubspec(String name, String version, {Map deps, String sdk}) {
var map = packageMap(name, version, deps);
-
- if (sdk != null) {
- map["environment"] = {
- "sdk": sdk
- };
- }
-
+ if (sdk != null) map["environment"] = {"sdk": sdk};
return pubspec(map);
}
@@ -74,10 +67,7 @@ Descriptor libPubspec(String name, String version, {List deps, String sdk}) {
/// `<name>.dart` that contains a line of Dart code.
Descriptor libDir(String name, [String code]) {
// Default to printing the name if no other code was given.
- if (code == null) {
- code = name;
- }
-
+ if (code == null) code = name;
return dir("lib", [
file("$name.dart", 'main() => "$code";')
]);
@@ -177,5 +167,5 @@ Descriptor credentialsFile(
/// Describes the application directory, containing only a pubspec specifying
/// the given [dependencies].
-DirectoryDescriptor appDir(List dependencies) =>
+DirectoryDescriptor appDir([Map dependencies]) =>
dir(appPath, [appPubspec(dependencies)]);
« no previous file with comments | « sdk/lib/_internal/pub/test/deploy/with_no_web_directory_test.dart ('k') | sdk/lib/_internal/pub/test/dev_dependency_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698