Search in sources :

Example 1 with AdditionalStaticResourceBuildItem

use of io.quarkus.vertx.http.deployment.spi.AdditionalStaticResourceBuildItem in project kogito-runtimes by kiegroup.

the class KogitoQuarkusResourceUtils method registerResources.

public static void registerResources(Collection<GeneratedFile> generatedFiles, BuildProducer<AdditionalStaticResourceBuildItem> staticResProducer, BuildProducer<NativeImageResourceBuildItem> resource, BuildProducer<GeneratedResourceBuildItem> genResBI) {
    for (GeneratedFile f : generatedFiles) {
        if (f.category() == GeneratedFileType.Category.INTERNAL_RESOURCE || f.category() == GeneratedFileType.Category.STATIC_HTTP_RESOURCE) {
            genResBI.produce(new GeneratedResourceBuildItem(f.relativePath(), f.contents(), true));
            resource.produce(new NativeImageResourceBuildItem(f.relativePath()));
        }
        if (f.category() == GeneratedFileType.Category.STATIC_HTTP_RESOURCE) {
            // keep '/' at the beginning
            String resoucePath = f.relativePath().substring(GeneratedFile.META_INF_RESOURCES.length() - 1);
            staticResProducer.produce(new AdditionalStaticResourceBuildItem(resoucePath, false));
        }
    }
}
Also used : NativeImageResourceBuildItem(io.quarkus.deployment.builditem.nativeimage.NativeImageResourceBuildItem) GeneratedResourceBuildItem(io.quarkus.deployment.builditem.GeneratedResourceBuildItem) AdditionalStaticResourceBuildItem(io.quarkus.vertx.http.deployment.spi.AdditionalStaticResourceBuildItem) GeneratedFile(org.kie.kogito.codegen.api.GeneratedFile)

Aggregations

GeneratedResourceBuildItem (io.quarkus.deployment.builditem.GeneratedResourceBuildItem)1 NativeImageResourceBuildItem (io.quarkus.deployment.builditem.nativeimage.NativeImageResourceBuildItem)1 AdditionalStaticResourceBuildItem (io.quarkus.vertx.http.deployment.spi.AdditionalStaticResourceBuildItem)1 GeneratedFile (org.kie.kogito.codegen.api.GeneratedFile)1