--- a/packages/flutter_tools/lib/src/asset.dart +++ b/packages/flutter_tools/lib/src/asset.dart @@ -7,6 +7,7 @@ import 'package:meta/meta.dart'; import 'package:package_config/package_config.dart'; +import 'base/common.dart'; import 'base/context.dart'; import 'base/deferred_component.dart'; import 'base/file_system.dart'; @@ -16,6 +17,7 @@ import 'build_info.dart'; import 'cache.dart'; import 'convert.dart'; import 'dart/package_map.dart'; +import 'globals.dart' as globals; import 'devfs.dart'; import 'flutter_manifest.dart'; import 'license_collector.dart'; #@@ -449,4 +451,4 @@ class ManifestAssetBundle implements AssetBundle { # result.add(_Asset( #- baseDir: _fileSystem.path.join(Cache.flutterRoot, 'bin', 'cache', 'artifacts', 'material_fonts'), #+ baseDir: _fileSystem.path.join(globals.fsUtils.homeDirPath, '.cache', 'flutter', 'artifacts', 'material_fonts'), # --- a/packages/flutter_tools/lib/src/cache.dart +++ b/packages/flutter_tools/lib/src/cache.dart @@ -9,1 +9,2 @@ +import 'globals.dart' as globals; import 'base/common.dart'; @@ -324,3 +317,10 @@ + + final Directory dir = _fileSystem.directory(_fileSystem.path.join(globals.fsUtils.homeDirPath!, '.cache', 'flutter')); + if (!dir.existsSync()) { + dir.createSync(recursive: true); + globals.os.chmod(dir, '755'); + } + final File lockFile = - _fileSystem.file(_fileSystem.path.join(flutterRoot!, 'bin', 'cache', 'lockfile')); + _fileSystem.file(_fileSystem.path.join(globals.fsUtils.homeDirPath!, '.cache', 'flutter', 'lockfile')); try { @@ -562,3 +562,3 @@ Directory getRoot() { } else { - return _fileSystem.directory(_fileSystem.path.join(flutterRoot!, 'bin', 'cache')); + return _fileSystem.directory(_fileSystem.path.join(globals.fsUtils.homeDirPath!, '.cache', 'flutter')); }