Updated the .targets file to a new set of copy rules:

- always copy, unless ShouldIncludeNativeSkiaSharp=True
 - copy all platforms on AnyCPU
This commit is contained in:
Matthew Leibowitz 2017-02-05 00:22:14 +04:00
Родитель fb593a0f08
Коммит 8ecf8370ea
1 изменённых файлов: 14 добавлений и 16 удалений

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

@ -2,19 +2,12 @@
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> <Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<!-- if ShouldIncludeNativeSkiaSharp == False then don't include the native libSkiaSharp --> <!-- if ShouldIncludeNativeSkiaSharp == False then don't include the native libSkiaSharp -->
<!-- if IsLibraryOutputType == True then don't copy the native files as they will be copied by the app -->
<PropertyGroup> <PropertyGroup>
<!-- set the variable to true whenever they should be --> <ShouldIncludeNativeSkiaSharp Condition=" '$(ShouldIncludeNativeSkiaSharp)' == '' ">True</ShouldIncludeNativeSkiaSharp>
<IsLibraryOutputType Condition=" '$(IsLibraryOutputType)' == '' and '$(OutputType)' == 'Library' ">True</IsLibraryOutputType>
<ShouldIncludeNativeSkiaSharp Condition=" '$(ShouldIncludeNativeSkiaSharp)' == '' and '$(IsLibraryOutputType)' != 'True' ">True</ShouldIncludeNativeSkiaSharp>
<!-- set the final values based on the variables -->
<IsLibraryOutputType Condition=" '$(IsLibraryOutputType)' == '' ">False</IsLibraryOutputType>
<ShouldIncludeNativeSkiaSharp Condition=" '$(ShouldIncludeNativeSkiaSharp)' == '' and '$(IsLibraryOutputType)' == 'True' ">False</ShouldIncludeNativeSkiaSharp>
</PropertyGroup> </PropertyGroup>
<!-- add the native x86 Windows library --> <!-- add the native x86 Windows library -->
<ItemGroup Condition=" '$(ShouldIncludeNativeSkiaSharp)' != 'False' and '$(Platform)' == 'x86' and '$(OS)' != 'Unix' "> <ItemGroup Condition=" '$(ShouldIncludeNativeSkiaSharp)' != 'False' and '$(PlatformTarget)' == 'x86' and '$(OS)' != 'Unix' ">
<None Include="$(MSBuildThisFileDirectory)..\..\runtimes\win7-x86\native\libSkiaSharp.dll"> <None Include="$(MSBuildThisFileDirectory)..\..\runtimes\win7-x86\native\libSkiaSharp.dll">
<Link>libSkiaSharp.dll</Link> <Link>libSkiaSharp.dll</Link>
<CopyToOutputDirectory>Always</CopyToOutputDirectory> <CopyToOutputDirectory>Always</CopyToOutputDirectory>
@ -22,19 +15,24 @@
</ItemGroup> </ItemGroup>
<!-- add the native x64 Windows library --> <!-- add the native x64 Windows library -->
<ItemGroup Condition=" '$(ShouldIncludeNativeSkiaSharp)' != 'False' and '$(Platform)' == 'x64' and '$(OS)' != 'Unix' "> <ItemGroup Condition=" '$(ShouldIncludeNativeSkiaSharp)' != 'False' and '$(PlatformTarget)' == 'x64' and '$(OS)' != 'Unix' ">
<None Include="$(MSBuildThisFileDirectory)..\..\runtimes\win7-x64\native\libSkiaSharp.dll"> <None Include="$(MSBuildThisFileDirectory)..\..\runtimes\win7-x64\native\libSkiaSharp.dll">
<Link>libSkiaSharp.dll</Link> <Link>libSkiaSharp.dll</Link>
<CopyToOutputDirectory>Always</CopyToOutputDirectory> <CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None> </None>
</ItemGroup> </ItemGroup>
<!-- make sure Windows is x86 or x64 --> <!-- copy both native Windows libraries for Any CPU -->
<Target Condition=" '$(ShouldIncludeNativeSkiaSharp)' != 'False' and '$(Platform)' != 'x64' and '$(Platform)' != 'x86' and '$(OS)' != 'Unix' " <ItemGroup Condition=" '$(ShouldIncludeNativeSkiaSharp)' != 'False' and '$(PlatformTarget)' != 'x64' and '$(PlatformTarget)' != 'x86' and '$(OS)' != 'Unix' ">
Name="CheckSkiaPlatforms" <None Include="$(MSBuildThisFileDirectory)..\..\runtimes\win7-x86\native\libSkiaSharp.dll">
BeforeTargets="Build"> <Link>x86\libSkiaSharp.dll</Link>
<Error Text="The Platform needs to be either x64 or x86 to support Skia in Windows." /> <CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Target> </None>
<None Include="$(MSBuildThisFileDirectory)..\..\runtimes\win7-x64\native\libSkiaSharp.dll">
<Link>x64\libSkiaSharp.dll</Link>
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
</ItemGroup>
<!-- add the native OSX library --> <!-- add the native OSX library -->
<ItemGroup Condition=" '$(ShouldIncludeNativeSkiaSharp)' != 'False' and '$(OS)' == 'Unix' "> <ItemGroup Condition=" '$(ShouldIncludeNativeSkiaSharp)' != 'False' and '$(OS)' == 'Unix' ">