Skip to content

Commit

Permalink
fix path normalization for linux system(MessagePack-CSharp#386)
Browse files Browse the repository at this point in the history
  • Loading branch information
itn3000 committed Apr 1, 2019
1 parent 2023f29 commit 2216198
Show file tree
Hide file tree
Showing 4 changed files with 41 additions and 1 deletion.
12 changes: 12 additions & 0 deletions sandbox/TestData.SubDir/Class1.cs
@@ -0,0 +1,12 @@
using System;
using MessagePack;

namespace TestData.SubDir
{

[MessagePackObject(true)]
public class A
{
public int X { get; set; }
}
}
12 changes: 12 additions & 0 deletions sandbox/TestData.SubDir/Sub/SubA.cs
@@ -0,0 +1,12 @@
using System;
using MessagePack;

namespace TestData.SubDir.Sub
{

[MessagePackObject(true)]
public class SubA
{
public int Y { get; set; }
}
}
15 changes: 15 additions & 0 deletions sandbox/TestData.SubDir/TestData.SubDir.csproj
@@ -0,0 +1,15 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>netstandard2.0</TargetFramework>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="MessagePack" Version="1.7.3.4" />
</ItemGroup>
<ItemGroup>
<Compile Remove="Sub\*.cs"/>
<Compile Include="Sub\SubA.cs"/>
</ItemGroup>

</Project>
Expand Up @@ -216,7 +216,8 @@ static Workspace GetWorkspaceFromBuild(this StLogger.Build build, params string[
foreach (var compile in compileItems)
{
var filePath = compile.Text;
var absFilePath = Path.Combine(projectDir, filePath);
// normalize path separater char
var absFilePath = Path.Combine(projectDir, filePath).Replace('\\', Path.DirectorySeparatorChar);
roslynProject = roslynProject.AddDocument(filePath, File.ReadAllText(absFilePath)).Project;
}
foreach (var asm in assemblies)
Expand Down

0 comments on commit 2216198

Please sign in to comment.