2020-04-24 23:36:52 +00:00
|
|
|
diff --git a/packages/flutter_tools/lib/src/asset.dart b/packages/flutter_tools/lib/src/asset.dart
|
2022-02-10 20:34:41 +00:00
|
|
|
index ed42baea29..12941f733a 100644
|
2020-04-24 23:36:52 +00:00
|
|
|
--- a/packages/flutter_tools/lib/src/asset.dart
|
|
|
|
+++ b/packages/flutter_tools/lib/src/asset.dart
|
2021-12-19 01:06:50 +00:00
|
|
|
@@ -11,11 +11,11 @@ import 'base/file_system.dart';
|
|
|
|
import 'base/logger.dart';
|
|
|
|
import 'base/platform.dart';
|
|
|
|
import 'build_info.dart';
|
|
|
|
-import 'cache.dart';
|
2021-04-05 15:23:46 +00:00
|
|
|
import 'convert.dart';
|
|
|
|
import 'dart/package_map.dart';
|
2021-06-28 23:13:55 +00:00
|
|
|
import 'devfs.dart';
|
2021-04-05 15:23:46 +00:00
|
|
|
import 'flutter_manifest.dart';
|
2021-12-19 01:06:50 +00:00
|
|
|
+import 'globals.dart' as globals;
|
2021-04-05 15:23:46 +00:00
|
|
|
import 'license_collector.dart';
|
2021-12-19 01:06:50 +00:00
|
|
|
import 'project.dart';
|
|
|
|
|
|
|
|
@@ -504,7 +504,7 @@ class ManifestAssetBundle implements AssetBundle {
|
|
|
|
}
|
|
|
|
final Uri entryUri = _fileSystem.path.toUri(asset);
|
2021-04-05 15:23:46 +00:00
|
|
|
result.add(_Asset(
|
2021-12-19 01:06:50 +00:00
|
|
|
- baseDir: _fileSystem.path.join(Cache.flutterRoot!, 'bin', 'cache', 'artifacts', 'material_fonts'),
|
2021-12-26 17:43:05 +00:00
|
|
|
+ baseDir: _fileSystem.path.join(globals.fsUtils.homeDirPath!, '.cache', 'flutter', 'artifacts', 'material_fonts'),
|
2021-04-05 15:23:46 +00:00
|
|
|
relativeUri: Uri(path: entryUri.pathSegments.last),
|
|
|
|
entryUri: entryUri,
|
|
|
|
package: null,
|
2020-04-24 23:36:52 +00:00
|
|
|
diff --git a/packages/flutter_tools/lib/src/cache.dart b/packages/flutter_tools/lib/src/cache.dart
|
2022-02-10 20:34:41 +00:00
|
|
|
index defc86cc20..7fdf14d112 100644
|
2020-04-24 23:36:52 +00:00
|
|
|
--- a/packages/flutter_tools/lib/src/cache.dart
|
|
|
|
+++ b/packages/flutter_tools/lib/src/cache.dart
|
2021-12-19 01:06:50 +00:00
|
|
|
@@ -22,6 +22,7 @@ import 'base/user_messages.dart';
|
|
|
|
import 'build_info.dart';
|
|
|
|
import 'convert.dart';
|
|
|
|
import 'features.dart';
|
2021-06-28 23:13:55 +00:00
|
|
|
+import 'globals.dart' as globals;
|
2021-12-19 01:06:50 +00:00
|
|
|
|
|
|
|
const String kFlutterRootEnvironmentVariableName = 'FLUTTER_ROOT'; // should point to //flutter/ (root of flutter/flutter repo)
|
|
|
|
const String kFlutterEngineEnvironmentVariableName = 'FLUTTER_ENGINE'; // should point to //engine/src/ (root of flutter/engine repo)
|
2022-02-10 20:34:41 +00:00
|
|
|
@@ -322,8 +323,13 @@ class Cache {
|
2020-04-24 23:36:52 +00:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
assert(_lock == null);
|
2021-06-28 23:13:55 +00:00
|
|
|
+ final Directory dir = _fileSystem.directory(_fileSystem.path.join(globals.fsUtils.homeDirPath!, '.cache', 'flutter'));
|
2020-04-24 23:36:52 +00:00
|
|
|
+ if (!dir.existsSync()) {
|
|
|
|
+ dir.createSync(recursive: true);
|
2020-08-20 17:08:02 +00:00
|
|
|
+ globals.os.chmod(dir, '755');
|
2020-04-24 23:36:52 +00:00
|
|
|
+ }
|
|
|
|
final File lockFile =
|
2021-06-28 23:13:55 +00:00
|
|
|
- _fileSystem.file(_fileSystem.path.join(flutterRoot!, 'bin', 'cache', 'lockfile'));
|
|
|
|
+ _fileSystem.file(_fileSystem.path.join(globals.fsUtils.homeDirPath!, '.cache', 'flutter', 'lockfile'));
|
2020-04-24 23:36:52 +00:00
|
|
|
try {
|
|
|
|
_lock = lockFile.openSync(mode: FileMode.write);
|
|
|
|
} on FileSystemException catch (e) {
|
2022-02-10 20:34:41 +00:00
|
|
|
@@ -382,8 +388,7 @@ class Cache {
|
|
|
|
|
|
|
|
String get devToolsVersion {
|
|
|
|
if (_devToolsVersion == null) {
|
|
|
|
- const String devToolsDirPath = 'dart-sdk/bin/resources/devtools';
|
|
|
|
- final Directory devToolsDir = getCacheDir(devToolsDirPath, shouldCreate: false);
|
|
|
|
+ final Directory devToolsDir = _fileSystem.directory(_fileSystem.path.join(flutterRoot!, 'bin/cache/dart-sdk/bin/resources/devtools'));
|
|
|
|
if (!devToolsDir.existsSync()) {
|
|
|
|
throw Exception('Could not find directory at ${devToolsDir.path}');
|
|
|
|
}
|
|
|
|
@@ -536,7 +541,7 @@ class Cache {
|
2020-04-24 23:36:52 +00:00
|
|
|
if (_rootOverride != null) {
|
2021-06-28 23:13:55 +00:00
|
|
|
return _fileSystem.directory(_fileSystem.path.join(_rootOverride!.path, 'bin', 'cache'));
|
2020-04-24 23:36:52 +00:00
|
|
|
} else {
|
2021-06-28 23:13:55 +00:00
|
|
|
- return _fileSystem.directory(_fileSystem.path.join(flutterRoot!, 'bin', 'cache'));
|
|
|
|
+ return _fileSystem.directory(_fileSystem.path.join(globals.fsUtils.homeDirPath!, '.cache', 'flutter'));
|
2020-04-24 23:36:52 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|