|
1 | 1 | <?xml version="1.0" encoding="utf-8"?> |
2 | 2 | <Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> |
3 | | - <Target Name="PlatformCheck" BeforeTargets="ResolveAssemblyReferences" Condition="(('$(Platform)' != 'x86') AND ('$(Platform)' != 'x64') AND ('$(Platform)' != 'Win32') AND '$(CefSharpAnyCpuSupport)' != 'true')"> |
4 | | - <Error Text="$(MSBuildThisFileName) is unable to proceeed as your current Platform is '$(Platform)'. To target AnyCPU please read https://github.com/cefsharp/CefSharp/issues/1714. Alternatively change your Platform to x86 or x64 and the relevant files will be copied automatically. For details on changing your projects Platform see https://docs.microsoft.com/en-gb/visualstudio/ide/how-to-configure-projects-to-target-platforms?view=vs-2017" HelpKeyword="CefSharpSolutionPlatformCheck" /> |
5 | | - </Target> |
6 | | - |
7 | 3 | <Target Name="FrameworkVersionCheck" BeforeTargets="ResolveAssemblyReferences" Condition="(('$(TargetFrameworkVersion)' == 'v4.5.1') OR ('$(TargetFrameworkVersion)' == 'v4.5') OR ('$(TargetFrameworkVersion)' == 'v4.0'))"> |
8 | 4 | <Error Text="CefSharp requires .Net 4.5.2 or higher" /> |
9 | 5 | </Target> |
10 | 6 |
|
11 | | - <PropertyGroup> |
12 | | - <CefSharpTargetDir Condition=" '$(CefSharpTargetDir)' == '' ">.</CefSharpTargetDir> |
13 | | - </PropertyGroup> |
14 | | - |
15 | 7 | <!-- |
16 | 8 | These item groups should be in the .props file, unfortunately Nuget 2.8.x doesn't gurantee the |
17 | 9 | correct ordering .props imports, which we require as this depends on the cef.redist packages |
18 | 10 | exporting an ItemGroup |
19 | 11 | --> |
| 12 | + <Choose> |
| 13 | + <When Condition="('$(Platform)' == 'AnyCPU') OR ('$(Platform)' == 'x86') OR ('$(Platform)' == 'Win32')"> |
| 14 | + <ItemGroup> |
| 15 | + <None Include="@(CefRedist32)"> |
| 16 | + <Link>x86\%(RecursiveDir)%(FileName)%(Extension)</Link> |
| 17 | + <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> |
| 18 | + <PublishState>Include</PublishState> |
| 19 | + <Visible>false</Visible> |
| 20 | + </None> |
| 21 | + <None Include="@(CefSharpCommonBinaries32)"> |
| 22 | + <Link>x86\%(RecursiveDir)%(FileName)%(Extension)</Link> |
| 23 | + <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> |
| 24 | + <PublishState>Include</PublishState> |
| 25 | + <Visible>false</Visible> |
| 26 | + </None> |
| 27 | + </ItemGroup> |
| 28 | + </When> |
| 29 | + </Choose> |
20 | 30 |
|
21 | | - <ItemGroup Condition="('$(Platform)' == 'x86') OR ('$(Platform)' == 'Win32')"> |
22 | | - <None Include="@(CefRedist32)"> |
23 | | - <Link>$(CefSharpTargetDir)\%(RecursiveDir)%(FileName)%(Extension)</Link> |
24 | | - <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> |
25 | | - <PublishState>Include</PublishState> |
26 | | - <Visible>false</Visible> |
27 | | - </None> |
28 | | - <None Include="@(CefSharpCommonBinaries32)"> |
29 | | - <Link>$(CefSharpTargetDir)\%(RecursiveDir)%(FileName)%(Extension)</Link> |
30 | | - <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> |
31 | | - <PublishState>Include</PublishState> |
32 | | - <Visible>false</Visible> |
33 | | - </None> |
34 | | - </ItemGroup> |
35 | | - |
36 | | - <ItemGroup Condition="'$(Platform)' == 'x64'"> |
37 | | - <None Include="@(CefRedist64)"> |
38 | | - <Link>$(CefSharpTargetDir)\%(RecursiveDir)%(FileName)%(Extension)</Link> |
39 | | - <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> |
40 | | - <PublishState>Include</PublishState> |
41 | | - <Visible>false</Visible> |
42 | | - </None> |
43 | | - <None Include="@(CefSharpCommonBinaries64)"> |
44 | | - <Link>$(CefSharpTargetDir)\%(RecursiveDir)%(FileName)%(Extension)</Link> |
45 | | - <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> |
46 | | - <PublishState>Include</PublishState> |
47 | | - <Visible>false</Visible> |
48 | | - </None> |
49 | | - </ItemGroup> |
50 | | - |
51 | | - <ItemGroup Condition="'$(Platform)' == 'AnyCPU'"> |
52 | | - <None Include="@(CefRedist32)"> |
53 | | - <Link>$(CefSharpTargetDir)\x86\%(RecursiveDir)%(FileName)%(Extension)</Link> |
54 | | - <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> |
55 | | - <PublishState>Include</PublishState> |
56 | | - <Visible>false</Visible> |
57 | | - </None> |
58 | | - <None Include="@(CefRedist64)"> |
59 | | - <Link>$(CefSharpTargetDir)\x64\%(RecursiveDir)%(FileName)%(Extension)</Link> |
60 | | - <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> |
61 | | - <PublishState>Include</PublishState> |
62 | | - <Visible>false</Visible> |
63 | | - </None> |
64 | | - <None Include="@(CefSharpCommonBinaries32)"> |
65 | | - <Link>$(CefSharpTargetDir)\x86\%(RecursiveDir)%(FileName)%(Extension)</Link> |
66 | | - <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> |
67 | | - <PublishState>Include</PublishState> |
68 | | - <Visible>false</Visible> |
69 | | - </None> |
70 | | - <None Include="@(CefSharpCommonBinaries64)"> |
71 | | - <Link>$(CefSharpTargetDir)\x64\%(RecursiveDir)%(FileName)%(Extension)</Link> |
72 | | - <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> |
73 | | - <PublishState>Include</PublishState> |
74 | | - <Visible>false</Visible> |
75 | | - </None> |
76 | | - </ItemGroup> |
| 31 | + <Choose> |
| 32 | + <When Condition="('$(Platform)' == 'AnyCPU') OR ('$(Platform)' == 'x64')"> |
| 33 | + <ItemGroup> |
| 34 | + <None Include="@(CefRedist64)"> |
| 35 | + <Link>x64\%(RecursiveDir)%(FileName)%(Extension)</Link> |
| 36 | + <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> |
| 37 | + <PublishState>Include</PublishState> |
| 38 | + <Visible>false</Visible> |
| 39 | + </None> |
| 40 | + <None Include="@(CefSharpCommonBinaries64)"> |
| 41 | + <Link>x64\%(RecursiveDir)%(FileName)%(Extension)</Link> |
| 42 | + <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> |
| 43 | + <PublishState>Include</PublishState> |
| 44 | + <Visible>false</Visible> |
| 45 | + </None> |
| 46 | + </ItemGroup> |
| 47 | + </When> |
| 48 | + </Choose> |
| 49 | + |
| 50 | + <UsingTask TaskName="TransformXml" AssemblyFile="$(MSBuildExtensionsPath)\Microsoft\VisualStudio\v$(VisualStudioVersion)\Web\Microsoft.Web.Publishing.Tasks.dll" /> |
| 51 | + <Target Name="CefSharpCommon_TransformX86Config" Condition="('$(Platform)' == 'AnyCPU') OR ('$(Platform)' == 'x86') OR ('$(Platform)' == 'Win32')" AfterTargets="_CopyAppConfigFile"> |
| 52 | + <TransformXml Source="@(AppConfigWithTargetPath->'$(OutDir)%(TargetPath)')" Transform="$(MSBuildThisFileDirectory)app.config.x86.transform" Destination="@(AppConfigWithTargetPath->'$(OutDir)%(TargetPath)')"/> |
| 53 | + </Target> |
| 54 | + <Target Name="CefSharpCommon_TransformX64Config" Condition="('$(Platform)' == 'AnyCPU') OR ('$(Platform)' == 'x64')" AfterTargets="_CopyAppConfigFile"> |
| 55 | + <TransformXml Source="@(AppConfigWithTargetPath->'$(OutDir)%(TargetPath)')" Transform="$(MSBuildThisFileDirectory)app.config.x64.transform" Destination="@(AppConfigWithTargetPath->'$(OutDir)%(TargetPath)')"/> |
| 56 | + </Target> |
77 | 57 | </Project> |
0 commit comments