Search in sources :

Example 1 with ReflectiveHierarchyIgnoreWarningBuildItem

use of io.quarkus.deployment.builditem.nativeimage.ReflectiveHierarchyIgnoreWarningBuildItem in project camel-quarkus by apache.

the class HazelcastProcessor method registerTypeHierarchy.

private static void registerTypeHierarchy(BuildProducer<ReflectiveHierarchyBuildItem> reflectiveHierarchyClass, BuildProducer<ReflectiveHierarchyIgnoreWarningBuildItem> ignoreWarnings, Class<?>... classNames) {
    for (Class<?> klass : classNames) {
        DotName simpleName = DotName.createSimple(klass.getName());
        reflectiveHierarchyClass.produce(new ReflectiveHierarchyBuildItem.Builder().type(Type.create(simpleName, Type.Kind.CLASS)).build());
        ignoreWarnings.produce(new ReflectiveHierarchyIgnoreWarningBuildItem(simpleName));
    }
}
Also used : ReflectiveHierarchyIgnoreWarningBuildItem(io.quarkus.deployment.builditem.nativeimage.ReflectiveHierarchyIgnoreWarningBuildItem) ReflectiveHierarchyBuildItem(io.quarkus.deployment.builditem.nativeimage.ReflectiveHierarchyBuildItem) DotName(org.jboss.jandex.DotName)

Example 2 with ReflectiveHierarchyIgnoreWarningBuildItem

use of io.quarkus.deployment.builditem.nativeimage.ReflectiveHierarchyIgnoreWarningBuildItem in project camel-quarkus by apache.

the class ConsulClientSupportProcessor method ignoredOnReflectiveHierarchyRegistration.

@BuildStep
void ignoredOnReflectiveHierarchyRegistration(BuildProducer<ReflectiveHierarchyIgnoreWarningBuildItem> ignored) {
    ignored.produce(new ReflectiveHierarchyIgnoreWarningBuildItem(DOT_NAME_IMMUTABLE_LIST));
    ignored.produce(new ReflectiveHierarchyIgnoreWarningBuildItem(DOT_NAME_IMMUTABLE_MAP));
}
Also used : ReflectiveHierarchyIgnoreWarningBuildItem(io.quarkus.deployment.builditem.nativeimage.ReflectiveHierarchyIgnoreWarningBuildItem) BuildStep(io.quarkus.deployment.annotations.BuildStep)

Example 3 with ReflectiveHierarchyIgnoreWarningBuildItem

use of io.quarkus.deployment.builditem.nativeimage.ReflectiveHierarchyIgnoreWarningBuildItem in project automatiko-engine by automatiko-io.

the class AutomatikoQuarkusProcessor method reflectiveClassesRegistrationStep.

@BuildStep
public void reflectiveClassesRegistrationStep(ApplicationArchivesBuildItem archives, BuildProducer<ReflectiveHierarchyIgnoreWarningBuildItem> reflectiveHierarchy, BuildProducer<ReflectiveClassBuildItem> reflectiveClass) {
    reflectiveClass.produce(new ReflectiveClassBuildItem(true, true, "io.automatiko.engine.api.event.AbstractDataEvent"));
    reflectiveClass.produce(new ReflectiveClassBuildItem(true, true, "io.automatiko.engine.services.event.AbstractProcessDataEvent"));
    reflectiveClass.produce(new ReflectiveClassBuildItem(true, true, "io.automatiko.engine.services.event.ProcessInstanceDataEvent"));
    reflectiveClass.produce(new ReflectiveClassBuildItem(true, true, "io.automatiko.engine.services.event.UserTaskInstanceDataEvent"));
    reflectiveClass.produce(new ReflectiveClassBuildItem(true, true, "io.automatiko.engine.services.event.VariableInstanceDataEvent"));
    reflectiveClass.produce(new ReflectiveClassBuildItem(true, true, "io.automatiko.engine.services.event.impl.ProcessInstanceEventBody"));
    reflectiveClass.produce(new ReflectiveClassBuildItem(true, true, "io.automatiko.engine.services.event.impl.NodeInstanceEventBody"));
    reflectiveClass.produce(new ReflectiveClassBuildItem(true, true, "io.automatiko.engine.services.event.impl.ProcessErrorEventBody"));
    reflectiveClass.produce(new ReflectiveClassBuildItem(true, true, "io.automatiko.engine.services.event.impl.VariableInstanceEventBody"));
    reflectiveClass.produce(new ReflectiveClassBuildItem(true, true, "io.automatiko.engine.services.event.impl.UserTaskInstanceEventBody"));
    reflectiveClass.produce(new ReflectiveClassBuildItem(false, false, "org.mvel2.optimizers.dynamic.DynamicOptimizer"));
    reflectiveClass.produce(new ReflectiveClassBuildItem(false, false, "org.mvel2.optimizers.impl.refl.ReflectiveAccessorOptimizer"));
    reflectiveClass.produce(new ReflectiveClassBuildItem(true, true, ArrayList.class.getCanonicalName()));
    reflectiveClass.produce(new ReflectiveClassBuildItem(true, true, byte[].class.getName()));
    reflectiveClass.produce(new ReflectiveClassBuildItem(true, false, BaseWorkItem.class));
    List<IndexView> archiveIndexes = new ArrayList<>();
    for (ApplicationArchive i : archives.getAllApplicationArchives()) {
        archiveIndexes.add(i.getIndex());
    }
    CompositeIndex archivesIndex = CompositeIndex.create(archiveIndexes);
    // add functions classes found
    reflectiveClass.produce(new ReflectiveClassBuildItem(true, false, "io.automatiko.engine.services.execution.BaseFunctions"));
    archivesIndex.getAllKnownImplementors(createDotName("io.automatiko.engine.api.Functions")).stream().map(c -> c.name().toString()).forEach(c -> reflectiveClass.produce(new ReflectiveClassBuildItem(true, false, c)));
    // DMN related
    DotName classDotName = createDotName(CodeGenConstants.DMN_CLASS);
    if (!archivesIndex.getAnnotations(classDotName).isEmpty() || archivesIndex.getClassByName(classDotName) != null) {
        reflectiveHierarchy.produce(new ReflectiveHierarchyIgnoreWarningBuildItem(createDotName("org.kie.api.builder.Message$Level")));
        reflectiveHierarchy.produce(new ReflectiveHierarchyIgnoreWarningBuildItem(createDotName("org.kie.dmn.api.core.DMNContext")));
        reflectiveHierarchy.produce(new ReflectiveHierarchyIgnoreWarningBuildItem(createDotName("org.kie.dmn.api.core.DMNDecisionResult")));
        reflectiveHierarchy.produce(new ReflectiveHierarchyIgnoreWarningBuildItem(createDotName("org.kie.dmn.api.core.DMNDecisionResult$DecisionEvaluationStatus")));
        reflectiveHierarchy.produce(new ReflectiveHierarchyIgnoreWarningBuildItem(createDotName("org.kie.dmn.api.core.DMNMessage")));
        reflectiveHierarchy.produce(new ReflectiveHierarchyIgnoreWarningBuildItem(createDotName("org.kie.dmn.api.core.DMNMessage$Severity")));
        reflectiveHierarchy.produce(new ReflectiveHierarchyIgnoreWarningBuildItem(createDotName("org.kie.dmn.api.core.DMNMessageType")));
        reflectiveHierarchy.produce(new ReflectiveHierarchyIgnoreWarningBuildItem(createDotName("org.kie.dmn.api.feel.runtime.events.FEELEvent")));
    }
    // jackson node classes for serializing JSON tree instances
    reflectiveClass.produce(new ReflectiveClassBuildItem(true, true, "com.fasterxml.jackson.databind.node.TextNode"));
    reflectiveClass.produce(new ReflectiveClassBuildItem(true, true, "com.fasterxml.jackson.databind.node.BinaryNode"));
    reflectiveClass.produce(new ReflectiveClassBuildItem(true, true, "com.fasterxml.jackson.databind.node.BooleanNode"));
    reflectiveClass.produce(new ReflectiveClassBuildItem(true, true, "com.fasterxml.jackson.databind.node.NullNode"));
    reflectiveClass.produce(new ReflectiveClassBuildItem(true, true, "com.fasterxml.jackson.databind.node.BigIntegerNode"));
    reflectiveClass.produce(new ReflectiveClassBuildItem(true, true, "com.fasterxml.jackson.databind.node.DecimalNode"));
    reflectiveClass.produce(new ReflectiveClassBuildItem(true, true, "com.fasterxml.jackson.databind.node.DoubleNode"));
    reflectiveClass.produce(new ReflectiveClassBuildItem(true, true, "com.fasterxml.jackson.databind.node.FloatNode"));
    reflectiveClass.produce(new ReflectiveClassBuildItem(true, true, "com.fasterxml.jackson.databind.node.IntNode"));
    reflectiveClass.produce(new ReflectiveClassBuildItem(true, true, "com.fasterxml.jackson.databind.node.LongNode"));
    reflectiveClass.produce(new ReflectiveClassBuildItem(true, true, "com.fasterxml.jackson.databind.node.ShortNode"));
    reflectiveClass.produce(new ReflectiveClassBuildItem(true, true, "com.fasterxml.jackson.databind.node.POJONode"));
    reflectiveClass.produce(new ReflectiveClassBuildItem(true, true, "com.fasterxml.jackson.databind.node.ObjectNode"));
    reflectiveClass.produce(new ReflectiveClassBuildItem(true, true, "com.fasterxml.jackson.databind.node.ArrayNode"));
    reflectiveClass.produce(new ReflectiveClassBuildItem(true, true, Long.class.getCanonicalName()));
    reflectiveClass.produce(new ReflectiveClassBuildItem(true, true, Integer.class.getCanonicalName()));
    reflectiveClass.produce(new ReflectiveClassBuildItem(true, true, Boolean.class.getCanonicalName()));
    reflectiveClass.produce(new ReflectiveClassBuildItem(true, true, String.class.getCanonicalName()));
}
Also used : BiFunction(java.util.function.BiFunction) LoggerFactory(org.slf4j.LoggerFactory) GeneratorContext(io.automatiko.engine.codegen.GeneratorContext) ClassInfo(org.jboss.jandex.ClassInfo) TestRunListener(io.quarkus.deployment.dev.testing.TestRunListener) BuildProducer(io.quarkus.deployment.annotations.BuildProducer) CodeGenConstants(io.automatiko.engine.codegen.CodeGenConstants) GeneratedBeanBuildItem(io.quarkus.arc.deployment.GeneratedBeanBuildItem) MethodInfo(org.jboss.jandex.MethodInfo) ArchiveRootBuildItem(io.quarkus.deployment.builditem.ArchiveRootBuildItem) FeatureBuildItem(io.quarkus.deployment.builditem.FeatureBuildItem) CompilationTask(javax.tools.JavaCompiler.CompilationTask) CompositeIndex(org.jboss.jandex.CompositeIndex) Diagnostic(javax.tools.Diagnostic) Map(java.util.Map) CDIDependencyInjectionAnnotator(io.automatiko.engine.codegen.di.CDIDependencyInjectionAnnotator) URI(java.net.URI) Path(java.nio.file.Path) DiagnosticCollector(javax.tools.DiagnosticCollector) TestListener(io.quarkus.deployment.dev.testing.TestListener) TestListenerBuildItem(io.quarkus.deployment.dev.testing.TestListenerBuildItem) SimpleJavaFileObject(javax.tools.SimpleJavaFileObject) IoUtils(io.automatiko.engine.services.utils.IoUtils) StandardLocation(javax.tools.StandardLocation) Model(io.automatiko.engine.api.Model) JavaCompiler(javax.tools.JavaCompiler) AutomatikoMessages(io.automatiko.engine.workflow.marshalling.impl.AutomatikoMessages) Collection(java.util.Collection) Set(java.util.Set) NativeImageResourceBuildItem(io.quarkus.deployment.builditem.nativeimage.NativeImageResourceBuildItem) QuarkusClassLoader(io.quarkus.bootstrap.classloading.QuarkusClassLoader) Collectors(java.util.stream.Collectors) PackageConfig(io.quarkus.deployment.pkg.PackageConfig) JavaFileObject(javax.tools.JavaFileObject) List(java.util.List) ApplicationModel(io.quarkus.bootstrap.model.ApplicationModel) ConfigProvider(org.eclipse.microprofile.config.ConfigProvider) ResolvedDependency(io.quarkus.maven.dependency.ResolvedDependency) ServiceProviderBuildItem(io.quarkus.deployment.builditem.nativeimage.ServiceProviderBuildItem) QuarkusApplicationBuildContext(io.automatiko.engine.codegen.context.QuarkusApplicationBuildContext) ReflectiveHierarchyIgnoreWarningBuildItem(io.quarkus.deployment.builditem.nativeimage.ReflectiveHierarchyIgnoreWarningBuildItem) ToolProvider(javax.tools.ToolProvider) IndexingUtil(io.quarkus.deployment.index.IndexingUtil) ReflectiveClassBuildItem(io.quarkus.deployment.builditem.nativeimage.ReflectiveClassBuildItem) ProcessCodegen(io.automatiko.engine.codegen.process.ProcessCodegen) DotName(org.jboss.jandex.DotName) PersistenceGenerator(io.automatiko.engine.codegen.process.persistence.PersistenceGenerator) LaunchMode(io.quarkus.runtime.LaunchMode) CurateOutcomeBuildItem(io.quarkus.deployment.pkg.builditem.CurateOutcomeBuildItem) Function(java.util.function.Function) ArrayList(java.util.ArrayList) HashSet(java.util.HashSet) LinkedHashMap(java.util.LinkedHashMap) PathsCollection(io.quarkus.bootstrap.model.PathsCollection) Indexer(org.jboss.jandex.Indexer) BuildStep(io.quarkus.deployment.annotations.BuildStep) BaseWorkItem(io.automatiko.engine.workflow.BaseWorkItem) Index(org.jboss.jandex.Index) LinkedHashSet(java.util.LinkedHashSet) IndexView(org.jboss.jandex.IndexView) GeneratedResourceBuildItem(io.quarkus.deployment.builditem.GeneratedResourceBuildItem) GeneratedFile(io.automatiko.engine.codegen.GeneratedFile) RuntimeInitializedClassBuildItem(io.quarkus.deployment.builditem.nativeimage.RuntimeInitializedClassBuildItem) Logger(org.slf4j.Logger) MemoryClassPathElement(io.quarkus.bootstrap.classloading.MemoryClassPathElement) ClassPathElement(io.quarkus.bootstrap.classloading.ClassPathElement) ApplicationArchivesBuildItem(io.quarkus.deployment.builditem.ApplicationArchivesBuildItem) Files(java.nio.file.Files) ApplicationGenerator(io.automatiko.engine.codegen.ApplicationGenerator) IOException(java.io.IOException) Field(java.lang.reflect.Field) File(java.io.File) Consumer(java.util.function.Consumer) DecisionCodegen(io.automatiko.engine.codegen.decision.DecisionCodegen) ApplicationArchive(io.quarkus.deployment.ApplicationArchive) StandardJavaFileManager(javax.tools.StandardJavaFileManager) BootstrapDependencyProcessingException(io.quarkus.bootstrap.BootstrapDependencyProcessingException) AdditionalIndexedClassesBuildItem(io.quarkus.deployment.builditem.AdditionalIndexedClassesBuildItem) Paths(java.nio.file.Paths) LaunchModeBuildItem(io.quarkus.deployment.builditem.LaunchModeBuildItem) AutomatikoBuildTimeConfig(io.automatiko.engine.quarkus.AutomatikoBuildTimeConfig) Collections(java.util.Collections) AutomatikoConfigProperties(io.automatiko.engine.api.codegen.AutomatikoConfigProperties) LiveReloadBuildItem(io.quarkus.deployment.builditem.LiveReloadBuildItem) ReflectiveHierarchyIgnoreWarningBuildItem(io.quarkus.deployment.builditem.nativeimage.ReflectiveHierarchyIgnoreWarningBuildItem) IndexView(org.jboss.jandex.IndexView) ArrayList(java.util.ArrayList) CompositeIndex(org.jboss.jandex.CompositeIndex) ApplicationArchive(io.quarkus.deployment.ApplicationArchive) DotName(org.jboss.jandex.DotName) ReflectiveClassBuildItem(io.quarkus.deployment.builditem.nativeimage.ReflectiveClassBuildItem) BaseWorkItem(io.automatiko.engine.workflow.BaseWorkItem) BuildStep(io.quarkus.deployment.annotations.BuildStep)

Example 4 with ReflectiveHierarchyIgnoreWarningBuildItem

use of io.quarkus.deployment.builditem.nativeimage.ReflectiveHierarchyIgnoreWarningBuildItem in project kogito-runtimes by kiegroup.

the class DecisionsAssetsProcessor method reflectiveDMNREST.

@BuildStep
public List<ReflectiveHierarchyIgnoreWarningBuildItem> reflectiveDMNREST() {
    List<ReflectiveHierarchyIgnoreWarningBuildItem> result = new ArrayList<>();
    result.add(new ReflectiveHierarchyIgnoreWarningBuildItem(DotName.createSimple("org.kie.api.builder" + ".Message$Level")));
    result.add(new ReflectiveHierarchyIgnoreWarningBuildItem(DotName.createSimple("org.kie.dmn.api.core" + ".DMNContext")));
    result.add(new ReflectiveHierarchyIgnoreWarningBuildItem(DotName.createSimple("org.kie.dmn.api.core" + ".DMNDecisionResult")));
    result.add(new ReflectiveHierarchyIgnoreWarningBuildItem(DotName.createSimple("org.kie.dmn.api.core.DMNDecisionResult$DecisionEvaluationStatus")));
    result.add(new ReflectiveHierarchyIgnoreWarningBuildItem(DotName.createSimple("org.kie.dmn.api.core" + ".DMNMessage")));
    result.add(new ReflectiveHierarchyIgnoreWarningBuildItem(DotName.createSimple("org.kie.dmn.api.core" + ".DMNMessage$Severity")));
    result.add(new ReflectiveHierarchyIgnoreWarningBuildItem(DotName.createSimple("org.kie.dmn.api.core" + ".DMNMessageType")));
    result.add(new ReflectiveHierarchyIgnoreWarningBuildItem(DotName.createSimple("org.kie.dmn.api.feel.runtime" + ".events.FEELEvent")));
    return result;
}
Also used : ReflectiveHierarchyIgnoreWarningBuildItem(io.quarkus.deployment.builditem.nativeimage.ReflectiveHierarchyIgnoreWarningBuildItem) ArrayList(java.util.ArrayList) BuildStep(io.quarkus.deployment.annotations.BuildStep)

Example 5 with ReflectiveHierarchyIgnoreWarningBuildItem

use of io.quarkus.deployment.builditem.nativeimage.ReflectiveHierarchyIgnoreWarningBuildItem in project quarkus-hazelcast-client by hazelcast.

the class HazelcastClientProcessor method registerTypeHierarchy.

private static void registerTypeHierarchy(BuildProducer<ReflectiveHierarchyBuildItem> reflectiveHierarchyClass, BuildProducer<ReflectiveHierarchyIgnoreWarningBuildItem> ignoreWarnings, Class<?>... classNames) {
    for (Class<?> klass : classNames) {
        DotName simpleName = DotName.createSimple(klass.getName());
        reflectiveHierarchyClass.produce(new ReflectiveHierarchyBuildItem.Builder().type(Type.create(simpleName, Type.Kind.CLASS)).build());
        ignoreWarnings.produce(new ReflectiveHierarchyIgnoreWarningBuildItem(simpleName));
    }
}
Also used : ReflectiveHierarchyIgnoreWarningBuildItem(io.quarkus.deployment.builditem.nativeimage.ReflectiveHierarchyIgnoreWarningBuildItem) ReflectiveHierarchyBuildItem(io.quarkus.deployment.builditem.nativeimage.ReflectiveHierarchyBuildItem) DotName(org.jboss.jandex.DotName)

Aggregations

ReflectiveHierarchyIgnoreWarningBuildItem (io.quarkus.deployment.builditem.nativeimage.ReflectiveHierarchyIgnoreWarningBuildItem)5 BuildStep (io.quarkus.deployment.annotations.BuildStep)3 DotName (org.jboss.jandex.DotName)3 ReflectiveHierarchyBuildItem (io.quarkus.deployment.builditem.nativeimage.ReflectiveHierarchyBuildItem)2 Model (io.automatiko.engine.api.Model)1 AutomatikoConfigProperties (io.automatiko.engine.api.codegen.AutomatikoConfigProperties)1 ApplicationGenerator (io.automatiko.engine.codegen.ApplicationGenerator)1 CodeGenConstants (io.automatiko.engine.codegen.CodeGenConstants)1 GeneratedFile (io.automatiko.engine.codegen.GeneratedFile)1 GeneratorContext (io.automatiko.engine.codegen.GeneratorContext)1 QuarkusApplicationBuildContext (io.automatiko.engine.codegen.context.QuarkusApplicationBuildContext)1 DecisionCodegen (io.automatiko.engine.codegen.decision.DecisionCodegen)1 CDIDependencyInjectionAnnotator (io.automatiko.engine.codegen.di.CDIDependencyInjectionAnnotator)1 ProcessCodegen (io.automatiko.engine.codegen.process.ProcessCodegen)1 PersistenceGenerator (io.automatiko.engine.codegen.process.persistence.PersistenceGenerator)1 AutomatikoBuildTimeConfig (io.automatiko.engine.quarkus.AutomatikoBuildTimeConfig)1 IoUtils (io.automatiko.engine.services.utils.IoUtils)1 BaseWorkItem (io.automatiko.engine.workflow.BaseWorkItem)1 AutomatikoMessages (io.automatiko.engine.workflow.marshalling.impl.AutomatikoMessages)1 GeneratedBeanBuildItem (io.quarkus.arc.deployment.GeneratedBeanBuildItem)1