From 15617705060ff75a1a00d1985450dc006d4c5050 Mon Sep 17 00:00:00 2001 From: Larry Ewing Date: Fri, 30 Apr 2021 19:28:54 -0500 Subject: [PATCH] [wasm] Port additional fixes in #52078 main (#52125) * Port additional fixes in #52078 main * Update src/tasks/AotCompilerTask/MonoAOTCompiler.csproj Co-authored-by: Daniel Plaisted * Update src/tasks/WasmAppBuilder/WasmAppBuilder.csproj Co-authored-by: Daniel Plaisted * Update src/tasks/WasmAppBuilder/WasmAppBuilder.csproj Co-authored-by: Daniel Plaisted * Apply suggestions from code review Co-authored-by: Daniel Plaisted * Use a property for net472 * Use consistent separator character Co-authored-by: Adeel Mujahid <3840695+am11@users.noreply.github.com> Co-authored-by: Ankit Jain Co-authored-by: Daniel Plaisted Co-authored-by: Adeel Mujahid <3840695+am11@users.noreply.github.com> --- .../AotCompilerTask/MonoAOTCompiler.csproj | 4 +-- src/tasks/Common/IsExternalInit.cs | 7 +++++ src/tasks/Common/NotNullAttribute.cs | 7 ----- src/tasks/Directory.Build.props | 7 +++++ src/tasks/WasmAppBuilder/WasmAppBuilder.cs | 4 +-- .../WasmAppBuilder/WasmAppBuilder.csproj | 27 ++++++++++--------- 6 files changed, 32 insertions(+), 24 deletions(-) create mode 100644 src/tasks/Common/IsExternalInit.cs delete mode 100644 src/tasks/Common/NotNullAttribute.cs create mode 100644 src/tasks/Directory.Build.props diff --git a/src/tasks/AotCompilerTask/MonoAOTCompiler.csproj b/src/tasks/AotCompilerTask/MonoAOTCompiler.csproj index e4e889fb8c2..1538b0669b9 100644 --- a/src/tasks/AotCompilerTask/MonoAOTCompiler.csproj +++ b/src/tasks/AotCompilerTask/MonoAOTCompiler.csproj @@ -1,6 +1,6 @@ - $(NetCoreAppToolCurrent);net472 + $(NetCoreAppToolCurrent);$(TargetFrameworkForNETFramework) Library true false @@ -19,7 +19,7 @@ - + diff --git a/src/tasks/Common/IsExternalInit.cs b/src/tasks/Common/IsExternalInit.cs new file mode 100644 index 00000000000..d7be6913103 --- /dev/null +++ b/src/tasks/Common/IsExternalInit.cs @@ -0,0 +1,7 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +namespace System.Runtime.CompilerServices +{ + internal sealed class IsExternalInit { } +} diff --git a/src/tasks/Common/NotNullAttribute.cs b/src/tasks/Common/NotNullAttribute.cs deleted file mode 100644 index 3d9af5228ca..00000000000 --- a/src/tasks/Common/NotNullAttribute.cs +++ /dev/null @@ -1,7 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -[System.AttributeUsage(System.AttributeTargets.Field | System.AttributeTargets.Parameter | System.AttributeTargets.Property | System.AttributeTargets.ReturnValue, Inherited=false)] -public sealed class NotNullAttribute : System.Attribute -{ -} diff --git a/src/tasks/Directory.Build.props b/src/tasks/Directory.Build.props new file mode 100644 index 00000000000..7ed8a459d2f --- /dev/null +++ b/src/tasks/Directory.Build.props @@ -0,0 +1,7 @@ + + + + + net472 + + diff --git a/src/tasks/WasmAppBuilder/WasmAppBuilder.cs b/src/tasks/WasmAppBuilder/WasmAppBuilder.cs index a8a8b1ebee3..9ef7679c292 100644 --- a/src/tasks/WasmAppBuilder/WasmAppBuilder.cs +++ b/src/tasks/WasmAppBuilder/WasmAppBuilder.cs @@ -86,9 +86,9 @@ public class WasmAppBuilder : Task Behavior = behavior; } [JsonPropertyName("behavior")] - public string Behavior { get; set; } + public string Behavior { get; init; } [JsonPropertyName("name")] - public string Name { get; set; } + public string Name { get; init; } } private class AssemblyEntry : AssetEntry diff --git a/src/tasks/WasmAppBuilder/WasmAppBuilder.csproj b/src/tasks/WasmAppBuilder/WasmAppBuilder.csproj index aa5f258b45a..e7641b3ab1a 100644 --- a/src/tasks/WasmAppBuilder/WasmAppBuilder.csproj +++ b/src/tasks/WasmAppBuilder/WasmAppBuilder.csproj @@ -1,15 +1,19 @@ - $(NetCoreAppToolCurrent);net472 + $(NetCoreAppToolCurrent);$(TargetFrameworkForNETFramework) enable $(NoWarn),CA1050 - $(NoWarn),CS8604,CS8602 + $(NoWarn),CS8604,CS8602 - - + + + + + + @@ -33,17 +37,14 @@ <_PublishFramework Include="$(TargetFrameworks)" /> - - + + - + -- 2.34.1