ppalaga commented on a change in pull request #226: Use MainSupport as base for running Camel URL: https://github.com/apache/camel-quarkus/pull/226#discussion_r331420264
########## File path: extensions/main/deployment/src/main/java/org/apache/camel/quarkus/main/deployment/BuildProcessor.java ########## @@ -0,0 +1,80 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.camel.quarkus.main.deployment; + +import java.util.List; + +import io.quarkus.arc.deployment.AdditionalBeanBuildItem; +import io.quarkus.arc.deployment.BeanContainerBuildItem; +import io.quarkus.deployment.annotations.BuildProducer; +import io.quarkus.deployment.annotations.BuildStep; +import io.quarkus.deployment.annotations.ExecutionTime; +import io.quarkus.deployment.annotations.Record; +import io.quarkus.deployment.builditem.CombinedIndexBuildItem; +import io.quarkus.deployment.builditem.ServiceStartBuildItem; +import io.quarkus.deployment.builditem.ShutdownContextBuildItem; +import io.quarkus.runtime.RuntimeValue; +import org.apache.camel.quarkus.core.deployment.CamelContextBuildItem; +import org.apache.camel.quarkus.core.deployment.CamelSupport; +import org.apache.camel.quarkus.main.CamelMain; +import org.apache.camel.quarkus.main.CamelMainProducers; +import org.apache.camel.quarkus.main.CamelMainRecorder; +import org.apache.camel.quarkus.main.deployment.support.CamelMainBuildItem; +import org.apache.camel.quarkus.main.deployment.support.CamelMainListenerBuildItem; + +public class BuildProcessor { + @BuildStep + void beans(BuildProducer<AdditionalBeanBuildItem> beanProducer) { + beanProducer.produce(AdditionalBeanBuildItem.unremovableOf(CamelMainProducers.class)); + } + + @Record(ExecutionTime.STATIC_INIT) + @BuildStep + CamelMainBuildItem create( + CombinedIndexBuildItem combinedIndexBuildItem, + CamelMainRecorder recorder, + CamelContextBuildItem context, + List<CamelMainListenerBuildItem> listeners, + // TODO: keep is as it adds a dependency on Arc Review comment: It would be nice to document why is the dependency on Arc important, e.g. to be able to decide in the future that the param is not needed anymore. ---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: [email protected] With regards, Apache Git Services
