From 261d4deb8d01aa53855cd8b2d4af5fef39c06b24 Mon Sep 17 00:00:00 2001 From: andreatp Date: Wed, 25 Mar 2026 12:58:33 +0000 Subject: [PATCH] Use chicory-compiler moduleInterface instead of annotation processor Replace the @WasmModuleInterface annotation approach with the new moduleInterface config in chicory-compiler-maven-plugin. This removes the need for annotations dependency, annotation processor, antrun plugin (wasm path normalization), templating plugin, and WasmResource java template. Co-Authored-By: Claude Opus 4.6 (1M context) --- core-common/pom.xml | 44 ++++--------------- .../protobuf4j/common/WasmResource.java | 7 --- .../protobuf4j/common/Protobuf.java | 2 - core-v3/pom.xml | 12 ----- core-v4/pom.xml | 12 ----- pom.xml | 15 ------- 6 files changed, 9 insertions(+), 83 deletions(-) delete mode 100644 core-common/src/main/java-templates/io/roastedroot/protobuf4j/common/WasmResource.java diff --git a/core-common/pom.xml b/core-common/pom.xml index c03546e..7fcaee7 100644 --- a/core-common/pom.xml +++ b/core-common/pom.xml @@ -15,11 +15,6 @@ Protobuf common support for protobuf4j - - com.dylibso.chicory - annotations - ${chicory.version} - com.dylibso.chicory wasi @@ -55,33 +50,24 @@ - org.apache.maven.plugins - maven-antrun-plugin + com.dylibso.chicory + chicory-compiler-maven-plugin + ${chicory.version} - normalize-wasm-path + protoc-wrapper - run + compile - initialize - - - - - - - - - - - - - true + io.roastedroot.protobuf4j.common.ProtobufWrapperCommon + ${project.basedir}/../wasm/protoc-wrapper-v3.wasm + io.roastedroot.protobuf4j.common.Protobuf + org.apache.maven.plugins maven-checkstyle-plugin @@ -100,18 +86,6 @@ org.apache.maven.plugins maven-compiler-plugin - - org.codehaus.mojo - templating-maven-plugin - - - filtering-java-templates - - filter-sources - - - - diff --git a/core-common/src/main/java-templates/io/roastedroot/protobuf4j/common/WasmResource.java b/core-common/src/main/java-templates/io/roastedroot/protobuf4j/common/WasmResource.java deleted file mode 100644 index 730640b..0000000 --- a/core-common/src/main/java-templates/io/roastedroot/protobuf4j/common/WasmResource.java +++ /dev/null @@ -1,7 +0,0 @@ -package io.roastedroot.protobuf4j.common; - -public final class WasmResource { - public static final String absoluteFile = "${wasm.resource.url}"; - - private WasmResource() {} -} diff --git a/core-common/src/main/java/io/roastedroot/protobuf4j/common/Protobuf.java b/core-common/src/main/java/io/roastedroot/protobuf4j/common/Protobuf.java index a301676..52a2b40 100644 --- a/core-common/src/main/java/io/roastedroot/protobuf4j/common/Protobuf.java +++ b/core-common/src/main/java/io/roastedroot/protobuf4j/common/Protobuf.java @@ -1,6 +1,5 @@ package io.roastedroot.protobuf4j.common; -import com.dylibso.chicory.annotations.WasmModuleInterface; import com.dylibso.chicory.runtime.ByteArrayMemory; import com.dylibso.chicory.runtime.ImportMemory; import com.dylibso.chicory.runtime.ImportValues; @@ -29,7 +28,6 @@ import java.util.logging.Logger; import java.util.stream.Collectors; -@WasmModuleInterface(value = WasmResource.absoluteFile) public final class Protobuf { private static final Logger LOGGER = Logger.getLogger(Protobuf.class.getCanonicalName()); diff --git a/core-v3/pom.xml b/core-v3/pom.xml index 8db2698..3870ae8 100644 --- a/core-v3/pom.xml +++ b/core-v3/pom.xml @@ -73,18 +73,6 @@ org.apache.maven.plugins maven-compiler-plugin - - org.codehaus.mojo - templating-maven-plugin - - - filtering-java-templates - - filter-sources - - - - diff --git a/core-v4/pom.xml b/core-v4/pom.xml index fd3a190..2c76c1c 100644 --- a/core-v4/pom.xml +++ b/core-v4/pom.xml @@ -73,18 +73,6 @@ org.apache.maven.plugins maven-compiler-plugin - - org.codehaus.mojo - templating-maven-plugin - - - filtering-java-templates - - filter-sources - - - - diff --git a/pom.xml b/pom.xml index e2c7537..e8e97c5 100644 --- a/pom.xml +++ b/pom.xml @@ -62,7 +62,6 @@ 12.3.1 3.6.0 3.4.0 - 3.1.0 3.15.0 3.5.2 ${surefire-plugin.version} @@ -161,21 +160,8 @@ true ${maven.compiler.release} - true - - - com.dylibso.chicory - annotations-processor - ${chicory.version} - - - - org.codehaus.mojo - templating-maven-plugin - ${templating-maven-plugin.version} - @@ -199,7 +185,6 @@ true ${maven.compiler.release} - true