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 /// Pub-specific scheduled_test descriptors. | 5 /// Pub-specific scheduled_test descriptors. |
6 library descriptor; | 6 library descriptor; |
7 | 7 |
8 import "dart:io" show File; | 8 import "dart:io" show File; |
9 | 9 |
10 import 'package:oauth2/oauth2.dart' as oauth2; | 10 import 'package:oauth2/oauth2.dart' as oauth2; |
(...skipping 159 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
170 /// endpoint for refreshing the access token. | 170 /// endpoint for refreshing the access token. |
171 Descriptor credentialsFile( | 171 Descriptor credentialsFile( |
172 ScheduledServer server, | 172 ScheduledServer server, |
173 String accessToken, | 173 String accessToken, |
174 {String refreshToken, | 174 {String refreshToken, |
175 DateTime expiration}) { | 175 DateTime expiration}) { |
176 return async(server.url.then((url) { | 176 return async(server.url.then((url) { |
177 return dir(cachePath, [ | 177 return dir(cachePath, [ |
178 file('credentials.json', new oauth2.Credentials( | 178 file('credentials.json', new oauth2.Credentials( |
179 accessToken, | 179 accessToken, |
180 refreshToken, | 180 refreshToken: refreshToken, |
181 url.resolve('/token'), | 181 tokenEndpoint: url.resolve('/token'), |
182 ['https://www.googleapis.com/auth/userinfo.email'], | 182 scopes: ['https://www.googleapis.com/auth/userinfo.email'], |
183 expiration).toJson()) | 183 expiration: expiration).toJson()) |
184 ]); | 184 ]); |
185 })); | 185 })); |
186 } | 186 } |
187 | 187 |
188 /// Describes the application directory, containing only a pubspec specifying | 188 /// Describes the application directory, containing only a pubspec specifying |
189 /// the given [dependencies]. | 189 /// the given [dependencies]. |
190 DirectoryDescriptor appDir([Map dependencies]) => | 190 DirectoryDescriptor appDir([Map dependencies]) => |
191 dir(appPath, [appPubspec(dependencies)]); | 191 dir(appPath, [appPubspec(dependencies)]); |
192 | 192 |
193 /// Describes a `.packages` file. | 193 /// Describes a `.packages` file. |
194 /// | 194 /// |
195 /// [dependencies] maps package names to strings describing where the packages | 195 /// [dependencies] maps package names to strings describing where the packages |
196 /// are located on disk. If the strings are semantic versions, then the packages | 196 /// are located on disk. If the strings are semantic versions, then the packages |
197 /// are located in the system cache; otherwise, the strings are interpreted as | 197 /// are located in the system cache; otherwise, the strings are interpreted as |
198 /// relative `file:` URLs. | 198 /// relative `file:` URLs. |
199 /// | 199 /// |
200 /// Validation checks that the `.packages` file exists, has the expected | 200 /// Validation checks that the `.packages` file exists, has the expected |
201 /// entries (one per key in [dependencies]), each with a path that contains | 201 /// entries (one per key in [dependencies]), each with a path that contains |
202 /// either the version string (for a reference to the pub cache) or a | 202 /// either the version string (for a reference to the pub cache) or a |
203 /// path to a path dependency, relative to the application directory. | 203 /// path to a path dependency, relative to the application directory. |
204 Descriptor packagesFile([Map dependencies]) => | 204 Descriptor packagesFile([Map dependencies]) => |
205 new PackagesFileDescriptor(dependencies); | 205 new PackagesFileDescriptor(dependencies); |
OLD | NEW |