Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
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
8 changes: 6 additions & 2 deletions console/Program.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
using System.Runtime.CompilerServices;
using System; // Console
using System.Net.Http; // HttpClient
using System.Threading; // Thread
using System.Threading.Tasks; // Task / async support
using System.Runtime.CompilerServices; // UnsafeAccessor

public static class WasiMainWrapper
{
Expand All @@ -11,7 +15,7 @@ public static async Task<int> MainAsync(string[] args)
var json = await client.GetStringAsync(query);
Console.WriteLine(json);

ExampleWorld.exports.ExampleWorld.Add(2, int.Parse(json));
// ExampleWorld.exports.ExampleWorld.Add(2, int.Parse(json));
return 0;
}

Expand Down
22 changes: 7 additions & 15 deletions console/console.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net9.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<TargetFramework>net10.0</TargetFramework>
<ImplicitUsings>disable</ImplicitUsings>
<Nullable>enable</Nullable>

<RuntimeIdentifier>wasi-wasm</RuntimeIdentifier>
Expand All @@ -14,23 +14,15 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="BytecodeAlliance.Componentize.DotNet.Wasm.SDK"
Version="0.4.0-preview00007" />
<!-- <PackageReference Include="BytecodeAlliance.Componentize.DotNet.Wasm.SDK"
Version="0.4.0-preview00007" /> -->
<PackageReference Include="BytecodeAlliance.Componentize.DotNet.Wasm.SDK" Version="0.7.0-preview00215" />
<PackageVersion Include="Microsoft.DotNet.ILCompiler.LLVM" Version="10.0.0-preview.2.25455.1" />
<PackageReference Include="runtime.win-x64.microsoft.dotnet.ilcompiler.llvm" Version="10.0.0-preview.2.25455.1" />
</ItemGroup>

<ItemGroup>
<Wit Include="adder.wit" />
</ItemGroup>

<Target Name="Dist" AfterTargets="Publish">
<MakeDir Directories="dist" />
<Copy SourceFiles="$(NativeOutputPath)$(MSBuildProjectName).wasm"
DestinationFolder="dist/" />
</Target>

<Target Name="ComposeWasmComponent" AfterTargets="Publish">
<MakeDir Directories="dist" />
<Exec
Command="wac.exe plug --plug ..\adder-wrapper\dist\composed.wasm $(NativeOutputPath)$(MSBuildProjectName).wasm -o dist/composed.wasm" />
</Target>
</Project>
1 change: 1 addition & 0 deletions console/nuget.config
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
<packageSources>
<!--To inherit the global NuGet package sources remove the <clear/> line below -->
<clear />
<add key="cataggar" value="https://nuget.pkg.github.com/cataggar/index.json" />
<add key="dotnet-experimental" value="https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-experimental/nuget/v3/index.json" />
<add key="nuget" value="https://api.nuget.org/v3/index.json" />
</packageSources>
Expand Down