Merge pull request #148 from unoplatform/dev/jela/mixed-path-backport

Align mixed path separators
This commit is contained in:
Jérôme Laban 2019-11-22 17:06:57 -05:00 коммит произвёл GitHub
Родитель 1ba0bdb171 5c5aa82764
Коммит daa4ffcbb5
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4AEE18F83AFDEB23
6 изменённых файлов: 36 добавлений и 14 удалений

Просмотреть файл

@ -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:

Просмотреть файл

@ -186,6 +186,23 @@ namespace Uno.Wasm.Bootstrap
}
}
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[] {
@ -375,7 +392,7 @@ namespace Uno.Wasm.Bootstrap
if (File.Exists(sourceFileName))
{
Log.LogMessage(MessageImportance.High, $"Copying {sourceFileName} -> {destFileName}");
File.Copy(sourceFileName, destFileName);
FileCopy(sourceFileName, destFileName);
}
else
{
@ -682,10 +699,10 @@ namespace Uno.Wasm.Bootstrap
{
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()
@ -738,15 +755,7 @@ namespace Uno.Wasm.Bootstrap
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);
}
}
}

Просмотреть файл

@ -0,0 +1 @@
Hello Uno !

Просмотреть файл

@ -0,0 +1 @@
Hello Uno !

Просмотреть файл

@ -18,7 +18,7 @@ using System;
namespace Uno.Wasm.Sample
{
public static class Program
public static class Program
{
static void Main(string[] args)
{

Просмотреть файл

@ -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>