Make sure to copy linux native files around

This commit is contained in:
Matthew Leibowitz 2018-01-24 21:04:35 +02:00
Родитель c408cd9eb7
Коммит 3103ee9662
3 изменённых файлов: 43 добавлений и 0 удалений

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

@ -58,6 +58,14 @@
<Link>nuget\runtimes\osx\native\libHarfBuzzSharp.dylib</Link>
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Include="..\..\native-builds\lib\linux\x64\libHarfBuzzSharp.so" Condition="Exists('..\..\native-builds\lib\linux\x64\libHarfBuzzSharp.so')">
<Link>nuget\runtimes\linux-x64\native\libHarfBuzzSharp.so</Link>
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Include="..\..\native-builds\lib\linux\x86\libHarfBuzzSharp.so" Condition="Exists('..\..\native-builds\lib\linux\x86\libHarfBuzzSharp.so')">
<Link>nuget\runtimes\linux-x86\native\libHarfBuzzSharp.so</Link>
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
</ItemGroup>
<ItemGroup>
<None Include="nuget\build\net45\HarfBuzzSharp.Desktop.targets">

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

@ -62,6 +62,14 @@
<Link>nuget\runtimes\osx\native\libSkiaSharp.dylib</Link>
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Include="..\..\native-builds\lib\linux\x64\libSkiaSharp.so" Condition="Exists('..\..\native-builds\lib\linux\x64\libSkiaSharp.so')">
<Link>nuget\runtimes\linux-x64\native\libSkiaSharp.so</Link>
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Include="..\..\native-builds\lib\linux\x86\libSkiaSharp.so" Condition="Exists('..\..\native-builds\lib\linux\x86\libSkiaSharp.so')">
<Link>nuget\runtimes\linux-x86\native\libSkiaSharp.so</Link>
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
</ItemGroup>
<ItemGroup>
<None Include="nuget\build\net45\SkiaSharp.Desktop.targets">

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

@ -9,6 +9,33 @@ namespace SkiaSharp.Tests
{
public abstract class SKTest
{
#if !NET_STANDARD
static SKTest()
{
// some platforms run the tests from a temporary location
var skiaRoot = Path.GetDirectoryName(typeof(SkiaSharp.SKImageInfo).Assembly.Location);
var harfRoot = Path.GetDirectoryName(typeof(HarfBuzzSharp.Buffer).Assembly.Location);
foreach (var file in Directory.GetFiles(PathToAssembly))
{
var fname = Path.GetFileNameWithoutExtension(file);
var skiaDest = Path.Combine(skiaRoot, Path.GetFileName(file));
if (fname == "libSkiaSharp" && !File.Exists(skiaDest))
{
File.Copy(file, skiaDest, true);
}
var harfDest = Path.Combine(harfRoot, Path.GetFileName(file));
if (fname == "libHarfBuzzSharp" && !File.Exists(harfDest))
{
File.Copy(file, harfDest, true);
}
}
}
#endif
protected const string Category = nameof(Category);
protected const string GpuCategory = "GPU";