Skip to content

Commit

Permalink
Merge pull request #939 from xstefank/vertx-warning-i936
Browse files Browse the repository at this point in the history
fix: ignore vertx warning in reflective hierarchy during compilation
  • Loading branch information
xstefank committed Aug 30, 2024
2 parents f5b55f8 + 52586bc commit 78b8c93
Showing 1 changed file with 25 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
import io.quarkus.deployment.builditem.*;
import io.quarkus.deployment.builditem.nativeimage.ForceNonWeakReflectiveClassBuildItem;
import io.quarkus.deployment.builditem.nativeimage.ReflectiveHierarchyBuildItem;
import io.quarkus.deployment.builditem.nativeimage.ReflectiveHierarchyIgnoreWarningBuildItem;
import io.quarkus.deployment.metrics.MetricsCapabilityBuildItem;
import io.quarkus.gizmo.AssignableResultHandle;
import io.quarkus.gizmo.MethodCreator;
Expand Down Expand Up @@ -261,6 +262,30 @@ void initializeRuntimeNamespacesFromBuildTimeValues(

}

/**
* Ignore warnings related to non-indexed classes in the reflective hierarchy. At this point, we cannot know
* if they are actually needed for native compilation.
*
* This could probably be removed once https://github.com/quarkiverse/quarkus-operator-sdk/issues/941 is resolved.
*
*/
@BuildStep
void ignoreNonIndexedClassesWarningsInReflectiveHierarchy(
BuildProducer<ReflectiveHierarchyIgnoreWarningBuildItem> reflectiveHierarchyIgnoreWarningBuildItemBuildProducer) {
reflectiveHierarchyIgnoreWarningBuildItemBuildProducer.produce(
new ReflectiveHierarchyIgnoreWarningBuildItem(DotName.createSimple(io.vertx.core.Vertx.class.getName())));
reflectiveHierarchyIgnoreWarningBuildItemBuildProducer.produce(
new ReflectiveHierarchyIgnoreWarningBuildItem(
DotName.createSimple(io.vertx.core.http.HttpClient.class.getName())));
reflectiveHierarchyIgnoreWarningBuildItemBuildProducer.produce(
new ReflectiveHierarchyIgnoreWarningBuildItem(
DotName.createSimple(io.vertx.core.http.WebSocket.class.getName())));
reflectiveHierarchyIgnoreWarningBuildItemBuildProducer.produce(
new ReflectiveHierarchyIgnoreWarningBuildItem(
DotName.createSimple(io.vertx.core.net.ProxyType.class.getName())));

}

private void registerAssociatedClassesForReflection(BuildProducer<ReflectiveHierarchyBuildItem> reflectionClasses,
BuildProducer<ForceNonWeakReflectiveClassBuildItem> forcedReflectionClasses,
Set<String> classNamesToRegister) {
Expand Down

0 comments on commit 78b8c93

Please sign in to comment.