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

Wasm SDK packed as a nuget package #31519

Merged
merged 31 commits into from
Apr 21, 2023
Merged
Show file tree
Hide file tree
Changes from 12 commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
e7d2e81
Remove most of Wasm SDK bits
maraf Mar 29, 2023
cdcb032
Fix KnownWebAssemblySdkPacks in FrameworkReferenceResolution
maraf Mar 30, 2023
fd70e90
Import using overridable _WebAssemblyPropsFile and _WebAssemblyTarget…
maraf Mar 30, 2023
068259c
Move wasm tasks related tests to runtime. Leave BootJsonData related …
maraf Mar 31, 2023
fc77b96
Don't override existing RuntimeIdentifier in SDK.props. Pass UsingMic…
maraf Apr 3, 2023
f968538
Move BootJsonData for tests to tests project.
maraf Apr 3, 2023
0af6292
Rename KnownWebAssemblySdkPack to KnownWebAssemblySdkBrowserPack
maraf Apr 6, 2023
75b3431
Revert "Rename KnownWebAssemblySdkPack to KnownWebAssemblySdkBrowserP…
maraf Apr 6, 2023
5c0ee81
Drop check for RuntimeIdenfier.
maraf Apr 6, 2023
55638db
Localization
maraf Apr 6, 2023
a0fb290
Merge remote-tracking branch 'upstream/main' into WasmSdkPackaged
maraf Apr 10, 2023
7feef8d
UpdateXlf
maraf Apr 10, 2023
d29701c
Update SDK
maraf Apr 11, 2023
e46392e
Feedback
maraf Apr 11, 2023
767d13a
Remove local nuget source.
maraf Apr 11, 2023
a74062c
Merge remote-tracking branch 'upstream/main' into WasmSdkPackaged
maraf Apr 17, 2023
2545fea
Fix after merge with main
maraf Apr 17, 2023
56781d7
Update installer version
maraf Apr 18, 2023
775f314
Merge remote-tracking branch 'upstream/main' into WasmSdkPackaged
maraf Apr 19, 2023
79daf53
Dont fail when WasmPack is not found (= building older .NET project)
maraf Apr 19, 2023
e765c80
Fix property expression. UsingBlazorSdk is still probably needed.
maraf Apr 19, 2023
fcc5d48
[ToRevert] Temporarily hook Compression
maraf Apr 19, 2023
6f4c068
Merge remote-tracking branch 'upstream/main' into WasmSdkPackaged
maraf Apr 21, 2023
abef876
Update SDK
maraf Apr 21, 2023
b72464a
Revert "[ToRevert] Temporarily hook Compression"
maraf Apr 21, 2023
f4d0393
Force browser-wasm on BlazorWebAssemblySdk.
maraf Apr 21, 2023
17589c3
Force AppendRuntimeIdentifierToOutputPath on BlazorWebAssemblySdk.
maraf Apr 21, 2023
9a052a2
Force CopyOutputSymbolsToPublishDirectory on BlazorWebAssemblySdk.
maraf Apr 21, 2023
64f0e09
Update comment
maraf Apr 21, 2023
e56576a
bump the sdk
lewing Apr 21, 2023
916e183
Update dependencies from https://github.com/dotnet/sourcelink build 2…
dotnet-maestro[bot] Apr 21, 2023
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: 4 additions & 0 deletions src/Tasks/Common/Resources/Strings.resx
Original file line number Diff line number Diff line change
Expand Up @@ -896,4 +896,8 @@ You may need to build the project on another operating system or architecture, o
<value>NETSDK1198: A publish profile with the name '{0}' was not found in the project. Set the PublishProfile property to a valid file name.</value>
<comment>{StrBegin="NETSDK1198: "}</comment>
</data>
<data name="WebAssemblySdkNoValidRuntimePackageError" xml:space="preserve">
<value>NETSDK1199: Unable to build a WebAssembly application: a valid WebAssembly SDK package was not found.</value>
<comment>{StrBegin="NETSDK1199: "}</comment>
</data>
</root>
5 changes: 5 additions & 0 deletions src/Tasks/Common/Resources/xlf/Strings.cs.xlf
Original file line number Diff line number Diff line change
Expand Up @@ -942,6 +942,11 @@ The following are names of parameters or literal values and should not be transl
<target state="translated">NETSDK1057: Používáte verzi Preview rozhraní .NET. Viz: https://aka.ms/dotnet-support-policy</target>
<note />
</trans-unit>
<trans-unit id="WebAssemblySdkNoValidRuntimePackageError">
<source>NETSDK1199: Unable to build a WebAssembly application: a valid WebAssembly SDK package was not found.</source>
<target state="new">NETSDK1199: Unable to build a WebAssembly application: a valid WebAssembly SDK package was not found.</target>
<note>{StrBegin="NETSDK1199: "}</note>
</trans-unit>
<trans-unit id="WinMDObjNotSupportedOnTargetFramework">
<source>NETSDK1131: Producing a managed Windows Metadata component with WinMDExp is not supported when targeting {0}.</source>
<target state="translated">NETSDK1131: Vytvoření spravované komponenty Metadata Windows s WinMDExp se při cílení na {0} nepodporuje.</target>
Expand Down
5 changes: 5 additions & 0 deletions src/Tasks/Common/Resources/xlf/Strings.de.xlf
Original file line number Diff line number Diff line change
Expand Up @@ -942,6 +942,11 @@ The following are names of parameters or literal values and should not be transl
<target state="new">NETSDK1057: You are using a preview version of .NET. See: https://aka.ms/dotnet-support-policy</target>
<note />
</trans-unit>
<trans-unit id="WebAssemblySdkNoValidRuntimePackageError">
<source>NETSDK1199: Unable to build a WebAssembly application: a valid WebAssembly SDK package was not found.</source>
<target state="new">NETSDK1199: Unable to build a WebAssembly application: a valid WebAssembly SDK package was not found.</target>
<note>{StrBegin="NETSDK1199: "}</note>
</trans-unit>
<trans-unit id="WinMDObjNotSupportedOnTargetFramework">
<source>NETSDK1131: Producing a managed Windows Metadata component with WinMDExp is not supported when targeting {0}.</source>
<target state="new">NETSDK1131: Producing a managed Windows Metadata component with WinMDExp is not supported when targeting {0}.</target>
Expand Down
5 changes: 5 additions & 0 deletions src/Tasks/Common/Resources/xlf/Strings.es.xlf
Original file line number Diff line number Diff line change
Expand Up @@ -942,6 +942,11 @@ The following are names of parameters or literal values and should not be transl
<target state="translated">NETSDK1057: Está usando una versión preliminar de .NET. Visite: https://aka.ms/dotnet-support-policy</target>
<note />
</trans-unit>
<trans-unit id="WebAssemblySdkNoValidRuntimePackageError">
<source>NETSDK1199: Unable to build a WebAssembly application: a valid WebAssembly SDK package was not found.</source>
<target state="new">NETSDK1199: Unable to build a WebAssembly application: a valid WebAssembly SDK package was not found.</target>
<note>{StrBegin="NETSDK1199: "}</note>
</trans-unit>
<trans-unit id="WinMDObjNotSupportedOnTargetFramework">
<source>NETSDK1131: Producing a managed Windows Metadata component with WinMDExp is not supported when targeting {0}.</source>
<target state="translated">NETSDK1131: No se admite la generación de un componente administrado de metadatos de Windows con WinMDExp cuando el destino es {0}.</target>
Expand Down
5 changes: 5 additions & 0 deletions src/Tasks/Common/Resources/xlf/Strings.fr.xlf
Original file line number Diff line number Diff line change
Expand Up @@ -942,6 +942,11 @@ The following are names of parameters or literal values and should not be transl
<target state="translated">NETSDK1057 : vous utilisez une version d'aperçu de .NET. Voir : https://aka.ms/dotnet-support-policy</target>
<note />
</trans-unit>
<trans-unit id="WebAssemblySdkNoValidRuntimePackageError">
<source>NETSDK1199: Unable to build a WebAssembly application: a valid WebAssembly SDK package was not found.</source>
<target state="new">NETSDK1199: Unable to build a WebAssembly application: a valid WebAssembly SDK package was not found.</target>
<note>{StrBegin="NETSDK1199: "}</note>
</trans-unit>
<trans-unit id="WinMDObjNotSupportedOnTargetFramework">
<source>NETSDK1131: Producing a managed Windows Metadata component with WinMDExp is not supported when targeting {0}.</source>
<target state="translated">NETSDK1131: la production d'un composant de métadonnées Windows managé avec WinMDExp n'est pas prise en charge pour le ciblage de {0}.</target>
Expand Down
5 changes: 5 additions & 0 deletions src/Tasks/Common/Resources/xlf/Strings.it.xlf
Original file line number Diff line number Diff line change
Expand Up @@ -942,6 +942,11 @@ The following are names of parameters or literal values and should not be transl
<target state="translated">NETSDK1057: si sta usando una versione in anteprima di .NET. Vedere https://aka.ms/dotnet-support-policy</target>
<note />
</trans-unit>
<trans-unit id="WebAssemblySdkNoValidRuntimePackageError">
<source>NETSDK1199: Unable to build a WebAssembly application: a valid WebAssembly SDK package was not found.</source>
<target state="new">NETSDK1199: Unable to build a WebAssembly application: a valid WebAssembly SDK package was not found.</target>
<note>{StrBegin="NETSDK1199: "}</note>
</trans-unit>
<trans-unit id="WinMDObjNotSupportedOnTargetFramework">
<source>NETSDK1131: Producing a managed Windows Metadata component with WinMDExp is not supported when targeting {0}.</source>
<target state="translated">NETSDK1131: la produzione di un componente Metadati Windows gestito con WinMDExp non è supportata quando la destinazione è {0}.</target>
Expand Down
5 changes: 5 additions & 0 deletions src/Tasks/Common/Resources/xlf/Strings.ja.xlf
Original file line number Diff line number Diff line change
Expand Up @@ -942,6 +942,11 @@ The following are names of parameters or literal values and should not be transl
<target state="translated">NETSDK1057: プレビュー版の .NET を使用しています。https://aka.ms/dotnet-support-policy をご覧ください</target>
<note />
</trans-unit>
<trans-unit id="WebAssemblySdkNoValidRuntimePackageError">
<source>NETSDK1199: Unable to build a WebAssembly application: a valid WebAssembly SDK package was not found.</source>
<target state="new">NETSDK1199: Unable to build a WebAssembly application: a valid WebAssembly SDK package was not found.</target>
<note>{StrBegin="NETSDK1199: "}</note>
</trans-unit>
<trans-unit id="WinMDObjNotSupportedOnTargetFramework">
<source>NETSDK1131: Producing a managed Windows Metadata component with WinMDExp is not supported when targeting {0}.</source>
<target state="translated">NETSDK1131: {0} をターゲットにする場合、WinMDExp を使用したマネージド Windows メタデータ コンポーネント生成はサポートされていません。</target>
Expand Down
5 changes: 5 additions & 0 deletions src/Tasks/Common/Resources/xlf/Strings.ko.xlf
Original file line number Diff line number Diff line change
Expand Up @@ -942,6 +942,11 @@ The following are names of parameters or literal values and should not be transl
<target state="new">NETSDK1057: You are using a preview version of .NET. See: https://aka.ms/dotnet-support-policy</target>
<note />
</trans-unit>
<trans-unit id="WebAssemblySdkNoValidRuntimePackageError">
<source>NETSDK1199: Unable to build a WebAssembly application: a valid WebAssembly SDK package was not found.</source>
<target state="new">NETSDK1199: Unable to build a WebAssembly application: a valid WebAssembly SDK package was not found.</target>
<note>{StrBegin="NETSDK1199: "}</note>
</trans-unit>
<trans-unit id="WinMDObjNotSupportedOnTargetFramework">
<source>NETSDK1131: Producing a managed Windows Metadata component with WinMDExp is not supported when targeting {0}.</source>
<target state="new">NETSDK1131: Producing a managed Windows Metadata component with WinMDExp is not supported when targeting {0}.</target>
Expand Down
5 changes: 5 additions & 0 deletions src/Tasks/Common/Resources/xlf/Strings.pl.xlf
Original file line number Diff line number Diff line change
Expand Up @@ -942,6 +942,11 @@ The following are names of parameters or literal values and should not be transl
<target state="new">NETSDK1057: You are using a preview version of .NET. See: https://aka.ms/dotnet-support-policy</target>
<note />
</trans-unit>
<trans-unit id="WebAssemblySdkNoValidRuntimePackageError">
<source>NETSDK1199: Unable to build a WebAssembly application: a valid WebAssembly SDK package was not found.</source>
<target state="new">NETSDK1199: Unable to build a WebAssembly application: a valid WebAssembly SDK package was not found.</target>
<note>{StrBegin="NETSDK1199: "}</note>
</trans-unit>
<trans-unit id="WinMDObjNotSupportedOnTargetFramework">
<source>NETSDK1131: Producing a managed Windows Metadata component with WinMDExp is not supported when targeting {0}.</source>
<target state="new">NETSDK1131: Producing a managed Windows Metadata component with WinMDExp is not supported when targeting {0}.</target>
Expand Down
5 changes: 5 additions & 0 deletions src/Tasks/Common/Resources/xlf/Strings.pt-BR.xlf
Original file line number Diff line number Diff line change
Expand Up @@ -942,6 +942,11 @@ The following are names of parameters or literal values and should not be transl
<target state="translated">NETSDK1057: Você está usando uma versão de visualização do .NET. Veja: https://aka.ms/dotnet-support-policy</target>
<note />
</trans-unit>
<trans-unit id="WebAssemblySdkNoValidRuntimePackageError">
<source>NETSDK1199: Unable to build a WebAssembly application: a valid WebAssembly SDK package was not found.</source>
<target state="new">NETSDK1199: Unable to build a WebAssembly application: a valid WebAssembly SDK package was not found.</target>
<note>{StrBegin="NETSDK1199: "}</note>
</trans-unit>
<trans-unit id="WinMDObjNotSupportedOnTargetFramework">
<source>NETSDK1131: Producing a managed Windows Metadata component with WinMDExp is not supported when targeting {0}.</source>
<target state="translated">NETSDK1131: não há suporte para a produção de um componente de Metadados do Windows gerenciado com o WinMDExp ao direcionar ao {0}.</target>
Expand Down
5 changes: 5 additions & 0 deletions src/Tasks/Common/Resources/xlf/Strings.ru.xlf
Original file line number Diff line number Diff line change
Expand Up @@ -942,6 +942,11 @@ The following are names of parameters or literal values and should not be transl
<target state="translated">NETSDK1057: Вы используете предварительную версию .NET. Дополнительные сведения см. на странице https://aka.ms/dotnet-support-policy</target>
<note />
</trans-unit>
<trans-unit id="WebAssemblySdkNoValidRuntimePackageError">
<source>NETSDK1199: Unable to build a WebAssembly application: a valid WebAssembly SDK package was not found.</source>
<target state="new">NETSDK1199: Unable to build a WebAssembly application: a valid WebAssembly SDK package was not found.</target>
<note>{StrBegin="NETSDK1199: "}</note>
</trans-unit>
<trans-unit id="WinMDObjNotSupportedOnTargetFramework">
<source>NETSDK1131: Producing a managed Windows Metadata component with WinMDExp is not supported when targeting {0}.</source>
<target state="translated">NETSDK1131: создание управляемого компонента метаданных Windows с WinMDExp не поддерживается при нацеливании на {0}.</target>
Expand Down
5 changes: 5 additions & 0 deletions src/Tasks/Common/Resources/xlf/Strings.tr.xlf
Original file line number Diff line number Diff line change
Expand Up @@ -942,6 +942,11 @@ The following are names of parameters or literal values and should not be transl
<target state="translated">NETSDK1057: Bir .NET önizleme sürümü kullanıyorsunuz. Bkz. https://aka.ms/dotnet-support-policy</target>
<note />
</trans-unit>
<trans-unit id="WebAssemblySdkNoValidRuntimePackageError">
<source>NETSDK1199: Unable to build a WebAssembly application: a valid WebAssembly SDK package was not found.</source>
<target state="new">NETSDK1199: Unable to build a WebAssembly application: a valid WebAssembly SDK package was not found.</target>
<note>{StrBegin="NETSDK1199: "}</note>
</trans-unit>
<trans-unit id="WinMDObjNotSupportedOnTargetFramework">
<source>NETSDK1131: Producing a managed Windows Metadata component with WinMDExp is not supported when targeting {0}.</source>
<target state="translated">NETSDK1131: {0} hedeflenirken, WinMDExp ile yönetilen bir Windows Meta Veri bileşeninin üretilmesi desteklenmiyor.</target>
Expand Down
5 changes: 5 additions & 0 deletions src/Tasks/Common/Resources/xlf/Strings.zh-Hans.xlf
Original file line number Diff line number Diff line change
Expand Up @@ -942,6 +942,11 @@ The following are names of parameters or literal values and should not be transl
<target state="translated">NETSDK1057: 你正在使用 .NET 的预览版。请参阅 https://aka.ms/dotnet-support-policy</target>
<note />
</trans-unit>
<trans-unit id="WebAssemblySdkNoValidRuntimePackageError">
<source>NETSDK1199: Unable to build a WebAssembly application: a valid WebAssembly SDK package was not found.</source>
<target state="new">NETSDK1199: Unable to build a WebAssembly application: a valid WebAssembly SDK package was not found.</target>
<note>{StrBegin="NETSDK1199: "}</note>
</trans-unit>
<trans-unit id="WinMDObjNotSupportedOnTargetFramework">
<source>NETSDK1131: Producing a managed Windows Metadata component with WinMDExp is not supported when targeting {0}.</source>
<target state="translated">NETSDK1131: 当目标为 {0} 时,不支持使用 WinMDExp 生成托管 Windows 元数据组件。</target>
Expand Down
5 changes: 5 additions & 0 deletions src/Tasks/Common/Resources/xlf/Strings.zh-Hant.xlf
Original file line number Diff line number Diff line change
Expand Up @@ -942,6 +942,11 @@ The following are names of parameters or literal values and should not be transl
<target state="translated">NETSDK1057: 您目前使用的是 .NET 預覽版。請參閱: https://aka.ms/dotnet-support-policy</target>
<note />
</trans-unit>
<trans-unit id="WebAssemblySdkNoValidRuntimePackageError">
<source>NETSDK1199: Unable to build a WebAssembly application: a valid WebAssembly SDK package was not found.</source>
<target state="new">NETSDK1199: Unable to build a WebAssembly application: a valid WebAssembly SDK package was not found.</target>
<note>{StrBegin="NETSDK1199: "}</note>
</trans-unit>
<trans-unit id="WinMDObjNotSupportedOnTargetFramework">
<source>NETSDK1131: Producing a managed Windows Metadata component with WinMDExp is not supported when targeting {0}.</source>
<target state="translated">NETSDK1131: 當目標為 {0} 時,無法使用 WinMDExp 產生受控 Windows 中繼資料元件。</target>
Expand Down
21 changes: 18 additions & 3 deletions src/Tasks/Microsoft.NET.Build.Tasks/ProcessFrameworkReferences.cs
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,10 @@ public class ProcessFrameworkReferences : TaskBase

public ITaskItem[] KnownILLinkPacks { get; set; } = Array.Empty<ITaskItem>();

public ITaskItem[] KnownWebAssemblySdkPacks { get; set; } = Array.Empty<ITaskItem>();

public bool UsingMicrosoftNETSdkWebAssembly { get; set; }

[Required]
public string NETCoreSdkRuntimeIdentifier { get; set; }

Expand Down Expand Up @@ -387,6 +391,15 @@ var runtimeRequiredByDeployment
}
}

if (UsingMicrosoftNETSdkWebAssembly)
{
if (!AddToolPack(ToolPackType.WebAssemblySdk, _normalizedTargetFrameworkVersion, packagesToDownload, implicitPackageReferences))
{
Log.LogError(Strings.WebAssemblySdkNoValidRuntimePackageError);
return;
}
}

if (packagesToDownload.Any())
{
PackagesToDownload = packagesToDownload.Distinct(new PackageToDownloadComparer<ITaskItem>()).ToArray();
Expand Down Expand Up @@ -594,7 +607,8 @@ private enum ToolPackType
{
Crossgen2,
ILCompiler,
ILLink
ILLink,
WebAssemblySdk
}

private bool AddToolPack(
Expand All @@ -607,6 +621,7 @@ private bool AddToolPack(
ToolPackType.Crossgen2 => KnownCrossgen2Packs,
ToolPackType.ILCompiler => KnownILCompilerPacks,
ToolPackType.ILLink => KnownILLinkPacks,
ToolPackType.WebAssemblySdk => KnownWebAssemblySdkPacks,
_ => throw new ArgumentException($"Unknown package type {toolPackType}", nameof(toolPackType))
};

Expand Down Expand Up @@ -688,13 +703,13 @@ private bool AddToolPack(
}

// ILCompiler and ILLink have RID-agnostic build packages that contain MSBuild targets.
if (toolPackType is ToolPackType.ILCompiler or ToolPackType.ILLink)
if (toolPackType is ToolPackType.ILCompiler or ToolPackType.ILLink or ToolPackType.WebAssemblySdk)
maraf marked this conversation as resolved.
Show resolved Hide resolved
{
var buildPackageName = knownPack.ItemSpec;
var buildPackage = new TaskItem(buildPackageName);
buildPackage.SetMetadata(MetadataKeys.Version, packVersion);
implicitPackageReferences.Add(buildPackage);
}
}

return true;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,8 @@ Copyright (c) .NET Foundation. All rights reserved.
KnownCrossgen2Packs="@(KnownCrossgen2Pack)"
KnownILCompilerPacks="@(KnownILCompilerPack)"
KnownILLinkPacks="@(KnownILLinkPack)"
KnownWebAssemblySdkPacks="@(KnownWebAssemblySdkPack)"
UsingMicrosoftNETSdkWebAssembly="$(UsingMicrosoftNETSdkWebAssembly)"
NETCoreSdkRuntimeIdentifier="$(NETCoreSdkRuntimeIdentifier)"
NetCoreRoot="$(NetCoreRoot)"
NETCoreSdkVersion="$(NETCoreSdkVersion)">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
</ItemGroup>

<ItemGroup>
<Compile Include="..\Microsoft.NET.Sdk.BlazorWebAssembly.Tests\BootJsonData.cs" Link="BootJsonData.cs" />
<Compile Include="..\Microsoft.NET.Sdk.BlazorWebAssembly.Tests\WasmPublishIntegrationTestBase.cs" Link="WasmPublishIntegrationTestBase.cs" />
<Compile Include="..\Microsoft.NET.Sdk.BlazorWebAssembly.Tests\ServiceWorkerAssert.cs" Link="ServiceWorkerAssert.cs" />
</ItemGroup>
Expand All @@ -51,7 +52,6 @@

<ItemGroup>
<ProjectReference Include="..\..\..\src\BlazorWasmSdk\Tasks\Microsoft.NET.Sdk.BlazorWebAssembly.Tasks.csproj" SkipGetTargetFrameworkProperties="true" />
<ProjectReference Include="..\..\..\src\WasmSdk\Tasks\Microsoft.NET.Sdk.WebAssembly.Tasks.csproj" SkipGetTargetFrameworkProperties="true" />
<ProjectReference Include="..\..\RazorSdk\Tasks\Microsoft.NET.Sdk.Razor.Tasks.csproj" />
<ProjectReference Include="..\Microsoft.NET.TestFramework\Microsoft.NET.TestFramework.csproj" />
</ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
using System.Runtime.Serialization;
using ResourceHashesByNameDictionary = System.Collections.Generic.Dictionary<string, string>;

// For test purposes only. Actual build time implementation lives in runtime repository with WasmSDK

namespace Microsoft.NET.Sdk.WebAssembly
{
#pragma warning disable IDE1006 // Naming Styles
Expand Down
Loading