Commit 1ccbf8f0 authored by Todd Volkert's avatar Todd Volkert Committed by GitHub

Use FileSystem.pathSeparator instead of Platform.pathSeparator (#7417)

parent 03d19807
...@@ -10,7 +10,6 @@ import 'package:path/path.dart' as path; ...@@ -10,7 +10,6 @@ import 'package:path/path.dart' as path;
import 'package:yaml/yaml.dart'; import 'package:yaml/yaml.dart';
import 'base/file_system.dart'; import 'base/file_system.dart';
import 'base/io.dart';
import 'build_info.dart'; import 'build_info.dart';
import 'cache.dart'; import 'cache.dart';
import 'dart/package_map.dart'; import 'dart/package_map.dart';
...@@ -378,7 +377,7 @@ Map<_Asset, List<_Asset>> _parseAssets( ...@@ -378,7 +377,7 @@ Map<_Asset, List<_Asset>> _parseAssets(
return result; return result;
excludeDirs = excludeDirs.map( excludeDirs = excludeDirs.map(
(String exclude) => path.absolute(exclude) + Platform.pathSeparator).toList(); (String exclude) => path.absolute(exclude) + fs.pathSeparator).toList();
if (manifestDescriptor.containsKey('assets')) { if (manifestDescriptor.containsKey('assets')) {
for (String asset in manifestDescriptor['assets']) { for (String asset in manifestDescriptor['assets']) {
......
...@@ -5,6 +5,7 @@ ...@@ -5,6 +5,7 @@
import 'dart:async'; import 'dart:async';
import 'dart:convert'; import 'dart:convert';
import 'file_system.dart';
import 'io.dart'; import 'io.dart';
import 'process_manager.dart'; import 'process_manager.dart';
import '../globals.dart'; import '../globals.dart';
...@@ -202,7 +203,7 @@ void _traceCommand(List<String> args, { String workingDirectory }) { ...@@ -202,7 +203,7 @@ void _traceCommand(List<String> args, { String workingDirectory }) {
if (workingDirectory == null) if (workingDirectory == null)
printTrace(argsText); printTrace(argsText);
else else
printTrace("[$workingDirectory${Platform.pathSeparator}] $argsText"); printTrace("[$workingDirectory${fs.pathSeparator}] $argsText");
} }
String _runWithLoggingSync(List<String> cmd, { String _runWithLoggingSync(List<String> cmd, {
......
...@@ -93,7 +93,7 @@ String getElapsedAsMilliseconds(Duration duration) { ...@@ -93,7 +93,7 @@ String getElapsedAsMilliseconds(Duration duration) {
/// Return a relative path if [fullPath] is contained by the cwd, else return an /// Return a relative path if [fullPath] is contained by the cwd, else return an
/// absolute path. /// absolute path.
String getDisplayPath(String fullPath) { 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; return fullPath.startsWith(cwd) ? fullPath.substring(cwd.length) : fullPath;
} }
......
...@@ -8,7 +8,6 @@ import 'package:args/args.dart'; ...@@ -8,7 +8,6 @@ import 'package:args/args.dart';
import 'package:path/path.dart' as path; import 'package:path/path.dart' as path;
import '../base/file_system.dart'; import '../base/file_system.dart';
import '../base/io.dart';
import '../base/utils.dart'; import '../base/utils.dart';
import '../cache.dart'; import '../cache.dart';
import '../globals.dart'; import '../globals.dart';
...@@ -59,7 +58,7 @@ bool inRepo(List<String> fileList) { ...@@ -59,7 +58,7 @@ bool inRepo(List<String> fileList) {
if (fileList == null || fileList.isEmpty) if (fileList == null || fileList.isEmpty)
fileList = <String>[path.current]; fileList = <String>[path.current];
String root = path.normalize(path.absolute(Cache.flutterRoot)); String root = path.normalize(path.absolute(Cache.flutterRoot));
String prefix = root + Platform.pathSeparator; String prefix = root + fs.pathSeparator;
for (String file in fileList) { for (String file in fileList) {
file = path.normalize(path.absolute(file)); file = path.normalize(path.absolute(file));
if (file == root || file.startsWith(prefix)) if (file == root || file.startsWith(prefix))
......
...@@ -8,7 +8,6 @@ import 'package:meta/meta.dart'; ...@@ -8,7 +8,6 @@ import 'package:meta/meta.dart';
import '../base/common.dart'; import '../base/common.dart';
import '../base/file_system.dart'; import '../base/file_system.dart';
import '../base/io.dart';
import '../base/utils.dart'; import '../base/utils.dart';
import '../build_info.dart'; import '../build_info.dart';
import '../globals.dart'; import '../globals.dart';
...@@ -88,7 +87,7 @@ class BuildCleanCommand extends FlutterCommand { ...@@ -88,7 +87,7 @@ class BuildCleanCommand extends FlutterCommand {
@override @override
Future<Null> runCommand() async { Future<Null> runCommand() async {
Directory buildDir = fs.directory(getBuildDirectory()); Directory buildDir = fs.directory(getBuildDirectory());
printStatus("Deleting '${buildDir.path}${Platform.pathSeparator}'."); printStatus("Deleting '${buildDir.path}${fs.pathSeparator}'.");
if (!buildDir.existsSync()) if (!buildDir.existsSync())
return; return;
......
...@@ -8,7 +8,6 @@ import 'package:path/path.dart' as path; ...@@ -8,7 +8,6 @@ import 'package:path/path.dart' as path;
import '../base/common.dart'; import '../base/common.dart';
import '../base/file_system.dart'; import '../base/file_system.dart';
import '../base/io.dart';
import '../base/logger.dart'; import '../base/logger.dart';
import '../base/process.dart'; import '../base/process.dart';
import '../base/utils.dart'; import '../base/utils.dart';
...@@ -65,7 +64,7 @@ class BuildAotCommand extends BuildSubCommand { ...@@ -65,7 +64,7 @@ class BuildAotCommand extends BuildSubCommand {
if (outputPath == null) if (outputPath == null)
throwToolExit(null); throwToolExit(null);
printStatus('Built to $outputPath${Platform.pathSeparator}.'); printStatus('Built to $outputPath${fs.pathSeparator}.');
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment