-
Notifications
You must be signed in to change notification settings - Fork 55
/
Uno.Wasm.Bootstrap.targets
172 lines (142 loc) · 8.22 KB
/
Uno.Wasm.Bootstrap.targets
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
<Project>
<PropertyGroup>
<_packageBinaryPath>$(MSBuildThisFileDirectory)../tools/Uno.Wasm.Bootstrap.v0.dll</_packageBinaryPath>
<WasmShellTasksPath Condition="!Exists('$(_packageBinaryPath)')">$(MSBuildThisFileDirectory)../bin/$(Configuration)/netstandard2.0</WasmShellTasksPath>
<WasmShellTasksPath Condition="Exists('$(_packageBinaryPath)')">../tools</WasmShellTasksPath>
<WasmShellIndexHtmlPath Condition="!Exists('$(_packageBinaryPath)')">$(MSBuildThisFileDirectory)../Templates/index.html</WasmShellIndexHtmlPath>
<WasmShellIndexHtmlPath Condition="Exists('$(_packageBinaryPath)') and '$(WasmShellIndexHtmlPath)'==''">$(MSBuildThisFileDirectory)../tools/templates/index.html</WasmShellIndexHtmlPath>
<WasmShellMode Condition="'$(WasmShellMode)'==''">browser</WasmShellMode>
<MonoWasmRuntimeConfiguration Condition="'$(MonoWasmRuntimeConfiguration)'==''">release</MonoWasmRuntimeConfiguration>
<MonoRuntimeDebuggerEnabled Condition="'$(MonoRuntimeDebuggerEnabled)'==''">false</MonoRuntimeDebuggerEnabled>
<WasmShellILLinkerEnabled Condition="'$(WasmShellILLinkerEnabled)'==''">true</WasmShellILLinkerEnabled>
<WasmShellGenerateCompressedFiles Condition="'$(WasmShellGenerateCompressedFiles)'=='' and '$(Configuration)'=='Debug'">false</WasmShellGenerateCompressedFiles>
<WasmShellGenerateCompressedFiles Condition="'$(WasmShellGenerateCompressedFiles)'==''">true</WasmShellGenerateCompressedFiles>
<WasmShellBrotliCompressionQuality Condition="'$(WasmShellBrotliCompressionQuality)'==''">7</WasmShellBrotliCompressionQuality>
<!--
Set this variable to use custom debugger binaries instead of the files found
in the active mono-wasm folder.
-->
<!--<MonoRuntimeCustomDebuggerPath>$(MSBuildThisFileDirectory)CustomDebuggerProxy</MonoRuntimeCustomDebuggerPath>-->
<!--
Uncomment to enable custom linker path
<MonoRuntimeCustomLinkerPath>$(MSBuildThisFileDirectory)</MonoRuntimeCustomLinkerPath>
-->
<!--
Force all applicable references to be present in the ReferenceCopyLocalPaths property.
Otherwise, the ReferencePath property only contains reference assemblies if those are available.
-->
<CopyLocalLockFileAssemblies>true</CopyLocalLockFileAssemblies>
<!--
When using IISExpress with a standalone app, there's no point restarting IISExpress
after build. It slows things unnecessarily and breaks in-flight HTTP requests.
-->
<NoRestartServerOnBuild>true</NoRestartServerOnBuild>
<!-- Disable unwanted parts of the default publish process -->
<CopyBuildOutputToPublishDirectory>false</CopyBuildOutputToPublishDirectory>
<CopyOutputSymbolsToPublishDirectory>false</CopyOutputSymbolsToPublishDirectory>
<PreserveCompilationContext>false</PreserveCompilationContext>
<RazorCompileOnPublish>false</RazorCompileOnPublish>
<GenerateDependencyFile>false</GenerateDependencyFile>
<IsWebConfigTransformDisabled>true</IsWebConfigTransformDisabled>
<UnoWasmPublishDistDir>$(AssemblyName)\dist\</UnoWasmPublishDistDir>
<!-- Possible values: Interpreter, FullAOT, InterpreterAndAOT -->
<WasmShellMonoRuntimeExecutionMode Condition="'$(WasmShellMonoRuntimeExecutionMode)'==''">Interpreter</WasmShellMonoRuntimeExecutionMode>
<!-- Compatibility with previous version of the task using WasmShellEnableAOT -->
<WasmShellMonoRuntimeExecutionMode Condition="'$(WasmShellEnableAOT)'=='true'">FullAOT</WasmShellMonoRuntimeExecutionMode>
</PropertyGroup>
<ItemGroup>
<!-- Default compressed extensions when WasmShellGenerateCompressedFiles is enabled -->
<WasmShellCompressedExtension Include=".wasm"/>
<WasmShellCompressedExtension Include=".clr"/>
<WasmShellCompressedExtension Include=".js"/>
<WasmShellCompressedExtension Include=".css"/>
<WasmShellCompressedExtension Include=".html"/>
</ItemGroup>
<ItemGroup>
<UpToDateCheckInput Include="@(LinkerDescriptors)" />
<UpToDateCheckInput Include="@(LinkerDescriptor)" />
</ItemGroup>
<UsingTask AssemblyFile="$(WasmShellTasksPath)/Uno.Wasm.Bootstrap.v0.dll" TaskName="Uno.Wasm.Bootstrap.ShellTask_v0" />
<UsingTask AssemblyFile="$(WasmShellTasksPath)/Uno.Wasm.Bootstrap.v0.dll" TaskName="Uno.Wasm.Bootstrap.UnoInstallSDKTask_v0" />
<Target Name="_GenerateLinkerDescriptor" BeforeTargets="PrepareForBuild">
<!--
Use the LinkerDescriptor ItemGroup to generate
the proper linker description file name.
-->
<ItemGroup>
<LinkerDescriptor Include="@(LinkerDescriptors)"></LinkerDescriptor>
</ItemGroup>
<Error Condition="'@(LinkerDescriptor->Count())' > 1" Text="There cannot be multiple linker descriptor files." />
<ItemGroup>
<EmbeddedResource Include="@(LinkerDescriptor)">
<LogicalName>$(AssemblyName).xml</LogicalName>
<Visible>false</Visible>
</EmbeddedResource>
</ItemGroup>
<Message Importance="low" Text="Descriptor @(EmbeddedResource)" />
</Target>
<Target Name="BuildDist" AfterTargets="AfterBuild">
<ItemGroup>
<!-- Filter ReferenceCopyLocalPaths as it may contain pdbs as well -->
<_AssembliesForReferenceCopyLocalPaths Include="@(ReferenceCopyLocalPaths)"
Condition="'%(Extension)' == '.dll'" />
</ItemGroup>
<PropertyGroup>
<!-- Defined here because OutputPath is defined late -->
<WasmShellDistPath Condition="'$(WasmShellDistPath)'==''">$(OutputPath)/dist</WasmShellDistPath>
</PropertyGroup>
<UnoInstallSDKTask_v0
MonoWasmSDKUri="$(MonoWasmSDKUri)"
MonoWasmAOTSDKUri="$(MonoWasmAOTSDKUri)"
IsOSUnixLike="$([MSBuild]::IsOsUnixLike())"
MonoRuntimeExecutionMode="$(WasmShellMonoRuntimeExecutionMode)"
PackagerOverrideFolderPath="$(MSBuildThisFileDirectory)/packager"
MonoTempFolder="$(WasmShellMonoTempFolder)"
Assets="@(Content)">
<Output TaskParameter="SdkPath" PropertyName="_UnoMonoSdkPath" />
<Output TaskParameter="PackagerBinPath" PropertyName="_UnoMonoPackagerBinPath" />
<Output TaskParameter="PackagerProjectFile" PropertyName="_UnoMonoPackagerProjectFile" />
</UnoInstallSDKTask_v0>
<ShellTask_v0
CurrentProjectPath="$(MSBuildProjectDirectory)"
BuildTaskBasePath="$(MSBuildThisFileDirectory)"
Assembly="$(IntermediateOutputPath)$(TargetFileName)"
DistPath="$(WasmShellDistPath)"
BaseIntermediateOutputPath="$(BaseIntermediateOutputPath)"
IntermediateOutputPath="$(ProjectDir)$(IntermediateOutputPath)"
TargetFrameworkIdentifier="$(TargetFrameworkIdentifier)"
TargetFramework="$(TargetFramework)"
WasmShellMode="$(WasmShellMode)"
MonoWasmSDKPath="$(_UnoMonoSdkPath)"
PackagerBinPath="$(_UnoMonoPackagerBinPath)"
UseFileIntegrity="$(WashShellUseFileIntegrity)"
GeneratePrefetchHeaders="$(WashShellGeneratePrefetchHeaders)"
PWAManifestFile="$(WasmPWAManifestFile)"
IndexHtmlPath="$(WasmShellIndexHtmlPath)"
RuntimeConfiguration="$(MonoWasmRuntimeConfiguration)"
RuntimeDebuggerEnabled="$(MonoRuntimeDebuggerEnabled)"
CustomDebuggerPath="$(MonoRuntimeCustomDebuggerPath)"
CustomLinkerPath="$(MonoRuntimeCustomLinkerPath)"
MonoEnvironment="@(WasmShellMonoEnvironment)"
MonoRuntimeExecutionMode="$(WasmShellMonoRuntimeExecutionMode)"
MixedModeExcludedAssembly="@(MonoRuntimeMixedModeExcludedAssembly)"
ExtraEmccFlags="@(WasmShellExtraEmccFlags)"
MonoILLinker="$(WasmShellILLinkerEnabled)"
MonoTempFolder="$(WasmShellMonoTempFolder)"
GenerateCompressedFiles="$(WasmShellGenerateCompressedFiles)"
CompressedExtensions="@(WasmShellCompressedExtension)"
BrotliCompressionQuality="$(WasmShellBrotliCompressionQuality)"
EnableLongPathSupport="$(WasmShellEnableLongPathSupport)"
ForceUseWSL="$(WasmShellForceUseWSL)"
EnableEmccProfiling="$(WasmShellEnableEmccProfiling)"
Assets="@(Content)"
ReferencePath="@(_AssembliesForReferenceCopyLocalPaths)" />
</Target>
<Target Name="_CleanDist" BeforeTargets="Clean">
<ItemGroup>
<_DistFilesToDelete Include="$(OutputPath)dist\**" />
</ItemGroup>
<Delete Files="@(_DistFilesToDelete)" />
</Target>
<Import Project="Uno.Wasm.Bootstrap.Publish.targets"/>
</Project>