Skip to content

Commit

Permalink
Revert "Revert "Fix filename handling for Windows. (flutter#4482)" (f…
Browse files Browse the repository at this point in the history
…lutter#4484)" (flutter#4506)

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

This reverts commit 929e5b3.

Reverting now since issue with
gen_snapshot(as described in flutter/flutter#13708) was fixed.

* resolve->resolveUri, drop underscores

* Fix underscore
  • Loading branch information
aam authored Jan 3, 2018
1 parent 9baa3b2 commit e1162b1
Showing 1 changed file with 8 additions and 11 deletions.
19 changes: 8 additions & 11 deletions frontend_server/lib/server.dart
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,6 @@ class _FrontendCompiler implements CompilerInterface {
BinaryPrinterFactory printerFactory;

IncrementalKernelGenerator _generator;
String _filename;
String _kernelBinaryFilename;

@override
Expand All @@ -137,7 +136,7 @@ class _FrontendCompiler implements CompilerInterface {
ArgResults options, {
IncrementalKernelGenerator generator,
}) async {
_filename = filename;
final Uri filenameUri = Uri.base.resolveUri(new Uri.file(filename));
_kernelBinaryFilename = "$filename.dill";
final String boundaryKey = new Uuid().generateV4();
_outputStream.writeln("result $boundaryKey");
Expand All @@ -157,7 +156,7 @@ class _FrontendCompiler implements CompilerInterface {
_generator = generator != null
? generator
: await IncrementalKernelGenerator.newInstance(
compilerOptions, Uri.base.resolve(_filename),
compilerOptions, filenameUri,
useMinimalGenerator: true);
final DeltaProgram deltaProgram =
await _runWithPrintRedirection(() => _generator.computeDelta());
Expand All @@ -170,9 +169,8 @@ class _FrontendCompiler implements CompilerInterface {
sdkRoot.resolve('platform.dill')
];
}
program = await _runWithPrintRedirection(() => compileToKernel(
Uri.base.resolve(_filename), compilerOptions,
aot: options['aot']));
program = await _runWithPrintRedirection(() =>
compileToKernel(filenameUri, compilerOptions, aot: options['aot']));
}
if (program != null) {
final IOSink sink = new File(_kernelBinaryFilename).openWrite();
Expand Down Expand Up @@ -219,12 +217,11 @@ class _FrontendCompiler implements CompilerInterface {
}

Uri _ensureFolderPath(String path) {
// This is a URI, not a file path, so the forward slash is correct even
// on Windows.
if (!path.endsWith('/')) {
path = '$path/';
String uriPath = new Uri.file(path).toString();
if (!uriPath.endsWith('/')) {
uriPath = '$uriPath/';
}
return Uri.base.resolve(path);
return Uri.base.resolve(uriPath);
}

/// Runs the given function [f] in a Zone that redirects all prints into
Expand Down

0 comments on commit e1162b1

Please sign in to comment.