@@ -206,22 +206,10 @@ class Entrypoint {
206
206
207
207
/// The path to the entrypoint package's `.dart_tool/pub` cache directory.
208
208
///
209
- /// If the old-style `.pub` directory is being used, this returns that
210
- /// instead.
211
- ///
212
209
/// For globally activated packages from path, this is not the same as
213
210
/// [configRoot] , because the snapshots should be stored in the global cache,
214
211
/// but the configuration is stored at the package itself.
215
- String get cachePath {
216
- if (isGlobal) {
217
- return globalDir! ;
218
- } else {
219
- var newPath = root.path ('.dart_tool/pub' );
220
- var oldPath = root.path ('.pub' );
221
- if (! dirExists (newPath) && dirExists (oldPath)) return oldPath;
222
- return newPath;
223
- }
224
- }
212
+ String get cachePath => globalDir ?? root.path ('.dart_tool/pub' );
225
213
226
214
/// The path to the directory containing dependency executable snapshots.
227
215
String get _snapshotPath => p.join (cachePath, 'bin' );
@@ -444,8 +432,6 @@ To update `$lockFilePath` run `$topLevelProgram pub get`$suffix without
444
432
445
433
/// Precompiles all [_builtExecutables] .
446
434
Future <void > precompileExecutables () async {
447
- migrateCache ();
448
-
449
435
final executables = _builtExecutables;
450
436
451
437
if (executables.isEmpty) return ;
@@ -914,26 +900,6 @@ To update `$lockFilePath` run `$topLevelProgram pub get`$suffix without
914
900
}
915
901
}
916
902
917
- /// If the entrypoint uses the old-style `.pub` cache directory, migrates it
918
- /// to the new-style `.dart_tool/pub` directory.
919
- void migrateCache () {
920
- // Cached packages don't have these.
921
- if (isCached) return ;
922
-
923
- var oldPath = p.join (_configRoot! , '.pub' );
924
- if (! dirExists (oldPath)) return ;
925
-
926
- var newPath = root.path ('.dart_tool/pub' );
927
-
928
- // If both the old and new directories exist, something weird is going on.
929
- // Do nothing to avoid making things worse. Pub will prefer the new
930
- // directory anyway.
931
- if (dirExists (newPath)) return ;
932
-
933
- ensureDir (p.dirname (newPath));
934
- renameDir (oldPath, newPath);
935
- }
936
-
937
903
/// We require an SDK constraint lower-bound as of Dart 2.12.0
938
904
///
939
905
/// We don't allow unknown sdks.
0 commit comments