Skip to content

Commit

Permalink
Test - Add RuntimeIdentifiers and fix build.ps1
Browse files Browse the repository at this point in the history
- Seems the Nuget restore doesn't work correctly without having RuntimeIdentifiers set
  Must also set RuntimeIdentifier manually so the files are copied correctly.
- Move the msbuild restore after the vcvarsall.bat call so the script runs successfully
  • Loading branch information
amaitland committed Oct 12, 2021
1 parent ee431d7 commit bd88019
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
7 changes: 4 additions & 3 deletions CefSharp.Test/CefSharp.Test.csproj
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
<Project Sdk="Microsoft.NET.Sdk">
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net472</TargetFramework>
<OutputType>Library</OutputType>
<Platforms>x86;x64</Platforms>
<RuntimeIdentifiers>win7-x86;win7-x64</RuntimeIdentifiers>
<GenerateAssemblyInfo>false</GenerateAssemblyInfo>
<UseWindowsForms>true</UseWindowsForms>
<UseWPF>true</UseWPF>
Expand All @@ -11,11 +12,11 @@
</PropertyGroup>

<PropertyGroup Condition="'$(PlatformTarget)' == 'x86'">
<RuntimeIdentifier Condition="'$(RuntimeIdentifier)' == ''">win-x86</RuntimeIdentifier>
<RuntimeIdentifier Condition="'$(RuntimeIdentifier)' == ''">win7-x86</RuntimeIdentifier>
</PropertyGroup>

<PropertyGroup Condition="'$(PlatformTarget)' == 'x64'">
<RuntimeIdentifier Condition="'$(RuntimeIdentifier)' == ''">win-x64</RuntimeIdentifier>
<RuntimeIdentifier Condition="'$(RuntimeIdentifier)' == ''">win7-x64</RuntimeIdentifier>
</PropertyGroup>

<ItemGroup>
Expand Down
6 changes: 3 additions & 3 deletions build.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,9 @@ function Msvs
}

$Arch = TernaryReturn ($Platform -eq 'x64') 'x64' 'win32'

# Restore Nuget packages
&msbuild /t:restore /p:Platform=$Arch /p:Configuration=Release $CefSln

$Arguments = @(
"$CefSln",
Expand Down Expand Up @@ -263,9 +266,6 @@ function NugetPackageRestore
# Restore packages
. $nuget restore CefSharp.Core.Runtime\packages.CefSharp.Core.Runtime.config -PackagesDirectory packages
. $nuget restore CefSharp.BrowserSubprocess.Core\packages.CefSharp.BrowserSubprocess.Core.config -PackagesDirectory packages

# Restore for any platform is fine, doesn't seem to matter which one long as it's successful
&msbuild /t:restore /p:Platform=x64 /p:Configuration=Release CefSharp3.sln
}

function Nupkg
Expand Down

0 comments on commit bd88019

Please sign in to comment.