Skip to content

Commit c0ce6b0

Browse files
committed
Fix mpu.exe path problem. Issue #125.
Because csproj file use back slashes instead of forward slashes to represent file path, copying non-Windows environment always fails. This commit normalize the file path with Path.DirectorySeparatorChar.
1 parent e2414b7 commit c0ce6b0

File tree

5 files changed

+658
-901
lines changed

5 files changed

+658
-901
lines changed

CHANGES.txt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -370,3 +370,8 @@ Release 0.6.5 - 2015/10/20
370370
* Add UNITY_5 for UNITY compiler constant determination.
371371
* Remove unnecessary Pack<T>() usage to avoid unexpected performance loss and/or Unity(and its Mono) C# compiler overload resolution failure.
372372

373+
Release 0.6.5.1 - 2015/10/25
374+
375+
BUG FIXES
376+
* mpu.exe -l option does not work in non-Windows environment. Issue #125.
377+

src/mpu/AssetFileImporter.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -93,15 +93,15 @@ public void AssembleAssetTree( string sourceProjectPath, string outputDirectoryP
9393
}
9494

9595
var sourceDirectoryPath = Path.GetDirectoryName( sourceProjectPath );
96-
97-
foreach ( var sourceFileRelativePath in this.ParseProjectFile( sourceProjectPath ) )
96+
var relativePrefix = ".." + Path.DirectorySeparatorChar;
97+
foreach ( var sourceFileRelativePath in this.ParseProjectFile( sourceProjectPath ).Select( p => p.Replace( '\\', Path.DirectorySeparatorChar )) )
9898
{
9999
var destinationFilePath =
100100
Path.Combine(
101101
outputDirectoryPath,
102102
new String(
103-
( sourceFileRelativePath.StartsWith( "..\\" ) ? sourceFileRelativePath.Substring( 3 ) : sourceFileRelativePath ) // remove relative
104-
.SkipWhile( c => c != '\\') // remove project name portion
103+
( sourceFileRelativePath.StartsWith( relativePrefix ) ? sourceFileRelativePath.Substring( 3 ) : sourceFileRelativePath ) // remove relative
104+
.SkipWhile( c => c != Path.DirectorySeparatorChar) // remove project name portion
105105
.Skip( 1 )
106106
.ToArray()
107107
)

tools/mpu/bin/MsgPack.dll

-13.5 KB
Binary file not shown.

0 commit comments

Comments
 (0)