@@ -171,20 +171,19 @@ class TestProject {
171171
172172 static Future <void > _copyPackageAndPathDependenciesIntoTempDirectory (
173173 Directory tempDirectory,
174- String absolutePackageDirectory ,
174+ String packageDirectory ,
175175 Set <String > copiedPackageDirectories,
176176 ) async {
177177 // There may be cycles in dependencies, so check that we already copied this
178178 // package.
179- final packageDirectory = p.basename (absolutePackageDirectory);
180179 if (copiedPackageDirectories.contains (packageDirectory)) return ;
181180 final currentPath = absolutePath (pathFromFixtures: packageDirectory);
182181 final newPath = p.join (tempDirectory.absolute.path, packageDirectory);
183- Directory (newPath).createSync ();
184- copyPathSync (currentPath, newPath);
182+ await Directory (newPath).create ();
183+ await copyPath (currentPath, newPath);
185184 copiedPackageDirectories.add (packageDirectory);
186185 final pubspec = Pubspec .parse (
187- File (p.join (currentPath, 'pubspec.yaml' )).readAsStringSync (),
186+ await File (p.join (currentPath, 'pubspec.yaml' )).readAsString (),
188187 );
189188 for (final dependency in pubspec.dependencies.values) {
190189 if (dependency is PathDependency ) {
@@ -202,7 +201,7 @@ class TestProject {
202201 );
203202 await _copyPackageAndPathDependenciesIntoTempDirectory (
204203 tempDirectory,
205- dependencyDirectory.path,
204+ p. basename ( dependencyDirectory.path) ,
206205 copiedPackageDirectories,
207206 );
208207 }
@@ -215,7 +214,7 @@ class TestProject {
215214 'run' ,
216215 'build_runner' ,
217216 'clean' ,
218- ], workingDirectory: absolutePackageDirectory );
217+ ], workingDirectory: newPath );
219218 }
220219
221220 Future <void > setUp () async {
@@ -226,25 +225,25 @@ class TestProject {
226225 final systemTempDir = Directory (
227226 // Resolve symbolic links as build_daemon tests rely on paths matching
228227 // between the client and the daemon.
229- Directory .systemTemp.resolveSymbolicLinksSync (),
228+ await Directory .systemTemp.resolveSymbolicLinks (),
230229 );
231- _fixturesCopy = systemTempDir.createTempSync ();
230+ _fixturesCopy = await systemTempDir.createTemp ();
232231 await _copyPackageAndPathDependenciesIntoTempDirectory (
233232 _fixturesCopy,
234- absolutePackageDirectory ,
233+ packageDirectory ,
235234 {},
236235 );
237236 }
238237
239238 /// Delete the copy of the project.
240239 Future <void > tearDown () async {
241240 try {
242- _fixturesCopy.deleteSync (recursive: true );
241+ await _fixturesCopy.delete (recursive: true );
243242 } on FileSystemException catch (_) {
244243 // On Windows, the build daemon process might still be accessing the
245244 // working directory, so wait a second and then try again.
246245 await Future .delayed (const Duration (seconds: 1 ));
247- _fixturesCopy.deleteSync (recursive: true );
246+ await _fixturesCopy.delete (recursive: true );
248247 }
249248 }
250249
0 commit comments