Browse Source

MSBuild - change from using $(SolutionDir) to $MSBuildThisFileDirectory

- Changes to make CefSharp easier to use as a git submodule
- BrowserSubProcess now builds for net6.0-windows for use with WinForms example
pull/4063/merge
Alex Maitland 2 years ago
parent
commit
35f3a57688
  1. 4
      CefSharp.AfterBuild.targets
  2. 10
      CefSharp.Core.Runtime.RefAssembly/CefSharp.Core.Runtime.RefAssembly.netcore.csproj
  3. 2
      CefSharp.Native.props
  4. 2
      CefSharp.OffScreen.Example/CefSharp.OffScreen.Example.csproj
  5. 4
      CefSharp.OffScreen.Example/CefSharp.OffScreen.Example.netcore.csproj
  6. 2
      CefSharp.Test/CefSharp.Test.csproj
  7. 4
      CefSharp.Test/CefSharp.Test.netcore.csproj
  8. 2
      CefSharp.WinForms.Example/CefSharp.WinForms.Example.csproj
  9. 4
      CefSharp.WinForms.Example/CefSharp.WinForms.Example.netcore.csproj
  10. 2
      CefSharp.Wpf.Example/CefSharp.Wpf.Example.csproj
  11. 2
      CefSharp.Wpf.Example/CefSharp.Wpf.Example.netcore.csproj

4
CefSharp.AfterBuild.targets

@ -10,9 +10,9 @@
<Target Name="CefSharpCopyBrowserSubprocess" AfterTargets="AfterBuild">
<ItemGroup>
<!-- We only need the .exe and .pdb but I don't know how to express that easily with MSBuild... -->
<SubProcessFiles Include="$(SolutionDir)CefSharp.BrowserSubprocess\bin.netcore\$(Platform)\$(Configuration)\$(TargetFramework)\CefSharp.BrowserSubprocess.*" />
<SubProcessFiles Include="$(MSBuildThisFileDirectory)CefSharp.BrowserSubprocess\bin.netcore\$(Platform)\$(Configuration)\$(TargetFramework)\CefSharp.BrowserSubprocess.*" />
</ItemGroup>
<Message Importance="high" Text="Copying $(SolutionDir)CefSharp.BrowserSubprocess\bin.netcore\$(Platform)\$(Configuration)\$(TargetFramework)\CefSharp.BrowserSubprocess.* to $(TargetDir)" />
<Message Importance="high" Text="Copying $(MSBuildThisFileDirectory)CefSharp.BrowserSubprocess\bin.netcore\$(Platform)\$(Configuration)\$(TargetFramework)\CefSharp.BrowserSubprocess.* to $(TargetDir)" />
<Copy SourceFiles="@(SubProcessFiles)" DestinationFolder="$(TargetDir)" />
</Target>

10
CefSharp.Core.Runtime.RefAssembly/CefSharp.Core.Runtime.RefAssembly.netcore.csproj

@ -54,19 +54,19 @@
Haven't found a nice way to determine the Platform (resolves as AnyCPU)
-->
<Choose>
<When Condition="Exists('$(SolutionDir)CefSharp.Core.Runtime\bin.netcore\x64\$(Configuration)\CefSharp.Core.Runtime.dll')">
<When Condition="Exists('$(MSBuildThisFileDirectory)..\CefSharp.Core.Runtime\bin.netcore\x64\$(Configuration)\CefSharp.Core.Runtime.dll')">
<PropertyGroup>
<IntermediateTargetPath>$(SolutionDir)CefSharp.Core.Runtime\bin.netcore\x64\$(Configuration)\CefSharp.Core.Runtime.dll</IntermediateTargetPath>
<IntermediateTargetPath>$(MSBuildThisFileDirectory)..\CefSharp.Core.Runtime\bin.netcore\x64\$(Configuration)\CefSharp.Core.Runtime.dll</IntermediateTargetPath>
</PropertyGroup>
</When>
<When Condition="Exists('$(SolutionDir)CefSharp.Core.Runtime\bin.netcore\arm64\$(Configuration)\CefSharp.Core.Runtime.dll')">
<When Condition="Exists('$(MSBuildThisFileDirectory)..\CefSharp.Core.Runtime\bin.netcore\arm64\$(Configuration)\CefSharp.Core.Runtime.dll')">
<PropertyGroup>
<IntermediateTargetPath>$(SolutionDir)CefSharp.Core.Runtime\bin.netcore\arm64\$(Configuration)\CefSharp.Core.Runtime.dll</IntermediateTargetPath>
<IntermediateTargetPath>$(MSBuildThisFileDirectory)..\CefSharp.Core.Runtime\bin.netcore\arm64\$(Configuration)\CefSharp.Core.Runtime.dll</IntermediateTargetPath>
</PropertyGroup>
</When>
<Otherwise>
<PropertyGroup>
<IntermediateTargetPath>$(SolutionDir)CefSharp.Core.Runtime\bin.netcore\win32\$(Configuration)\CefSharp.Core.Runtime.dll</IntermediateTargetPath>
<IntermediateTargetPath>$(MSBuildThisFileDirectory)..\CefSharp.Core.Runtime\bin.netcore\win32\$(Configuration)\CefSharp.Core.Runtime.dll</IntermediateTargetPath>
</PropertyGroup>
</Otherwise>
</Choose>

2
CefSharp.Native.props

@ -3,7 +3,7 @@
<Target Name="CefSharpCopyBrowserSubprocess" AfterTargets="AfterBuild">
<ItemGroup>
<!-- We only need the .exe and .pdb but I don't know how to express that easily with MSBuild... -->
<SubProcessFiles Include="$(SolutionDir)\CefSharp.BrowserSubprocess\bin\$(Platform)\$(Configuration)\CefSharp.BrowserSubprocess.*" />
<SubProcessFiles Include="$(MSBuildThisFileDirectory)\CefSharp.BrowserSubprocess\bin\$(Platform)\$(Configuration)\CefSharp.BrowserSubprocess.*" />
</ItemGroup>
<Copy SourceFiles="@(SubProcessFiles)" DestinationFolder="$(OutDir)" />
</Target>

2
CefSharp.OffScreen.Example/CefSharp.OffScreen.Example.csproj

@ -35,5 +35,5 @@
<Page Remove="bin.netcore\**" />
<Page Remove="obj.netcore\**" />
</ItemGroup>
<Import Project="$(SolutionDir)\CefSharp.Native.props" />
<Import Project="$(MSBuildThisFileDirectory)..\CefSharp.Native.props" />
</Project>

4
CefSharp.OffScreen.Example/CefSharp.OffScreen.Example.netcore.csproj

@ -1,4 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<?xml version="1.0" encoding="utf-8"?>
<Project>
<!-- Note: We cannot use the recommended style of specifying <Project Sdk=...> because we need
to set BaseIntermediateOutputPath and BaseOutputPath before the SDK props are imported. -->
@ -55,6 +55,6 @@
<Compile Remove="obj/**/*.*" />
</ItemGroup>
<Import Project="$(SolutionDir)\CefSharp.AfterBuild.targets" />
<Import Project="$(MSBuildThisFileDirectory)..\CefSharp.AfterBuild.targets" />
<Import Project="Sdk.targets" Sdk="Microsoft.NET.Sdk" />
</Project>

2
CefSharp.Test/CefSharp.Test.csproj

@ -66,5 +66,5 @@
<ItemGroup>
<Content Include="xunit.runner.json" CopyToOutputDirectory="PreserveNewest" />
</ItemGroup>
<Import Project="$(SolutionDir)\CefSharp.Native.props" />
<Import Project="$(MSBuildThisFileDirectory)..\CefSharp.Native.props" />
</Project>

4
CefSharp.Test/CefSharp.Test.netcore.csproj

@ -1,4 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<?xml version="1.0" encoding="utf-8"?>
<Project>
<!-- Note: We cannot use the recommended style of specifying <Project Sdk=...> because we need
to set BaseIntermediateOutputPath and BaseOutputPath before the SDK props are imported. -->
@ -59,6 +59,6 @@
<Content Include="xunit.runner.json" CopyToOutputDirectory="PreserveNewest" />
</ItemGroup>
<Import Project="$(SolutionDir)\CefSharp.AfterBuild.targets" />
<Import Project="$(MSBuildThisFileDirectory)..\CefSharp.AfterBuild.targets" />
<Import Project="Sdk.targets" Sdk="Microsoft.NET.Sdk.WindowsDesktop" />
</Project>

2
CefSharp.WinForms.Example/CefSharp.WinForms.Example.csproj

@ -44,5 +44,5 @@
<Page Remove="bin.netcore\**" />
<Page Remove="obj.netcore\**" />
</ItemGroup>
<Import Project="$(SolutionDir)\CefSharp.Native.props" />
<Import Project="$(MSBuildThisFileDirectory)..\CefSharp.Native.props" />
</Project>

4
CefSharp.WinForms.Example/CefSharp.WinForms.Example.netcore.csproj

@ -1,4 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<?xml version="1.0" encoding="utf-8"?>
<Project>
<!-- Note: We cannot use the recommended style of specifying <Project Sdk=...> because we need
to set BaseIntermediateOutputPath and BaseOutputPath before the SDK props are imported. -->
@ -62,6 +62,6 @@
<Compile Remove="obj/**/*.*" />
</ItemGroup>
<Import Project="$(SolutionDir)\CefSharp.AfterBuild.targets" />
<Import Project="$(MSBuildThisFileDirectory)..\CefSharp.AfterBuild.targets" />
<Import Project="Sdk.targets" Sdk="Microsoft.NET.Sdk.WindowsDesktop" />
</Project>

2
CefSharp.Wpf.Example/CefSharp.Wpf.Example.csproj

@ -43,5 +43,5 @@
<Page Remove="bin.netcore\**" />
<Page Remove="obj.netcore\**" />
</ItemGroup>
<Import Project="$(SolutionDir)\CefSharp.Native.props" />
<Import Project="$(MSBuildThisFileDirectory)..\CefSharp.Native.props" />
</Project>

2
CefSharp.Wpf.Example/CefSharp.Wpf.Example.netcore.csproj

@ -57,6 +57,6 @@
<Compile Remove="obj/**/*.*" />
</ItemGroup>
<Import Project="$(SolutionDir)\CefSharp.AfterBuild.targets" />
<Import Project="$(MSBuildThisFileDirectory)..\CefSharp.AfterBuild.targets" />
<Import Project="Sdk.targets" Sdk="Microsoft.NET.Sdk.WindowsDesktop" />
</Project>
Loading…
Cancel
Save