-
Notifications
You must be signed in to change notification settings - Fork 9
/
CalculatorComposed.csproj
29 lines (23 loc) · 1.47 KB
/
CalculatorComposed.csproj
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
<Project Sdk="Microsoft.NET.Sdk">
<!-- Only needed when referencing the dependencies as projects. For package references, these are imported automatically. -->
<Import Project="..\..\..\src\WasmComponent.Sdk\ImportInDev.proj" />
<!-- THIS IS NOT REALLY A .NET PROJECT -->
<!-- It's just a csproj that can be used to invoke the wasm tooling to compose the runnable component -->
<!-- and express a dependency on the two implementation components. -->
<PropertyGroup>
<TargetFramework>net9.0</TargetFramework>
</PropertyGroup>
<ItemGroup>
<ProjectReference Include="..\Adder\Adder.csproj" ReferenceOutputAssembly="false" />
<ProjectReference Include="..\CalculatorHost\CalculatorHost.csproj" ReferenceOutputAssembly="false" />
<PackageReference Include="runtime.$(NETCoreSdkPortableRuntimeIdentifier).Microsoft.DotNet.ILCompiler.LLVM"/>
</ItemGroup>
<Target Name="ComposeWasmComponent" AfterTargets="Publish">
<PropertyGroup>
<EntrypointComponent>../CalculatorHost/bin/$(Configuration)/$(TargetFramework)/wasi-wasm/native/CalculatorHost.wasm</EntrypointComponent>
<DependencyComponent>../Adder/bin/$(Configuration)/$(TargetFramework)/wasi-wasm/native/adder.wasm</DependencyComponent>
</PropertyGroup>
<MakeDir Directories="dist" />
<Exec Command="$(WacExe) plug $(EntrypointComponent) --plug $(DependencyComponent) -o dist/calculator.wasm" />
</Target>
</Project>