Skip to content

Commit 4ca61cf

Browse files
committed
Nuget packages - create public properties for common, winforms, wpf and offscreen targets so they can be reused if required
Combine Win32 and x86 target in CefSharp.Common.targets
1 parent 195e62b commit 4ca61cf

File tree

4 files changed

+34
-52
lines changed

4 files changed

+34
-52
lines changed

NuGet/CefSharp.Common.targets

Lines changed: 10 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -8,59 +8,41 @@
88
<Error Text="CefSharp requires .Net 4.5.2 or higher" />
99
</Target>
1010

11+
<ItemGroup>
12+
<CefSharpCommonBinaries32 Include="$(MSBuildThisFileDirectory)..\CefSharp\x86\*.*" />
13+
<CefSharpCommonBinaries64 Include="$(MSBuildThisFileDirectory)..\CefSharp\x64\*.*" />
14+
</ItemGroup>
15+
1116
<PropertyGroup>
1217
<CefSharpTargetDir Condition=" '$(CefSharpTargetDir)' == '' ">$(TargetDir)</CefSharpTargetDir>
1318
</PropertyGroup>
1419

15-
<Target Name="CefSharpCopyLibs86" BeforeTargets="BeforeBuild" Condition="'$(Platform)' == 'x86'">
16-
<ItemGroup>
17-
<CefSharpBinaries Include="$(MSBuildThisFileDirectory)..\CefSharp\x86\*.*" />
18-
</ItemGroup>
19-
20+
<Target Name="CefSharpCopyLibs86" BeforeTargets="BeforeBuild" Condition="('$(Platform)' == 'x86') OR ('$(Platform)' == 'Win32')">
2021
<Message Importance="high" Text="Copying cef.redist x86 files" />
2122
<Copy SourceFiles="@(CefRedist32)" DestinationFiles="@(CefRedist32->'$(CefSharpTargetDir)\%(RecursiveDir)%(Filename)%(Extension)')" SkipUnchangedFiles="true" />
2223

2324
<Message Importance="high" Text="-- CefSharp.Common.targets: Copying files from $(MSBuildThisFileDirectory)..\CefSharp\x86 to $(CefSharpTargetDir)" />
24-
<Copy SourceFiles="@(CefSharpBinaries)" DestinationFolder="$(CefSharpTargetDir)" SkipUnchangedFiles="true" />
25-
</Target>
26-
27-
<Target Name="CefSharpCopyLibsWin32" BeforeTargets="BeforeBuild" Condition="'$(Platform)' == 'Win32'">
28-
<ItemGroup>
29-
<CefSharpBinaries Include="$(MSBuildThisFileDirectory)..\CefSharp\x86\*.*" />
30-
</ItemGroup>
31-
<Message Importance="high" Text="Copying cef.redist x86 files" />
32-
<Copy SourceFiles="@(CefRedist32)" DestinationFiles="@(CefRedist32->'$(CefSharpTargetDir)\%(RecursiveDir)%(Filename)%(Extension)')" SkipUnchangedFiles="true" />
33-
34-
<Message Importance="high" Text="-- CefSharp.Common.targets: Copying files from $(MSBuildThisFileDirectory)..\CefSharp\x86 to $(CefSharpTargetDir)" />
35-
<Copy SourceFiles="@(CefSharpBinaries)" DestinationFolder="$(CefSharpTargetDir)" SkipUnchangedFiles="true" />
25+
<Copy SourceFiles="@(CefSharpCommonBinaries32)" DestinationFolder="$(CefSharpTargetDir)" SkipUnchangedFiles="true" />
3626
</Target>
3727

3828
<Target Name="CefSharpCopyLibs64" BeforeTargets="BeforeBuild" Condition="'$(Platform)' == 'x64'">
39-
<ItemGroup>
40-
<CefSharpBinaries Include="$(MSBuildThisFileDirectory)..\CefSharp\x64\*.*" />
41-
</ItemGroup>
4229
<Message Importance="high" Text="Copying cef.redist x64 files" />
4330
<Copy SourceFiles="@(CefRedist64)" DestinationFiles="@(CefRedist64->'$(CefSharpTargetDir)\%(RecursiveDir)%(Filename)%(Extension)')" SkipUnchangedFiles="true" />
4431

4532
<Message Importance="high" Text="-- CefSharp.Common.targets: Copying files from $(MSBuildThisFileDirectory)..\CefSharp\x64 to $(CefSharpTargetDir)" />
46-
<Copy SourceFiles="@(CefSharpBinaries)" DestinationFolder="$(CefSharpTargetDir)" SkipUnchangedFiles="true" />
33+
<Copy SourceFiles="@(CefSharpCommonBinaries64)" DestinationFolder="$(CefSharpTargetDir)" SkipUnchangedFiles="true" />
4734
</Target>
4835

4936
<Target Name="CefSharpCopyLibsAnyCPU" BeforeTargets="BeforeBuild" Condition="'$(Platform)' == 'AnyCPU'">
50-
<ItemGroup>
51-
<CefSharpBinaries32 Include="$(MSBuildThisFileDirectory)..\CefSharp\x86\*.*" />
52-
<CefSharpBinaries64 Include="$(MSBuildThisFileDirectory)..\CefSharp\x64\*.*" />
53-
</ItemGroup>
54-
5537
<Message Importance="high" Text="Copying cef.redist x86 files" />
5638
<Copy SourceFiles="@(CefRedist32)" DestinationFiles="@(CefRedist32->'$(CefSharpTargetDir)\%(RecursiveDir)%(Filename)%(Extension)')" SkipUnchangedFiles="true" />
5739

5840
<Message Importance="high" Text="Copying cef.redist x64 files" />
5941
<Copy SourceFiles="@(CefRedist64)" DestinationFiles="@(CefRedist64->'$(CefSharpTargetDir)\%(RecursiveDir)%(Filename)%(Extension)')" SkipUnchangedFiles="true" />
6042

6143
<Message Importance="high" Text="-- CefSharp.Common.targets: Copying files from $(MSBuildThisFileDirectory)..\CefSharp\x86 to $(CefSharpTargetDir)\x86" />
62-
<Copy SourceFiles="@(CefSharpBinaries32)" DestinationFolder="$(CefSharpTargetDir)\x86" SkipUnchangedFiles="true" />
44+
<Copy SourceFiles="@(CefSharpCommonBinaries32)" DestinationFolder="$(CefSharpTargetDir)\x86" SkipUnchangedFiles="true" />
6345
<Message Importance="high" Text="-- CefSharp.Common.targets: Copying files from $(MSBuildThisFileDirectory)..\CefSharp\x64 to $(CefSharpTargetDir)\x64" />
64-
<Copy SourceFiles="@(CefSharpBinaries64)" DestinationFolder="$(CefSharpTargetDir)\x64" SkipUnchangedFiles="true" />
46+
<Copy SourceFiles="@(CefSharpCommonBinaries64)" DestinationFolder="$(CefSharpTargetDir)\x64" SkipUnchangedFiles="true" />
6547
</Target>
6648
</Project>

NuGet/CefSharp.OffScreen.targets

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,16 +3,16 @@
33
<PropertyGroup>
44
<CefSharpTargetDir Condition=" '$(CefSharpTargetDir)' == '' ">$(TargetDir)</CefSharpTargetDir>
55
</PropertyGroup>
6-
7-
<Target Name="CefSharpCopyOffScreenAnyCPU" BeforeTargets="AfterBuild" Condition="'$(Platform)' == 'AnyCPU'">
8-
<ItemGroup>
9-
<CefSharpBinaries32 Include="$(MSBuildThisFileDirectory)..\CefSharp\x86\*.*" />
10-
<CefSharpBinaries64 Include="$(MSBuildThisFileDirectory)..\CefSharp\x64\*.*" />
11-
</ItemGroup>
126

7+
<ItemGroup>
8+
<CefSharpOffscreenBinaries32 Include="$(MSBuildThisFileDirectory)..\CefSharp\x86\*.*" />
9+
<CefSharpOffscreenBinaries64 Include="$(MSBuildThisFileDirectory)..\CefSharp\x64\*.*" />
10+
</ItemGroup>
11+
12+
<Target Name="CefSharpCopyOffScreenAnyCPU" BeforeTargets="BeforeBuild" Condition="'$(Platform)' == 'AnyCPU'">
1313
<Message Importance="high" Text="-- CefSharp.OffScreen.targets: Copying files from $(MSBuildThisFileDirectory)..\CefSharp\x86 to $(CefSharpTargetDir)\x86" />
14-
<Copy SourceFiles="@(CefSharpBinaries32)" DestinationFolder="$(CefSharpTargetDir)\x86" SkipUnchangedFiles="true" />
14+
<Copy SourceFiles="@(CefSharpOffscreenBinaries32)" DestinationFolder="$(CefSharpTargetDir)\x86" SkipUnchangedFiles="true" />
1515
<Message Importance="high" Text="-- CefSharp.OffScreen.targets: Copying files from $(MSBuildThisFileDirectory)..\CefSharp\x64 to $(CefSharpTargetDir)\x64" />
16-
<Copy SourceFiles="@(CefSharpBinaries64)" DestinationFolder="$(CefSharpTargetDir)\x64" SkipUnchangedFiles="true" />
16+
<Copy SourceFiles="@(CefSharpOffscreenBinaries64)" DestinationFolder="$(CefSharpTargetDir)\x64" SkipUnchangedFiles="true" />
1717
</Target>
1818
</Project>

NuGet/CefSharp.WinForms.targets

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,16 +3,16 @@
33
<PropertyGroup>
44
<CefSharpTargetDir Condition=" '$(CefSharpTargetDir)' == '' ">$(TargetDir)</CefSharpTargetDir>
55
</PropertyGroup>
6-
7-
<Target Name="CefSharpCopyWinFormsAnyCPU" BeforeTargets="AfterBuild" Condition="'$(Platform)' == 'AnyCPU'">
8-
<ItemGroup>
9-
<CefSharpBinaries32 Include="$(MSBuildThisFileDirectory)..\CefSharp\x86\*.*" />
10-
<CefSharpBinaries64 Include="$(MSBuildThisFileDirectory)..\CefSharp\x64\*.*" />
11-
</ItemGroup>
126

7+
<ItemGroup>
8+
<CefSharpWinFormsBinaries32 Include="$(MSBuildThisFileDirectory)..\CefSharp\x86\*.*" />
9+
<CefSharpWinFormsBinaries64 Include="$(MSBuildThisFileDirectory)..\CefSharp\x64\*.*" />
10+
</ItemGroup>
11+
12+
<Target Name="CefSharpCopyWinFormsAnyCPU" BeforeTargets="BeforeBuild" Condition="'$(Platform)' == 'AnyCPU'">
1313
<Message Importance="high" Text="-- CefSharp.WinForms.targets: Copying files from $(MSBuildThisFileDirectory)..\CefSharp\x86 to $(CefSharpTargetDir)\x86" />
14-
<Copy SourceFiles="@(CefSharpBinaries32)" DestinationFolder="$(CefSharpTargetDir)\x86" SkipUnchangedFiles="true" />
14+
<Copy SourceFiles="@(CefSharpWinFormsBinaries32)" DestinationFolder="$(CefSharpTargetDir)\x86" SkipUnchangedFiles="true" />
1515
<Message Importance="high" Text="-- CefSharp.WinForms.targets: Copying files from $(MSBuildThisFileDirectory)..\CefSharp\x64 to $(CefSharpTargetDir)\x64" />
16-
<Copy SourceFiles="@(CefSharpBinaries64)" DestinationFolder="$(CefSharpTargetDir)\x64" SkipUnchangedFiles="true" />
16+
<Copy SourceFiles="@(CefSharpWinFormsBinaries64)" DestinationFolder="$(CefSharpTargetDir)\x64" SkipUnchangedFiles="true" />
1717
</Target>
1818
</Project>

NuGet/CefSharp.Wpf.targets

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,16 +3,16 @@
33
<PropertyGroup>
44
<CefSharpTargetDir Condition=" '$(CefSharpTargetDir)' == '' ">$(TargetDir)</CefSharpTargetDir>
55
</PropertyGroup>
6-
7-
<Target Name="CefSharpCopyWpfAnyCPU" BeforeTargets="AfterBuild" Condition="'$(Platform)' == 'AnyCPU'">
8-
<ItemGroup>
9-
<CefSharpBinaries32 Include="$(MSBuildThisFileDirectory)..\CefSharp\x86\*.*" />
10-
<CefSharpBinaries64 Include="$(MSBuildThisFileDirectory)..\CefSharp\x64\*.*" />
11-
</ItemGroup>
126

7+
<ItemGroup>
8+
<CefSharpWpfBinaries32 Include="$(MSBuildThisFileDirectory)..\CefSharp\x86\*.*" />
9+
<CefSharpWpfBinaries64 Include="$(MSBuildThisFileDirectory)..\CefSharp\x64\*.*" />
10+
</ItemGroup>
11+
12+
<Target Name="CefSharpCopyWpfAnyCPU" BeforeTargets="BeforeBuild" Condition="'$(Platform)' == 'AnyCPU'">
1313
<Message Importance="high" Text="-- CefSharp.Wpf.targets: Copying files from $(MSBuildThisFileDirectory)..\CefSharp\x86 to $(CefSharpTargetDir)\x86" />
14-
<Copy SourceFiles="@(CefSharpBinaries32)" DestinationFolder="$(CefSharpTargetDir)\x86" SkipUnchangedFiles="true" />
14+
<Copy SourceFiles="@(CefSharpWpfBinaries32)" DestinationFolder="$(CefSharpTargetDir)\x86" SkipUnchangedFiles="true" />
1515
<Message Importance="high" Text="-- CefSharp.Wpf.targets: Copying files from $(MSBuildThisFileDirectory)..\CefSharp\x64 to $(CefSharpTargetDir)\x64" />
16-
<Copy SourceFiles="@(CefSharpBinaries64)" DestinationFolder="$(CefSharpTargetDir)\x64" SkipUnchangedFiles="true" />
16+
<Copy SourceFiles="@(CefSharpWpfBinaries64)" DestinationFolder="$(CefSharpTargetDir)\x64" SkipUnchangedFiles="true" />
1717
</Target>
1818
</Project>

0 commit comments

Comments
 (0)