Skip to content

Commit

Permalink
Merge pull request #18853 from unoplatform/dev/jela/non-wasm-rid
Browse files Browse the repository at this point in the history
fix(net9): Allow for builds to happen even if a RID is explicitly set
  • Loading branch information
jeromelaban authored Nov 20, 2024
2 parents 44d7617 + 281bf25 commit f021b99
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 1 deletion.
5 changes: 4 additions & 1 deletion build/test-scripts/run-netcore-mobile-template-tests.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -345,7 +345,10 @@ $projects =
@(4, "5.2/uno52AppWithLib/uno52AppWithLib/uno52AppWithLib.csproj", @("-p:Platform=x86" , "-p:TargetFramework=net8.0-windows10.0.19041"), @()),

# Publishing validation
@(4, "5.3/uno53net9blank/uno53net9blank/uno53net9blank.csproj", @("-f", "net9.0-desktop", "-p:PackageFormat=app"), @("OnlyMacOS", "NetCore", "Publish"))
@(4, "5.3/uno53net9blank/uno53net9blank/uno53net9blank.csproj", @("-f", "net9.0-desktop", "-p:PackageFormat=app"), @("OnlyMacOS", "NetCore", "Publish")),

# Ensure that build can happen even if a RID is specified
@(4, "5.3/uno53net9blank/uno53net9blank/uno53net9blank.csproj", @("-f", "net9.0-android", "-r", "android-arm64"), @("macOS", "NetCore"))

## Note for contributors
##
Expand Down
4 changes: 4 additions & 0 deletions src/Uno.Sdk/Sdk/Sdk.targets
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,10 @@ Copyright (C) Uno Platform Inc. All rights reserved.

<!-- Microsoft.NET.Sdk should be loaded last. This ensures our targets are evaluated before all others. -->
<Import Sdk="$(_DefaultMicrosoftNETSdk)" Project="Sdk.targets" />

<!-- Replacement for restore targets for Wasm when an explicit RID is specified -->
<Import Project="$(_UnoSdkTargetsDirectory)Uno.Wasm.UnsupportedRid.targets"
Condition=" $([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'browserwasm' AND '$(RuntimeIdentifier)' != '' AND '$(RuntimeIdentifier)' != 'browser-wasm' "/>

<!-- Targets and props to be executed last after the default .NET SDK has been imported -->
<Import Project="$(_UnoSdkTargetsDirectory)Uno.Sdk.After.targets" />
Expand Down
17 changes: 17 additions & 0 deletions src/Uno.Sdk/targets/Uno.Wasm.UnsupportedRid.targets
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">

<!--
This file recreates the targets from NuGet.target that are needed when
building with `-r` to specify a RID. In this case, inclusion conditions in the
WebAssembly SDK do not include any of the nuget targets, causing the restore
to fail. Those targets are intentionally empty to keep the restore going.
-->

<Target Name="_GetRestoreSettingsPerFramework" />

<Target Name="GetAllRuntimeIdentifiers"
Returns="browser-wasm" />

<Target Name="_GenerateProjectRestoreGraphPerFramework" />

</Project>

0 comments on commit f021b99

Please sign in to comment.