From d2e3c21d39d518501805a78c70b6daee4041e392 Mon Sep 17 00:00:00 2001 From: Rob Bygrave Date: Thu, 25 Jul 2024 20:57:17 +1200 Subject: [PATCH] Fix partial compile regression introduced in 10.0-RC5 (#653) 10.0-RC5 introduced a regression that stops "Partial Compilation" from working. This is due to the ProcessingContext.isInjectModule() not correctly detecting the current module. This meant no existing module was found, no dependency meta data for the module was read, a new module is created for the components included in the partial compile and generally that will fail with missing dependencies. A workaround is to perform a full compile (but this isn't really a workable solution - its important that partial compile works). --- .../java/io/avaje/inject/generator/ProcessingContext.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/inject-generator/src/main/java/io/avaje/inject/generator/ProcessingContext.java b/inject-generator/src/main/java/io/avaje/inject/generator/ProcessingContext.java index ecf537f6..0a0cac73 100644 --- a/inject-generator/src/main/java/io/avaje/inject/generator/ProcessingContext.java +++ b/inject-generator/src/main/java/io/avaje/inject/generator/ProcessingContext.java @@ -53,7 +53,9 @@ static String loadMetaInfServices() { private static boolean isInjectModule(String spi) { var moduleType = APContext.typeElement(spi); - return moduleType != null && moduleType.getSuperclass().toString().contains("AvajeModule"); + return moduleType != null && moduleType.getInterfaces().stream() + .map(TypeMirror::toString) + .anyMatch(s -> s.contains("AvajeModule")); } static List loadMetaInfCustom() {