Use FileSystem.pathSeparator instead of Platform.pathSeparator (#7417)
diff --git a/packages/flutter_tools/lib/src/asset.dart b/packages/flutter_tools/lib/src/asset.dart
index 9ebd53b..70ca377 100644
--- a/packages/flutter_tools/lib/src/asset.dart
+++ b/packages/flutter_tools/lib/src/asset.dart
@@ -10,7 +10,6 @@
import 'package:yaml/yaml.dart';
import 'base/file_system.dart';
-import 'base/io.dart';
import 'build_info.dart';
import 'cache.dart';
import 'dart/package_map.dart';
@@ -378,7 +377,7 @@
return result;
excludeDirs = excludeDirs.map(
- (String exclude) => path.absolute(exclude) + Platform.pathSeparator).toList();
+ (String exclude) => path.absolute(exclude) + fs.pathSeparator).toList();
if (manifestDescriptor.containsKey('assets')) {
for (String asset in manifestDescriptor['assets']) {
diff --git a/packages/flutter_tools/lib/src/base/process.dart b/packages/flutter_tools/lib/src/base/process.dart
index 4b57b97..dfed148 100644
--- a/packages/flutter_tools/lib/src/base/process.dart
+++ b/packages/flutter_tools/lib/src/base/process.dart
@@ -5,6 +5,7 @@
import 'dart:async';
import 'dart:convert';
+import 'file_system.dart';
import 'io.dart';
import 'process_manager.dart';
import '../globals.dart';
@@ -202,7 +203,7 @@
if (workingDirectory == null)
printTrace(argsText);
else
- printTrace("[$workingDirectory${Platform.pathSeparator}] $argsText");
+ printTrace("[$workingDirectory${fs.pathSeparator}] $argsText");
}
String _runWithLoggingSync(List<String> cmd, {
diff --git a/packages/flutter_tools/lib/src/base/utils.dart b/packages/flutter_tools/lib/src/base/utils.dart
index 4a05be2..1cdd05a 100644
--- a/packages/flutter_tools/lib/src/base/utils.dart
+++ b/packages/flutter_tools/lib/src/base/utils.dart
@@ -93,7 +93,7 @@
/// Return a relative path if [fullPath] is contained by the cwd, else return an
/// absolute path.
String getDisplayPath(String fullPath) {
- String cwd = fs.currentDirectory.path + Platform.pathSeparator;
+ String cwd = fs.currentDirectory.path + fs.pathSeparator;
return fullPath.startsWith(cwd) ? fullPath.substring(cwd.length) : fullPath;
}
diff --git a/packages/flutter_tools/lib/src/commands/analyze_base.dart b/packages/flutter_tools/lib/src/commands/analyze_base.dart
index c602361..cd41911 100644
--- a/packages/flutter_tools/lib/src/commands/analyze_base.dart
+++ b/packages/flutter_tools/lib/src/commands/analyze_base.dart
@@ -8,7 +8,6 @@
import 'package:path/path.dart' as path;
import '../base/file_system.dart';
-import '../base/io.dart';
import '../base/utils.dart';
import '../cache.dart';
import '../globals.dart';
@@ -59,7 +58,7 @@
if (fileList == null || fileList.isEmpty)
fileList = <String>[path.current];
String root = path.normalize(path.absolute(Cache.flutterRoot));
- String prefix = root + Platform.pathSeparator;
+ String prefix = root + fs.pathSeparator;
for (String file in fileList) {
file = path.normalize(path.absolute(file));
if (file == root || file.startsWith(prefix))
diff --git a/packages/flutter_tools/lib/src/commands/build.dart b/packages/flutter_tools/lib/src/commands/build.dart
index 9c52c66..ba09ac0 100644
--- a/packages/flutter_tools/lib/src/commands/build.dart
+++ b/packages/flutter_tools/lib/src/commands/build.dart
@@ -8,7 +8,6 @@
import '../base/common.dart';
import '../base/file_system.dart';
-import '../base/io.dart';
import '../base/utils.dart';
import '../build_info.dart';
import '../globals.dart';
@@ -88,7 +87,7 @@
@override
Future<Null> runCommand() async {
Directory buildDir = fs.directory(getBuildDirectory());
- printStatus("Deleting '${buildDir.path}${Platform.pathSeparator}'.");
+ printStatus("Deleting '${buildDir.path}${fs.pathSeparator}'.");
if (!buildDir.existsSync())
return;
diff --git a/packages/flutter_tools/lib/src/commands/build_aot.dart b/packages/flutter_tools/lib/src/commands/build_aot.dart
index 3ebedda..f32d1f3 100644
--- a/packages/flutter_tools/lib/src/commands/build_aot.dart
+++ b/packages/flutter_tools/lib/src/commands/build_aot.dart
@@ -8,7 +8,6 @@
import '../base/common.dart';
import '../base/file_system.dart';
-import '../base/io.dart';
import '../base/logger.dart';
import '../base/process.dart';
import '../base/utils.dart';
@@ -65,7 +64,7 @@
if (outputPath == null)
throwToolExit(null);
- printStatus('Built to $outputPath${Platform.pathSeparator}.');
+ printStatus('Built to $outputPath${fs.pathSeparator}.');
}
}