Search in sources :

Example 1 with ResolvedDependency

use of io.quarkus.maven.dependency.ResolvedDependency in project automatiko-engine by automatiko-io.

the class AutomatikoQuarkusProcessor method createApplicationGenerator.

private ApplicationGenerator createApplicationGenerator(AutomatikoBuildTimeConfig config, AppPaths appPaths, CompositeIndex archivesIndex, ApplicationModel appModel) throws IOException {
    boolean usePersistence = archivesIndex.getClassByName(createDotName(persistenceFactoryClass)) != null;
    GeneratorContext context = buildContext(config, appPaths, archivesIndex);
    ApplicationGenerator appGen = new ApplicationGenerator(config.packageName().orElse(DEFAULT_PACKAGE_NAME), new File(appPaths.getFirstProjectPath().toFile(), "target")).withDependencyInjection(new CDIDependencyInjectionAnnotator()).withPersistence(usePersistence).withGeneratorContext(context);
    List<String> dependencies = new ArrayList<>();
    if (appModel != null) {
        for (ResolvedDependency i : appModel.getRuntimeDependencies()) {
            dependencies.add(i.getResolvedPaths().getSinglePath().toAbsolutePath().toString());
        }
    }
    addProcessGenerator(appPaths, usePersistence, appGen, dependencies);
    if (context.getBuildContext().isDmnSupported()) {
        addDecisionGenerator(appPaths, appGen, false, dependencies);
    }
    return appGen;
}
Also used : CDIDependencyInjectionAnnotator(io.automatiko.engine.codegen.di.CDIDependencyInjectionAnnotator) ApplicationGenerator(io.automatiko.engine.codegen.ApplicationGenerator) ArrayList(java.util.ArrayList) ResolvedDependency(io.quarkus.maven.dependency.ResolvedDependency) GeneratorContext(io.automatiko.engine.codegen.GeneratorContext) GeneratedFile(io.automatiko.engine.codegen.GeneratedFile) File(java.io.File)

Example 2 with ResolvedDependency

use of io.quarkus.maven.dependency.ResolvedDependency in project camel-quarkus by apache.

the class XchangeProcessor method indexDependenciesAndResources.

@BuildStep
void indexDependenciesAndResources(BuildProducer<IndexDependencyBuildItem> indexedDependency, BuildProducer<NativeImageResourceBuildItem> nativeImageResource, CurateOutcomeBuildItem curateOutcome) {
    ApplicationModel applicationModel = curateOutcome.getApplicationModel();
    for (ResolvedDependency dependency : applicationModel.getDependencies()) {
        if (dependency.getGroupId().equals("org.knowm.xchange")) {
            // Index any org.knowm.xchange dependencies present on the classpath as they contain the APIs for interacting with each crypto exchange
            String artifactId = dependency.getArtifactId();
            indexedDependency.produce(new IndexDependencyBuildItem(dependency.getGroupId(), artifactId));
            // Include crypto exchange metadata resources
            String[] split = artifactId.split("-");
            if (split.length > 1) {
                String cryptoExchange = split[split.length - 1];
                nativeImageResource.produce(new NativeImageResourceBuildItem(cryptoExchange + ".json"));
            }
        }
    }
    indexedDependency.produce(new IndexDependencyBuildItem("org.jboss.spec.javax.ws.rs", "jboss-jaxrs-api_2.1_spec"));
}
Also used : NativeImageResourceBuildItem(io.quarkus.deployment.builditem.nativeimage.NativeImageResourceBuildItem) IndexDependencyBuildItem(io.quarkus.deployment.builditem.IndexDependencyBuildItem) ResolvedDependency(io.quarkus.maven.dependency.ResolvedDependency) ApplicationModel(io.quarkus.bootstrap.model.ApplicationModel) BuildStep(io.quarkus.deployment.annotations.BuildStep)

Aggregations

ResolvedDependency (io.quarkus.maven.dependency.ResolvedDependency)2 ApplicationGenerator (io.automatiko.engine.codegen.ApplicationGenerator)1 GeneratedFile (io.automatiko.engine.codegen.GeneratedFile)1 GeneratorContext (io.automatiko.engine.codegen.GeneratorContext)1 CDIDependencyInjectionAnnotator (io.automatiko.engine.codegen.di.CDIDependencyInjectionAnnotator)1 ApplicationModel (io.quarkus.bootstrap.model.ApplicationModel)1 BuildStep (io.quarkus.deployment.annotations.BuildStep)1 IndexDependencyBuildItem (io.quarkus.deployment.builditem.IndexDependencyBuildItem)1 NativeImageResourceBuildItem (io.quarkus.deployment.builditem.nativeimage.NativeImageResourceBuildItem)1 File (java.io.File)1 ArrayList (java.util.ArrayList)1