Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[release/3.1] Tools: Enable .NET Framework projects targeting win-arm64 #28254

Merged
merged 1 commit into from
Jun 22, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion src/EFCore.Tools/EFCore.Tools.nuspec
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,10 @@
<file src="../../artifacts/bin/ef/$configuration$/net461/ef.pdb" target="tools/net461/any/" />
<file src="../../artifacts/bin/ef/x86/$configuration$/net461/ef.exe" target="tools/net461/win-x86/" />
<file src="../../artifacts/bin/ef/x86/$configuration$/net461/ef.pdb" target="tools/net461/win-x86/" />
<file src="../../artifacts/bin/ef/ARM64/$configuration$/net461/ef.exe" target="tools/net461/win-arm64/" />
<file src="../../artifacts/bin/ef/ARM64/$configuration$/net461/ef.pdb" target="tools/net461/win-arm64/" />
<file src="../../artifacts/bin/ef/$configuration$/netcoreapp2.0/ef.dll" target="tools/netcoreapp2.0/any/" />
<file src="../../artifacts/bin/ef/$configuration$/netcoreapp2.0/ef.pdb" target="tools/netcoreapp2.0/any/" />
<file src="../../artifacts/bin/ef/$configuration$/netcoreapp2.0/ef.runtimeconfig.json" target="tools/netcoreapp2.0/any/" />
</files>
</package>
</package>
4 changes: 4 additions & 0 deletions src/EFCore.Tools/tools/EntityFrameworkCore.psm1
Original file line number Diff line number Diff line change
Expand Up @@ -847,6 +847,10 @@ function EF($project, $startupProject, $params, [switch] $skipBuild)
{
$exePath = Join-Path $PSScriptRoot 'net461\win-x86\ef.exe'
}
elseif ($platformTarget -eq 'ARM64')
{
$exePath = Join-Path $PSScriptRoot 'net461\win-arm64\ef.exe'
}
elseif ($platformTarget -in 'AnyCPU', 'x64')
{
$exePath = Join-Path $PSScriptRoot 'net461\any\ef.exe'
Expand Down
9 changes: 6 additions & 3 deletions src/dotnet-ef/RootCommand.cs
Original file line number Diff line number Diff line change
Expand Up @@ -108,9 +108,12 @@ protected override int Execute()
executable = Path.Combine(
toolsPath,
"net461",
startupProject.PlatformTarget == "x86"
? "win-x86"
: "any",
startupProject.PlatformTarget switch
{
"x86" => "win-x86",
"ARM64" => "win-arm64",
_ => "any"
},
"ef.exe");
}
else if (targetFramework.Identifier == ".NETCoreApp")
Expand Down
4 changes: 3 additions & 1 deletion src/dotnet-ef/dotnet-ef.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ dotnet ef database update
<TargetFramework>$(DefaultNetCoreTargetFramework)</TargetFramework>
<OutputType>Exe</OutputType>
<PackAsTool>true</PackAsTool>
<PackAsToolShimRuntimeIdentifiers>win-x64;win-x86</PackAsToolShimRuntimeIdentifiers>
<PackAsToolShimRuntimeIdentifiers>win-x64;win-x86;win-arm64</PackAsToolShimRuntimeIdentifiers>
<!-- Because this project uses a custom nuspec, this is necessary to ensure the generated shims are in the publish directory. -->
<PackagedShimOutputRootDirectory>$(OutDir)</PackagedShimOutputRootDirectory>
<RootNamespace>Microsoft.EntityFrameworkCore.Tools</RootNamespace>
Expand Down Expand Up @@ -96,6 +96,8 @@ dotnet ef database update
<NuspecProperty Include="OutputExeSymbol=..\..\artifacts\bin\ef\$(Configuration)\net461\ef.pdb" />
<NuspecProperty Include="OutputX86Exe=..\..\artifacts\bin\ef\x86\$(Configuration)\net461\ef.exe" />
<NuspecProperty Include="OutputX86ExeSymbol=..\..\artifacts\bin\ef\x86\$(Configuration)\net461\ef.pdb" />
<NuspecProperty Include="OutputARM64Exe=..\..\artifacts\bin\ef\ARM64\$(Configuration)\net461\ef.exe" />
<NuspecProperty Include="OutputARM64ExeSymbol=..\..\artifacts\bin\ef\ARM64\$(Configuration)\net461\ef.pdb" />
</ItemGroup>
</Target>
</Project>
2 changes: 2 additions & 0 deletions src/dotnet-ef/dotnet-ef.nuspec
Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,7 @@
<file src="$OutputExeSymbol$" target="tools\$targetFramework$\any\tools\net461\any" />
<file src="$OutputX86Exe$" target="tools\$targetFramework$\any\tools\net461\win-x86" />
<file src="$OutputX86ExeSymbol$" target="tools\$targetFramework$\any\tools\net461\win-x86" />
<file src="$OutputARM64Exe$" target="tools\$targetFramework$\any\tools\net461\win-arm64" />
<file src="$OutputARM64ExeSymbol$" target="tools\$targetFramework$\any\tools\net461\win-arm64" />
</files>
</package>
3 changes: 2 additions & 1 deletion src/ef/ef.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,9 @@
</Compile>
</ItemGroup>

<Target Name="BuildX86" AfterTargets="Build" Condition=" '$(TargetFramework)' == 'net461' And '$(Platform)' != 'x86' ">
<Target Name="BuildOtherPlatforms" AfterTargets="Build" Condition=" '$(TargetFramework)' == 'net461' And '$(Platform)' == 'AnyCPU' ">
<MSBuild Projects="$(MSBuildProjectFullPath)" Properties="TargetFramework=$(TargetFramework);Platform=x86;Configuration=$(Configuration)" Targets="Build" />
<MSBuild Projects="$(MSBuildProjectFullPath)" Properties="TargetFramework=$(TargetFramework);Platform=ARM64;Configuration=$(Configuration)" Targets="Build" />
</Target>

</Project>