about summary refs log tree commit diff
path: root/pkgs/development/compilers/flutter/patches/stable/move-cache.patch
diff options
context:
space:
mode:
Diffstat (limited to 'pkgs/development/compilers/flutter/patches/stable/move-cache.patch')
-rw-r--r--pkgs/development/compilers/flutter/patches/stable/move-cache.patch45
1 files changed, 23 insertions, 22 deletions
diff --git a/pkgs/development/compilers/flutter/patches/stable/move-cache.patch b/pkgs/development/compilers/flutter/patches/stable/move-cache.patch
index e5719a2867f90..64950d4476efe 100644
--- a/pkgs/development/compilers/flutter/patches/stable/move-cache.patch
+++ b/pkgs/development/compilers/flutter/patches/stable/move-cache.patch
@@ -1,5 +1,5 @@
 diff --git a/dev/devicelab/lib/framework/runner.dart b/dev/devicelab/lib/framework/runner.dart
-index 9fae74726..d88d6ecbb 100644
+index 8e511eefd..fef3cca8b 100644
 --- a/dev/devicelab/lib/framework/runner.dart
 +++ b/dev/devicelab/lib/framework/runner.dart
 @@ -126,7 +126,7 @@ Future<void> cleanupSystem() async {
@@ -7,57 +7,58 @@ index 9fae74726..d88d6ecbb 100644
      final String gradlewBinaryName = Platform.isWindows ? 'gradlew.bat' : 'gradlew';
      final Directory tempDir = Directory.systemTemp.createTempSync('flutter_devicelab_shutdown_gradle.');
 -    recursiveCopy(Directory(path.join(flutterDirectory.path, 'bin', 'cache', 'artifacts', 'gradle_wrapper')), tempDir);
-+    recursiveCopy(Directory(path.join(homeDirPath, '.cache', 'flutter', 'artifacts', 'gradle_wrapper')), tempDir);
++    recursiveCopy(Directory(path.join(globals.fsUtils.homeDirPath, '.cache', 'flutter', 'artifacts', 'gradle_wrapper')), tempDir);
      copy(File(path.join(path.join(flutterDirectory.path, 'packages', 'flutter_tools'), 'templates', 'app', 'android.tmpl', 'gradle', 'wrapper', 'gradle-wrapper.properties')), Directory(path.join(tempDir.path, 'gradle', 'wrapper')));
      if (!Platform.isWindows) {
        await exec(
 diff --git a/packages/flutter_tools/lib/src/asset.dart b/packages/flutter_tools/lib/src/asset.dart
-index e6216c737..5ab497092 100644
+index c680de599..480abfb77 100644
 --- a/packages/flutter_tools/lib/src/asset.dart
 +++ b/packages/flutter_tools/lib/src/asset.dart
-@@ -6,6 +6,7 @@ import 'dart:async';
- 
+@@ -8,6 +8,7 @@ import 'package:meta/meta.dart';
+ import 'package:package_config/package_config.dart';
  import 'package:yaml/yaml.dart';
  
 +import 'base/common.dart';
  import 'base/context.dart';
  import 'base/file_system.dart';
- import 'base/platform.dart';
-@@ -326,7 +327,7 @@ List<_Asset> _getMaterialAssets(String fontSet) {
-     for (Map<dynamic, dynamic> font in family['fonts']) {
-       final Uri entryUri = fs.path.toUri(font['asset'] as String);
+ import 'base/utils.dart';
+@@ -392,7 +393,7 @@ List<_Asset> _getMaterialAssets(String fontSet) {
+     for (final Map<dynamic, dynamic> font in (family['fonts'] as List<dynamic>).cast<Map<dynamic, dynamic>>()) {
+       final Uri entryUri = globals.fs.path.toUri(font['asset'] as String);
        result.add(_Asset(
--        baseDir: fs.path.join(Cache.flutterRoot, 'bin', 'cache', 'artifacts', 'material_fonts'),
-+        baseDir: fs.path.join(homeDirPath, '.cache', 'flutter', 'artifacts', 'material_fonts'),
+-        baseDir: globals.fs.path.join(Cache.flutterRoot, 'bin', 'cache', 'artifacts', 'material_fonts'),
++	baseDir: globals.fs.path.join(globals.fsUtils.homeDirPath, '.cache', 'flutter', 'artifacts', 'material_fonts'),
          relativeUri: Uri(path: entryUri.pathSegments.last),
          entryUri: entryUri,
-       ));
+         package: null,
 diff --git a/packages/flutter_tools/lib/src/cache.dart b/packages/flutter_tools/lib/src/cache.dart
-index 5e1950b56..45585f9c0 100644
+index c0946782c..bdbc35cb8 100644
 --- a/packages/flutter_tools/lib/src/cache.dart
 +++ b/packages/flutter_tools/lib/src/cache.dart
-@@ -164,8 +164,14 @@ class Cache {
+@@ -202,8 +202,15 @@ class Cache {
        return;
      }
      assert(_lock == null);
 +
-+    final Directory dir = fs.directory(fs.path.join(homeDirPath, '.cache', 'flutter'));
++    final Directory dir = globals.fs.directory(globals.fs.path.join(globals.fsUtils.homeDirPath, '.cache', 'flutter'));
 +    if (!dir.existsSync()) {
 +      dir.createSync(recursive: true);
-+      os.chmod(dir, '755');
++      globals.os.chmod(dir, '755');
 +    }
++
      final File lockFile =
--        fs.file(fs.path.join(flutterRoot, 'bin', 'cache', 'lockfile'));
-+        fs.file(fs.path.join(homeDirPath, '.cache', 'flutter', 'lockfile'));
+-        globals.fs.file(globals.fs.path.join(flutterRoot, 'bin', 'cache', 'lockfile'));
++        globals.fs.file(globals.fs.path.join(globals.fsUtils.homeDirPath, '.cache', 'flutter', 'lockfile'));
      try {
        _lock = lockFile.openSync(mode: FileMode.write);
      } on FileSystemException catch (e) {
-@@ -239,7 +245,7 @@ class Cache {
+@@ -306,7 +313,7 @@ class Cache {
      if (_rootOverride != null) {
-       return fs.directory(fs.path.join(_rootOverride.path, 'bin', 'cache'));
+       return _fileSystem.directory(_fileSystem.path.join(_rootOverride.path, 'bin', 'cache'));
      } else {
--      return fs.directory(fs.path.join(flutterRoot, 'bin', 'cache'));
-+      return fs.directory(fs.path.join(homeDirPath, '.cache', 'flutter'));
+-      return _fileSystem.directory(_fileSystem.path.join(flutterRoot, 'bin', 'cache'));
++      return _fileSystem.directory(_fileSystem.path.join(globals.fsUtils.homeDirPath, '.cache', 'flutter'));
      }
    }