at 22.05-pre 67 lines 2.9 kB view raw
1diff --git a/packages/flutter_tools/lib/src/asset.dart b/packages/flutter_tools/lib/src/asset.dart 2index 80fb16673f..5723f93f9f 100644 3--- a/packages/flutter_tools/lib/src/asset.dart 4+++ b/packages/flutter_tools/lib/src/asset.dart 5@@ -7,6 +7,7 @@ 6 import 'package:meta/meta.dart'; 7 import 'package:package_config/package_config.dart'; 8 9+import 'base/common.dart'; 10 import 'base/context.dart'; 11 import 'base/deferred_component.dart'; 12 import 'base/file_system.dart'; 13@@ -16,6 +17,7 @@ import 'build_info.dart'; 14 import 'cache.dart'; 15 import 'convert.dart'; 16 import 'dart/package_map.dart'; 17+import 'globals.dart' as globals; 18 import 'devfs.dart'; 19 import 'flutter_manifest.dart'; 20 import 'license_collector.dart'; 21@@ -449,7 +451,7 @@ class ManifestAssetBundle implements AssetBundle { 22 for (final Map<String, Object> font in family['fonts'] as List<Map<String, Object>>) { 23 final Uri entryUri = _fileSystem.path.toUri(font['asset'] as String); 24 result.add(_Asset( 25- baseDir: _fileSystem.path.join(Cache.flutterRoot, 'bin', 'cache', 'artifacts', 'material_fonts'), 26+ baseDir: _fileSystem.path.join(globals.fsUtils.homeDirPath, '.cache', 'flutter', 'artifacts', 'material_fonts'), 27 relativeUri: Uri(path: entryUri.pathSegments.last), 28 entryUri: entryUri, 29 package: null, 30diff --git a/packages/flutter_tools/lib/src/cache.dart b/packages/flutter_tools/lib/src/cache.dart 31index 152d4e75e5..1fcff7e2bd 100644 32--- a/packages/flutter_tools/lib/src/cache.dart 33+++ b/packages/flutter_tools/lib/src/cache.dart 34@@ -9,6 +9,7 @@ import 'package:file/memory.dart'; 35 import 'package:meta/meta.dart'; 36 import 'package:process/process.dart'; 37 38+import 'globals.dart' as globals; 39 import 'base/common.dart'; 40 import 'base/error_handling_io.dart'; 41 import 'base/file_system.dart'; 42@@ -298,8 +299,15 @@ class Cache { 43 return; 44 } 45 assert(_lock == null); 46+ 47+ final Directory dir = _fileSystem.directory(_fileSystem.path.join(globals.fsUtils.homeDirPath!, '.cache', 'flutter')); 48+ if (!dir.existsSync()) { 49+ dir.createSync(recursive: true); 50+ globals.os.chmod(dir, '755'); 51+ } 52+ 53 final File lockFile = 54- _fileSystem.file(_fileSystem.path.join(flutterRoot!, 'bin', 'cache', 'lockfile')); 55+ _fileSystem.file(_fileSystem.path.join(globals.fsUtils.homeDirPath!, '.cache', 'flutter', 'lockfile')); 56 try { 57 _lock = lockFile.openSync(mode: FileMode.write); 58 } on FileSystemException catch (e) { 59@@ -404,7 +412,7 @@ class Cache { 60 if (_rootOverride != null) { 61 return _fileSystem.directory(_fileSystem.path.join(_rootOverride!.path, 'bin', 'cache')); 62 } else { 63- return _fileSystem.directory(_fileSystem.path.join(flutterRoot!, 'bin', 'cache')); 64+ return _fileSystem.directory(_fileSystem.path.join(globals.fsUtils.homeDirPath!, '.cache', 'flutter')); 65 } 66 } 67