Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Infrarust Java Plugin (Wasm Component Model)

This project demonstrates how to create a Minecraft proxy plugin for Infrarust using Java and the WebAssembly Component Model (WASI P2).

Self-Contained Toolchain

This repository includes the necessary patched toolchain components to ensure a reproducible build:

  • tools/teavm-fermyon-m2.zip: A pre-packaged local Maven repository containing the Fermyon TeaVM fork (0.2.7-SNAPSHOT) with WASI support.
  • tools/wit-bindgen: The patched wit-bindgen binary (0e191cc) with Java/TeaVM backend support.
  • tools/wasi_snapshot_preview1.reactor.wasm: The WASI P1->P2 reactor adapter.

Prerequisites

  • Java 11 or 17
  • Maven
  • wasm-tools (automatically handled by GitHub Actions)

Building Locally

  1. Restore TeaVM Artifacts:

    mkdir -p ~/.m2/repository/com/fermyon
    unzip tools/teavm-fermyon-m2.zip -d ~/.m2/repository/com/fermyon/
  2. Run Build Script:

    ./build.sh

The output will be a Wasm Component at target/infrarust-plugin.wasm.

GitHub Actions

The repository includes a GitHub Actions workflow (.github/workflows/build.yml) that automatically builds the Wasm component on every push. It uses the pre-packaged TeaVM artifacts to ensure the build succeeds in a clean CI environment.

How it works

  1. WIT Bindings: We use the patched wit-bindgen binary included in tools/.
  2. TeaVM-WASI: We use the Fermyon fork of TeaVM which targets WASI P1.
  3. Component Conversion: We use wasm-tools with the local P1->P2 reactor adapter to convert the Core Wasm into a WASI P2 Component.

Implementation Notes

Currently, System.out.println is used for logging verification. In production, you should use the Infrarust Logging API defined in the WIT interfaces.

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages