Skip to content

Commit

Permalink
Jt400: possible missing resource in the native
Browse files Browse the repository at this point in the history
  • Loading branch information
JiriOndrusek committed Apr 23, 2024
1 parent d5334ad commit 38e388c
Showing 1 changed file with 13 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@

import java.util.ArrayList;
import java.util.List;
import java.util.ListResourceBundle;
import java.util.regex.Pattern;

import com.ibm.as400.access.AS400;
Expand All @@ -29,6 +30,7 @@
import io.quarkus.deployment.builditem.FeatureBuildItem;
import io.quarkus.deployment.builditem.IndexDependencyBuildItem;
import io.quarkus.deployment.builditem.NativeImageEnableAllCharsetsBuildItem;
import io.quarkus.deployment.builditem.nativeimage.NativeImageResourceBundleBuildItem;
import io.quarkus.deployment.builditem.nativeimage.ReflectiveClassBuildItem;
import io.quarkus.deployment.builditem.nativeimage.RuntimeInitializedClassBuildItem;
import io.quarkus.deployment.builditem.nativeimage.RuntimeReinitializedClassBuildItem;
Expand All @@ -41,6 +43,7 @@ class Jt400Processor {
private static final Logger LOG = Logger.getLogger(Jt400Processor.class);
private static final String FEATURE = "camel-jt400";
private static final DotName CONV_TABLE_NAME = DotName.createSimple(ConvTable.class.getName());
private static final DotName LIST_RESOURCE_BUNDLE_NAME = DotName.createSimple(ListResourceBundle.class.getName());

@BuildStep
FeatureBuildItem feature() {
Expand Down Expand Up @@ -86,6 +89,16 @@ void reflectiveClasses(BuildProducer<ReflectiveClassBuildItem> reflectiveClasses

}

@BuildStep
void resourceBundles(BuildProducer<NativeImageResourceBundleBuildItem> imageResourceBundles,
CombinedIndexBuildItem combinedIndex) {
IndexView index = combinedIndex.getIndex();

index.getAllKnownSubclasses(LIST_RESOURCE_BUNDLE_NAME).stream()
.map(c -> new NativeImageResourceBundleBuildItem(c.name().toString()))
.forEach(imageResourceBundles::produce);
}

@BuildStep
IndexDependencyBuildItem registerDependencyForIndex() {
return new IndexDependencyBuildItem("net.sf.jt400", "jt400", "java11");
Expand Down

0 comments on commit 38e388c

Please sign in to comment.