Skip to content

Commit

Permalink
Merge pull request #148 from unoplatform/dev/jela/mixed-path-backport
Browse files Browse the repository at this point in the history
Align mixed path separators
  • Loading branch information
jeromelaban authored Nov 22, 2019
2 parents 1ba0bdb + 5c5aa82 commit daa4ffc
Show file tree
Hide file tree
Showing 6 changed files with 36 additions and 14 deletions.
2 changes: 1 addition & 1 deletion gitversion.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
assembly-versioning-scheme: MajorMinorPatch
mode: ContinuousDeployment
next-version: 1.0.2
next-version: 1.0.4
continuous-delivery-fallback-tag: ""
branches:
master:
Expand Down
33 changes: 21 additions & 12 deletions src/Uno.Wasm.Bootstrap/ShellTask.cs
Original file line number Diff line number Diff line change
Expand Up @@ -186,6 +186,23 @@ private void TouchServiceWorker()
}
}

private void FileCopy(string source, string dest, bool overwrite = false)
{
// Straigten paths to fix issues with mixed path
string FixupPath(string path)
=> path.Replace(Path.AltDirectorySeparatorChar, Path.DirectorySeparatorChar);

try
{
File.Copy(FixupPath(source), FixupPath(dest), overwrite);
}
catch (Exception)
{
Log.LogError($"Failed to copy {source} to {dest}");
throw;
}
}

private void CleanupDist()
{
var unusedFiles = new[] {
Expand Down Expand Up @@ -375,7 +392,7 @@ private void TryDeployDebuggerProxy()
if (File.Exists(sourceFileName))
{
Log.LogMessage(MessageImportance.High, $"Copying {sourceFileName} -> {destFileName}");
File.Copy(sourceFileName, destFileName);
FileCopy(sourceFileName, destFileName);
}
else
{
Expand Down Expand Up @@ -682,10 +699,10 @@ private void CopyRuntime()
{
var dest = Path.Combine(_distPath, Path.GetFileName(sourceFile));
Log.LogMessage($"Runtime {sourceFile} -> {dest}");
File.Copy(sourceFile, dest, true);
FileCopy(sourceFile, dest, true);
}

File.Copy(Path.Combine(MonoWasmSDKPath, "server.py"), Path.Combine(_distPath, "server.py"), true);
FileCopy(Path.Combine(MonoWasmSDKPath, "server.py"), Path.Combine(_distPath, "server.py"), true);
}

private void CopyContent()
Expand Down Expand Up @@ -738,15 +755,7 @@ private void CopyContent()
var dest = Path.Combine(_distPath, relativePath);
Log.LogMessage($"ContentFile {fullSourcePath} -> {dest}");

try
{
File.Copy(fullSourcePath, dest, true);
}
catch(Exception e)
{
Log.LogError($"Failed to copy {fullSourcePath} to {dest}");
throw;
}
FileCopy(fullSourcePath, dest, true);
}
}
}
Expand Down
1 change: 1 addition & 0 deletions src/Uno.Wasm.Sample/AdditionalContent/SomeContent01.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Hello Uno !
1 change: 1 addition & 0 deletions src/Uno.Wasm.Sample/AdditionalContent/SomeContent02.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Hello Uno !
2 changes: 1 addition & 1 deletion src/Uno.Wasm.Sample/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@

namespace Uno.Wasm.Sample
{
public static class Program
public static class Program
{
static void Main(string[] args)
{
Expand Down
11 changes: 11 additions & 0 deletions src/Uno.Wasm.Sample/Uno.Wasm.Sample.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,23 @@
<EmbeddedResource Include="WasmCSS\**\*.css" />
</ItemGroup>

<ItemGroup>
<Content Include="AdditionalContent\SomeContent01.txt" />
<Content Include="AdditionalContent/SomeContent02.txt" />
</ItemGroup>

<ItemGroup>
<WasmShellMonoEnvironment Include="MONO_GC_PARAMS" Value="soft-heap-limit=512m,nursery-size=64m,evacuation-threshold=66,major=marksweep" />
<WasmShellMonoEnvironment Include="MONO_LOG_LEVEL" Value="debug" />
<WasmShellMonoEnvironment Include="MONO_LOG_MASK" Value="gc" />
</ItemGroup>

<Target Name="AfterBuildValidation" AfterTargets="Build">
<Error Condition="!exists('bin/$(Configuration)/$(TargetFramework)/dist/AdditionalContent/SomeContent01.txt')" Text="SomeContent01.txt does not exist in dist"/>
<Error Condition="!exists('bin/$(Configuration)/$(TargetFramework)/dist/AdditionalContent/SomeContent02.txt')" Text="SomeContent02.txt does not exist in dist"/>
<Message Importance="high" Text="Output dist validated" />
</Target>

<ItemGroup>
<LinkerDescriptor Include="LinkerConfig.xml" />
</ItemGroup>
Expand Down

0 comments on commit daa4ffc

Please sign in to comment.