use of io.quarkus.deployment.Capabilities in project camel-quarkus by apache.
the class CamelMainNativeImageProcessor method camelNativeImageResources.
@BuildStep
private void camelNativeImageResources(Capabilities capabilities, BuildProducer<NativeImageResourceBuildItem> nativeResource) {
for (String path : CamelMainHelper.routesIncludePattern().collect(Collectors.toList())) {
String scheme = ResourceHelper.getScheme(path);
// Null scheme is equivalent to classpath scheme
if (scheme == null || scheme.equals("classpath:")) {
if (AntPathMatcher.INSTANCE.isPattern(path)) {
// Classpath directory traversal via wildcard paths does not work on GraalVM.
// The exact path to the resource has to be looked up
// https://github.com/oracle/graal/issues/1108
LOG.warnf("Classpath wildcards does not work in native mode. Resources matching %s will not be loaded.", path);
} else {
nativeResource.produce(new NativeImageResourceBuildItem(path.replace("classpath:", "")));
}
}
}
String[] resources = Stream.of("components", "dataformats", "languages").map(k -> "org/apache/camel/main/" + k + ".properties").toArray(String[]::new);
nativeResource.produce(new NativeImageResourceBuildItem(resources));
}
use of io.quarkus.deployment.Capabilities in project kogito-runtimes by kiegroup.
the class KogitoAssetsProcessorTest method validateAvailableCapabilitiesWithOptaPlannerWithRest.
@Test
public void validateAvailableCapabilitiesWithOptaPlannerWithRest() {
KogitoBuildContext context = QuarkusKogitoBuildContext.builder().build();
Capabilities capabilities = capabilities(Capability.RESTEASY, Capability.RESTEASY_JSON_JACKSON, "org.optaplanner.optaplanner-quarkus");
KogitoAssetsProcessor processor = new KogitoAssetsProcessor();
assertThat(context.getApplicationProperty(KogitoBuildContext.KOGITO_GENERATE_REST)).isEmpty();
processor.validateAvailableCapabilities(context, capabilities);
assertThat(context.getApplicationProperty(KogitoBuildContext.KOGITO_GENERATE_REST)).isEmpty();
}
use of io.quarkus.deployment.Capabilities in project kogito-runtimes by kiegroup.
the class KogitoAssetsProcessorTest method validateAvailableCapabilitiesWithOptaPlannerNoRest.
@Test
public void validateAvailableCapabilitiesWithOptaPlannerNoRest() {
KogitoBuildContext context = QuarkusKogitoBuildContext.builder().build();
Capabilities capabilities = capabilities("org.optaplanner.optaplanner-quarkus");
KogitoAssetsProcessor processor = new KogitoAssetsProcessor();
assertThat(context.getApplicationProperty(KogitoBuildContext.KOGITO_GENERATE_REST)).isEmpty();
processor.validateAvailableCapabilities(context, capabilities);
assertThat(context.getApplicationProperty(KogitoBuildContext.KOGITO_GENERATE_REST)).contains("false");
}
use of io.quarkus.deployment.Capabilities in project kogito-runtimes by kiegroup.
the class KogitoAssetsProcessorTest method validateAvailableCapabilitiesWithoutOptaPlanner.
@Test
public void validateAvailableCapabilitiesWithoutOptaPlanner() {
KogitoBuildContext context = QuarkusKogitoBuildContext.builder().build();
Capabilities capabilities = capabilities(Capability.RESTEASY, Capability.RESTEASY_JSON_JACKSON);
KogitoAssetsProcessor processor = new KogitoAssetsProcessor();
assertThat(context.getApplicationProperty(KogitoBuildContext.KOGITO_GENERATE_REST)).isEmpty();
processor.validateAvailableCapabilities(context, capabilities);
assertThat(context.getApplicationProperty(KogitoBuildContext.KOGITO_GENERATE_REST)).isEmpty();
}
Aggregations