未验证 提交 e1162b1b 编写于 作者: A Alexander Aprelev 提交者: GitHub

Revert "Revert "Fix filename handling for Windows. (#4482)" (#4484)" (#4506)

* Revert "Revert "Fix filename handling for Windows. (#4482)" (#4484)"

This reverts commit 929e5b39.

Reverting now since issue with
gen_snapshot(as described in https://github.com/flutter/flutter/issues/13708) was fixed.

* resolve->resolveUri, drop underscores

* Fix underscore
上级 9baa3b25
...@@ -128,7 +128,6 @@ class _FrontendCompiler implements CompilerInterface { ...@@ -128,7 +128,6 @@ class _FrontendCompiler implements CompilerInterface {
BinaryPrinterFactory printerFactory; BinaryPrinterFactory printerFactory;
IncrementalKernelGenerator _generator; IncrementalKernelGenerator _generator;
String _filename;
String _kernelBinaryFilename; String _kernelBinaryFilename;
@override @override
...@@ -137,7 +136,7 @@ class _FrontendCompiler implements CompilerInterface { ...@@ -137,7 +136,7 @@ class _FrontendCompiler implements CompilerInterface {
ArgResults options, { ArgResults options, {
IncrementalKernelGenerator generator, IncrementalKernelGenerator generator,
}) async { }) async {
_filename = filename; final Uri filenameUri = Uri.base.resolveUri(new Uri.file(filename));
_kernelBinaryFilename = "$filename.dill"; _kernelBinaryFilename = "$filename.dill";
final String boundaryKey = new Uuid().generateV4(); final String boundaryKey = new Uuid().generateV4();
_outputStream.writeln("result $boundaryKey"); _outputStream.writeln("result $boundaryKey");
...@@ -157,7 +156,7 @@ class _FrontendCompiler implements CompilerInterface { ...@@ -157,7 +156,7 @@ class _FrontendCompiler implements CompilerInterface {
_generator = generator != null _generator = generator != null
? generator ? generator
: await IncrementalKernelGenerator.newInstance( : await IncrementalKernelGenerator.newInstance(
compilerOptions, Uri.base.resolve(_filename), compilerOptions, filenameUri,
useMinimalGenerator: true); useMinimalGenerator: true);
final DeltaProgram deltaProgram = final DeltaProgram deltaProgram =
await _runWithPrintRedirection(() => _generator.computeDelta()); await _runWithPrintRedirection(() => _generator.computeDelta());
...@@ -170,9 +169,8 @@ class _FrontendCompiler implements CompilerInterface { ...@@ -170,9 +169,8 @@ class _FrontendCompiler implements CompilerInterface {
sdkRoot.resolve('platform.dill') sdkRoot.resolve('platform.dill')
]; ];
} }
program = await _runWithPrintRedirection(() => compileToKernel( program = await _runWithPrintRedirection(() =>
Uri.base.resolve(_filename), compilerOptions, compileToKernel(filenameUri, compilerOptions, aot: options['aot']));
aot: options['aot']));
} }
if (program != null) { if (program != null) {
final IOSink sink = new File(_kernelBinaryFilename).openWrite(); final IOSink sink = new File(_kernelBinaryFilename).openWrite();
...@@ -219,12 +217,11 @@ class _FrontendCompiler implements CompilerInterface { ...@@ -219,12 +217,11 @@ class _FrontendCompiler implements CompilerInterface {
} }
Uri _ensureFolderPath(String path) { Uri _ensureFolderPath(String path) {
// This is a URI, not a file path, so the forward slash is correct even String uriPath = new Uri.file(path).toString();
// on Windows. if (!uriPath.endsWith('/')) {
if (!path.endsWith('/')) { uriPath = '$uriPath/';
path = '$path/';
} }
return Uri.base.resolve(path); return Uri.base.resolve(uriPath);
} }
/// Runs the given function [f] in a Zone that redirects all prints into /// Runs the given function [f] in a Zone that redirects all prints into
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册