Browse Source

Fix ControlCatalog.Web build

Benedikt Stebner 3 years ago
parent
commit
ff3fe479b1

+ 29 - 13
samples/ControlCatalog.Web/ControlCatalog.Web.csproj

@@ -1,15 +1,14 @@
 <Project Sdk="Microsoft.NET.Sdk.BlazorWebAssembly">
 <Project Sdk="Microsoft.NET.Sdk.BlazorWebAssembly">
   <PropertyGroup>
   <PropertyGroup>
     <TargetFramework>net6.0</TargetFramework>
     <TargetFramework>net6.0</TargetFramework>
-    <MSBuildEnableWorkloadResolver>false</MSBuildEnableWorkloadResolver>
     <Nullable>enable</Nullable>
     <Nullable>enable</Nullable>
-    <WasmBuildNative>True</WasmBuildNative>
+    <!--Temporal hack that fixes compilation in VS-->
+    <TypeScriptCompileBlocked>true</TypeScriptCompileBlocked>
+    <EmccTotalMemory>16777216</EmccTotalMemory>
+    <BlazorEnableTimeZoneSupport>false</BlazorEnableTimeZoneSupport>
+    <BlazorWebAssemblyPreserveCollationData>false</BlazorWebAssemblyPreserveCollationData>
   </PropertyGroup>
   </PropertyGroup>
 
 
-  <ItemGroup>
-    <BlazorLinkerDescriptor Include="LinkerConfig.xml" />
-  </ItemGroup>
-
   <!-- In debug, make builds faster by reducing optimizations -->
   <!-- In debug, make builds faster by reducing optimizations -->
   <PropertyGroup Condition="'$(Configuration)' == 'Debug'">
   <PropertyGroup Condition="'$(Configuration)' == 'Debug'">
     <WasmNativeStrip>false</WasmNativeStrip>
     <WasmNativeStrip>false</WasmNativeStrip>
@@ -23,19 +22,36 @@
     <EmccCompileOptimizationFlag>-O3</EmccCompileOptimizationFlag>
     <EmccCompileOptimizationFlag>-O3</EmccCompileOptimizationFlag>
     <EmccLinkOptimizationFlag>-O3</EmccLinkOptimizationFlag>
     <EmccLinkOptimizationFlag>-O3</EmccLinkOptimizationFlag>
     <RunAOTCompilation>false</RunAOTCompilation>
     <RunAOTCompilation>false</RunAOTCompilation>
+    <DebuggerSupport>false</DebuggerSupport>
+    <EnableUnsafeBinaryFormatterSerialization>false</EnableUnsafeBinaryFormatterSerialization>
+    <EnableUnsafeUTF7Encoding>false</EnableUnsafeUTF7Encoding>
+    <EventSourceSupport>false</EventSourceSupport>
+    <HttpActivityPropagationSupport>false</HttpActivityPropagationSupport>
+    <InvariantGlobalization>true</InvariantGlobalization>
+    <MetadataUpdaterSupport>false</MetadataUpdaterSupport>
+    <UseNativeHttpHandler>true</UseNativeHttpHandler>
+    <UseSystemResourceKeys>true</UseSystemResourceKeys>
+    <PublishTrimmed>true</PublishTrimmed>
+    <TrimMode>link</TrimMode>
+    <TrimmerRemoveSymbols>true</TrimmerRemoveSymbols>
   </PropertyGroup>
   </PropertyGroup>
 
 
   <ItemGroup>
   <ItemGroup>
-    <PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly" Version="6.0.0"/>
-    <PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly.DevServer" Version="6.0.0" PrivateAssets="all"/>
+    <PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly" Version="6.0.0" />
+    <PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly.DevServer" Version="6.0.0" PrivateAssets="all" />
   </ItemGroup>
   </ItemGroup>
 
 
-  <Import Project="..\..\src\Web\Avalonia.Web.Blazor\Avalonia.Web.Blazor.targets" />
-  <Import Project="..\..\src\Web\Avalonia.Web.Blazor\Avalonia.Web.Blazor.CompilationTuning.props" />
-
   <ItemGroup>
   <ItemGroup>
-    <ProjectReference Include="..\..\src\Web\Avalonia.Web.Blazor\Avalonia.Web.Blazor.csproj"/>
-    <ProjectReference Include="..\ControlCatalog\ControlCatalog.csproj"/>
+    <ProjectReference Include="..\..\src\Skia\Avalonia.Skia\Avalonia.Skia.csproj" />
+    <ProjectReference Include="..\..\src\Web\Avalonia.Web.Blazor\Avalonia.Web.Blazor.csproj" />
+    <ProjectReference Include="..\ControlCatalog\ControlCatalog.csproj" />
   </ItemGroup>
   </ItemGroup>
 
 
+  <Import Project="..\..\build\ReferenceCoreLibraries.props" />
+  <Import Project="..\..\build\BuildTargets.targets" />
+
+  <Import Project="..\..\src\Web\Avalonia.Web.Blazor\Avalonia.Web.Blazor.targets" />
+  <Import Project="..\..\src\Web\Avalonia.Web.Blazor\Avalonia.Web.Blazor.CompilationTuning.props" />
+
 </Project>
 </Project>
+

+ 0 - 28
samples/ControlCatalog.Web/LinkerConfig.xml

@@ -1,28 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" ?>
-<!--
-  This file specifies which parts of the BCL or Blazor packages must not be
-  stripped by the IL Linker even if they aren't referenced by user code.
--->
-<linker>
-  <assembly fullname="mscorlib">
-    <!--
-      Preserve the methods in WasmRuntime because its methods are called by 
-      JavaScript client-side code to implement timers.
-      Fixes: https://github.com/dotnet/blazor/issues/239
-    -->
-    <type fullname="System.Threading.WasmRuntime"/>
-  </assembly>
-
-  <assembly fullname="System.Core">
-    <!--
-      System.Linq.Expressions* is required by Json.NET and any 
-      expression.Compile caller. The assembly isn't stripped.
-    -->
-    <type fullname="System.Linq.Expressions*"/>
-  </assembly>
-  <!--
-    In this example, the app's entry point assembly is listed. The assembly
-    isn't stripped by the IL Linker.
-  -->
-  <assembly fullname="ControlCatalog" preserve="All" />
-</linker>