Skip to content

Commit

Permalink
normalizing path separator for linux and mac(MessagePack-CSharp#386)
Browse files Browse the repository at this point in the history
  • Loading branch information
itn3000 committed Apr 1, 2019
1 parent ba43428 commit d985cf9
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/MessagePackCompiler/MessagePackCompilation.cs
Expand Up @@ -43,7 +43,7 @@ public static async Task<CSharpCompilation> CreateFromProjectAsync(string[] cspr
var hasAnnotations = false;
foreach (var file in sources.Distinct())
{
var text = await File.ReadAllTextAsync(file, Encoding.UTF8, cancellationToken);
var text = await File.ReadAllTextAsync(file.Replace('\\', Path.DirectorySeparatorChar), Encoding.UTF8, cancellationToken);
var syntax = CSharpSyntaxTree.ParseText(text, parseOption);
syntaxTrees.Add(syntax);
if (Path.GetFileNameWithoutExtension(file) == "Attributes")
Expand Down Expand Up @@ -167,7 +167,7 @@ public static async Task<CSharpCompilation> CreateFromDirectoryAsync(string dire
var syntaxTrees = new List<SyntaxTree>();
foreach (var file in IterateCsFileWithoutBinObj(directoryRoot))
{
var text = await File.ReadAllTextAsync(file, Encoding.UTF8, cancellationToken);
var text = await File.ReadAllTextAsync(file.Replace('\\', Path.DirectorySeparatorChar), Encoding.UTF8, cancellationToken);
var syntax = CSharpSyntaxTree.ParseText(text, parseOption);
syntaxTrees.Add(syntax);
if (Path.GetFileNameWithoutExtension(file) == "Attributes")
Expand Down

0 comments on commit d985cf9

Please sign in to comment.