| Index: sdk/lib/_internal/pub_generated/test/descriptor.dart
|
| diff --git a/sdk/lib/_internal/pub/test/descriptor.dart b/sdk/lib/_internal/pub_generated/test/descriptor.dart
|
| similarity index 78%
|
| copy from sdk/lib/_internal/pub/test/descriptor.dart
|
| copy to sdk/lib/_internal/pub_generated/test/descriptor.dart
|
| index 67db472436906cd6362d3b9c17b35bb23ba27d7e..18fa385d596d607c7f569733dc685be65d1c20eb 100644
|
| --- a/sdk/lib/_internal/pub/test/descriptor.dart
|
| +++ b/sdk/lib/_internal/pub_generated/test/descriptor.dart
|
| @@ -28,13 +28,13 @@ TarFileDescriptor tar(String name, [Iterable<Descriptor> contents]) =>
|
| new TarFileDescriptor(name, contents == null ? <Descriptor>[] : contents);
|
|
|
| /// Describes a package that passes all validation.
|
| -Descriptor get validPackage => dir(appPath, [
|
| - libPubspec("test_pkg", "1.0.0"),
|
| - file("LICENSE", "Eh, do what you want."),
|
| - dir("lib", [
|
| - file("test_pkg.dart", "int i = 1;")
|
| - ])
|
| -]);
|
| +Descriptor get validPackage =>
|
| + dir(
|
| + appPath,
|
| + [
|
| + libPubspec("test_pkg", "1.0.0"),
|
| + file("LICENSE", "Eh, do what you want."),
|
| + dir("lib", [file("test_pkg.dart", "int i = 1;")])]);
|
|
|
| /// Returns a descriptor of a snapshot that can't be run by the current VM.
|
| ///
|
| @@ -49,14 +49,18 @@ FileDescriptor outOfDateSnapshot(String name) =>
|
| /// [contents] may contain [Future]s that resolve to serializable objects,
|
| /// which may in turn contain [Future]s recursively.
|
| Descriptor pubspec(Map contents) {
|
| - return async(awaitObject(contents).then((resolvedContents) =>
|
| - file("pubspec.yaml", yaml(resolvedContents))));
|
| + return async(
|
| + awaitObject(
|
| + contents).then(
|
| + (resolvedContents) => file("pubspec.yaml", yaml(resolvedContents))));
|
| }
|
|
|
| /// Describes a file named `pubspec.yaml` for an application package with the
|
| /// given [dependencies].
|
| Descriptor appPubspec([Map dependencies]) {
|
| - var map = {"name": "myapp"};
|
| + var map = {
|
| + "name": "myapp"
|
| + };
|
| if (dependencies != null) map["dependencies"] = dependencies;
|
| return pubspec(map);
|
| }
|
| @@ -66,7 +70,9 @@ Descriptor appPubspec([Map dependencies]) {
|
| /// constraint on that version.
|
| 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);
|
| }
|
|
|
| @@ -75,9 +81,7 @@ Descriptor libPubspec(String name, String version, {Map deps, String sdk}) {
|
| Descriptor libDir(String name, [String code]) {
|
| // Default to printing the name if no other code was given.
|
| if (code == null) code = name;
|
| - return dir("lib", [
|
| - file("$name.dart", 'main() => "$code";')
|
| - ]);
|
| + return dir("lib", [file("$name.dart", 'main() => "$code";')]);
|
| }
|
|
|
| /// Describes a directory for a Git package. This directory is of the form
|
| @@ -85,20 +89,18 @@ Descriptor libDir(String name, [String code]) {
|
| Descriptor gitPackageRevisionCacheDir(String name, [int modifier]) {
|
| var value = name;
|
| if (modifier != null) value = "$name $modifier";
|
| - return pattern(new RegExp("$name${r'-[a-f0-9]+'}"),
|
| + return pattern(
|
| + new RegExp("$name${r'-[a-f0-9]+'}"),
|
| (dirName) => dir(dirName, [libDir(name, value)]));
|
| }
|
|
|
| /// Describes a directory for a Git package. This directory is of the form
|
| /// found in the repo cache of the global package cache.
|
| Descriptor gitPackageRepoCacheDir(String name) {
|
| - return pattern(new RegExp("$name${r'-[a-f0-9]+'}"),
|
| - (dirName) => dir(dirName, [
|
| - dir('hooks'),
|
| - dir('info'),
|
| - dir('objects'),
|
| - dir('refs')
|
| - ]));
|
| + return pattern(
|
| + new RegExp("$name${r'-[a-f0-9]+'}"),
|
| + (dirName) =>
|
| + dir(dirName, [dir('hooks'), dir('info'), dir('objects'), dir('refs')]));
|
| }
|
|
|
| /// Describes the `packages/` directory containing all the given [packages],
|
| @@ -112,9 +114,8 @@ Descriptor packagesDir(Map<String, String> packages) {
|
| if (version == null) {
|
| contents.add(nothing(name));
|
| } else {
|
| - contents.add(dir(name, [
|
| - file("$name.dart", 'main() => "$name $version";')
|
| - ]));
|
| + contents.add(
|
| + dir(name, [file("$name.dart", 'main() => "$name $version";')]));
|
| }
|
| });
|
| return dir(packagesPath, contents);
|
| @@ -151,34 +152,32 @@ Descriptor cacheDir(Map packages, {bool includePubspecs: false}) {
|
| /// Describes the main cache directory containing cached hosted packages
|
| /// downloaded from the mock package server.
|
| Descriptor hostedCache(Iterable<Descriptor> contents) {
|
| - return dir(cachePath, [
|
| - dir('hosted', [
|
| - async(port.then((p) => dir('localhost%58$p', contents)))
|
| - ])
|
| - ]);
|
| + return dir(
|
| + cachePath,
|
| + [dir('hosted', [async(port.then((p) => dir('localhost%58$p', contents)))])]);
|
| }
|
|
|
| /// Describes the file in the system cache that contains the client's OAuth2
|
| /// credentials. The URL "/token" on [server] will be used as the token
|
| /// endpoint for refreshing the access token.
|
| -Descriptor credentialsFile(
|
| - ScheduledServer server,
|
| - String accessToken,
|
| - {String refreshToken,
|
| - DateTime expiration}) {
|
| +Descriptor credentialsFile(ScheduledServer server, String accessToken,
|
| + {String refreshToken, DateTime expiration}) {
|
| return async(server.url.then((url) {
|
| - return dir(cachePath, [
|
| - file('credentials.json', new oauth2.Credentials(
|
| - accessToken,
|
| - refreshToken,
|
| - url.resolve('/token'),
|
| - ['https://www.googleapis.com/auth/userinfo.email'],
|
| - expiration).toJson())
|
| - ]);
|
| + return dir(
|
| + cachePath,
|
| + [
|
| + file(
|
| + 'credentials.json',
|
| + new oauth2.Credentials(
|
| + accessToken,
|
| + refreshToken,
|
| + url.resolve('/token'),
|
| + ['https://www.googleapis.com/auth/userinfo.email'],
|
| + expiration).toJson())]);
|
| }));
|
| }
|
|
|
| /// Describes the application directory, containing only a pubspec specifying
|
| /// the given [dependencies].
|
| DirectoryDescriptor appDir([Map dependencies]) =>
|
| - dir(appPath, [appPubspec(dependencies)]);
|
| + dir(appPath, [appPubspec(dependencies)]);
|
|
|