Skip to content

Commit d3312b2

Browse files
committed
feat: Add Microsoft.NET.Sdk.WebAssembly support
1 parent 9380ec9 commit d3312b2

File tree

4 files changed

+22
-7
lines changed

4 files changed

+22
-7
lines changed

src/Directory.Build.targets

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,8 +75,8 @@
7575
<PackageReference Update="Uno.Core.Extensions.Disposables" Version="4.0.1" />
7676
<PackageReference Update="Uno.Core.Extensions.Compatibility" Version="4.0.1" />
7777
<PackageReference Update="Uno.Diagnostics.Eventing" Version="2.0.1" />
78-
<PackageReference Update="Uno.Wasm.Bootstrap" Version="9.0.0-dev.86" />
79-
<PackageReference Update="Uno.Wasm.Bootstrap.DevServer" Version="9.0.0-dev.86" />
78+
<PackageReference Update="Uno.Wasm.Bootstrap" Version="9.0.0-dev.270" />
79+
<PackageReference Update="Uno.Wasm.Bootstrap.DevServer" Version="9.0.0-dev.270" />
8080
<PackageReference Update="MSTest" Version="3.3.1" />
8181
<PackageReference Update="MSTest.TestFramework" Version="3.3.1" />
8282
<PackageReference Update="MSTest.TestAdapter" Version="3.3.1" />

src/SamplesApp/SamplesApp.Wasm/SamplesApp.Wasm.csproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<?xml version="1.0" encoding="utf-8"?>
2-
<Project Sdk="Microsoft.NET.Sdk.Web">
2+
<Project Sdk="Microsoft.NET.Sdk.WebAssembly">
33
<PropertyGroup>
44
<TargetFrameworks>$(NetWasmPreviousAndCurrent)</TargetFrameworks>
55
</PropertyGroup>
@@ -9,7 +9,7 @@
99
<PropertyGroup>
1010
<OutputType>Exe</OutputType>
1111
<DefineConstants>$(DefineConstants);__WASM__;HAS_UNO;UNO_REFERENCE_API</DefineConstants>
12-
<NoWarn>$(NoWarn);NU1701;CS1998;NU1504;UXAML0002</NoWarn>
12+
<NoWarn>$(NoWarn);NU1701;CS1998;NU1504;UXAML0002;NU1903;NU1902;IL2026;IL2072;IL2067;IL2075;IL2070;IL2077;IL2057</NoWarn>
1313
<IsUiAutomationMappingEnabled>true</IsUiAutomationMappingEnabled>
1414
<UseUnoXamlParser>true</UseUnoXamlParser>
1515
<UnoRuntimeIdentifier>WebAssembly</UnoRuntimeIdentifier>

src/SourceGenerators/Uno.UI.Tasks/Content/uno.ui.tasks.assets.targets

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,13 +107,21 @@
107107
</ItemGroup>
108108
</Target>
109109

110+
<PropertyGroup>
111+
<_UnoAddLibraryAssetsBeforeTargets>
112+
$(_UnoAddLibraryAssetsBeforeTargets);
113+
GetCopyToOutputDirectoryItems;
114+
GenerateUnoWasmAssets;
115+
</_UnoAddLibraryAssetsBeforeTargets>
116+
</PropertyGroup>
117+
110118
<!--
111119
Populate output groups when building heads
112120
-->
113121
<Target Name="_UnoAddLibraryAssets"
114122
Condition="'$(IsUnoHead)'=='true' or '$(AndroidApplication)'=='true' or '$(ProjectTypeGuids)'!=''"
115123
DependsOnTargets="_UnoFindPackageAssetMarkers"
116-
BeforeTargets="GetCopyToOutputDirectoryItems">
124+
BeforeTargets="$(_UnoAddLibraryAssetsBeforeTargets)">
117125

118126
<ExpandPackageAssets_v0 MarkerFiles="@(_UnoPriFiles)">
119127
<Output TaskParameter="Assets" ItemName="_UnoAssetsFilesExpanded" />

src/Uno.Sdk/Sdk/Sdk.props

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,14 @@ Copyright (C) Uno Platform Inc. All rights reserved.
1414
<!-- Legacy Project System Support -->
1515
<_DefaultMicrosoftNETSdk Condition="$(SingleProject) != 'true' AND $(UnoSingleProject) != 'true' AND ($(MSBuildProjectName.EndsWith('.Wasm')) or $(MSBuildProjectName.EndsWith('.WebAssembly')))">Microsoft.NET.Sdk.Web</_DefaultMicrosoftNETSdk>
1616

17-
<_DefaultMicrosoftNETSdk Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'browserwasm'" >Microsoft.NET.Sdk.Web</_DefaultMicrosoftNETSdk>
17+
<_UnoUseMicrosoftNETSdkWebAssembly Condition="
18+
$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'browserwasm'
19+
AND $([MSBuild]::GetTargetFrameworkVersion('$(TargetFramework)')) &lt; 9.0
20+
">true</_UnoUseMicrosoftNETSdkWebAssembly>
21+
22+
<_DefaultMicrosoftNETSdk Condition=" '$(_UnoUseMicrosoftNETSdkWebAssembly)' == '' ">Microsoft.NET.Sdk.Web</_DefaultMicrosoftNETSdk>
23+
<_DefaultMicrosoftNETSdk Condition=" '$(_UnoUseMicrosoftNETSdkWebAssembly)' == 'true' " >Microsoft.NET.Sdk.WebAssembly</_DefaultMicrosoftNETSdk>
24+
1825
<_DefaultMicrosoftNETSdk Condition=" $(_DefaultMicrosoftNETSdk) == '' ">Microsoft.NET.Sdk</_DefaultMicrosoftNETSdk>
1926

2027
<_DefaultWasmOutputType Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'browserwasm'">$(OutputType)</_DefaultWasmOutputType>
@@ -73,7 +80,7 @@ Copyright (C) Uno Platform Inc. All rights reserved.
7380
VS to read the global properties and avoid showing a yellow icon being the result of a mismatch
7481
between runs of design-time builds (one build defining a FrameworkReference and another one not).
7582
-->
76-
<ItemGroup>
83+
<ItemGroup Condition=" '$(_UnoUseMicrosoftNETSdkWebAssembly)' == 'false' ">
7784
<FrameworkReference Remove="Microsoft.AspNetCore.App" />
7885
</ItemGroup>
7986
</Project>

0 commit comments

Comments
 (0)