From 1b0b6884e365e48e71231c6ff9512125e74c3c44 Mon Sep 17 00:00:00 2001 From: Marco Collovati Date: Sun, 17 Nov 2024 13:45:55 +0100 Subject: [PATCH] fixes for native build --- .../QuarkusHillaNativeProcessor.java | 27 ++++++++++++------- 1 file changed, 17 insertions(+), 10 deletions(-) diff --git a/commons/deployment/src/main/java/com/github/mcollovati/quarkus/hilla/deployment/QuarkusHillaNativeProcessor.java b/commons/deployment/src/main/java/com/github/mcollovati/quarkus/hilla/deployment/QuarkusHillaNativeProcessor.java index a775f820..de53224f 100644 --- a/commons/deployment/src/main/java/com/github/mcollovati/quarkus/hilla/deployment/QuarkusHillaNativeProcessor.java +++ b/commons/deployment/src/main/java/com/github/mcollovati/quarkus/hilla/deployment/QuarkusHillaNativeProcessor.java @@ -225,16 +225,6 @@ void hillaNativeSupport( .includePatterns("META-INF/microprofile-config\\.properties") .build()); - // explicitly register classes not present in the index - reflectiveClass.produce(ReflectiveClassBuildItem.builder( - com.github.mcollovati.quarkus.hilla.crud.panache.CrudRepositoryService.class, - com.github.mcollovati.quarkus.hilla.crud.panache.ListRepositoryService.class, - com.github.mcollovati.quarkus.hilla.crud.spring.CrudRepositoryService.class, - com.github.mcollovati.quarkus.hilla.crud.spring.ListRepositoryService.class) - .constructors() - .methods() - .build()); - IndexView index = combinedIndex.getComputingIndex(); Set classes = new HashSet<>(); classes.addAll(index.getAllKnownImplementors(EndpointTransferMapper.Mapper.class)); @@ -254,6 +244,23 @@ void hillaNativeSupport( classes.add(index.getClassByName("org.springframework.data.repository.CrudRepository")); classes.add(index.getClassByName("org.springframework.data.domain.Pageable")); classes.add(index.getClassByName("org.springframework.data.domain.Specification")); + + // explicitly register classes not present in the index + reflectiveClass.produce(ReflectiveClassBuildItem.builder( + com.github.mcollovati.quarkus.hilla.crud.spring.CrudRepositoryService.class, + com.github.mcollovati.quarkus.hilla.crud.spring.ListRepositoryService.class) + .constructors() + .methods() + .build()); + } + + if (capabilities.isPresent(QuarkusHillaExtensionProcessor.PANACHE_SUPPORT)) { + reflectiveClass.produce(ReflectiveClassBuildItem.builder( + com.github.mcollovati.quarkus.hilla.crud.panache.CrudRepositoryService.class, + com.github.mcollovati.quarkus.hilla.crud.panache.ListRepositoryService.class) + .constructors() + .methods() + .build()); } reflectiveClass.produce(ReflectiveClassBuildItem.builder(classes.stream()