Skip to content

Commit

Permalink
Introduce Dev only module for Arc extension
Browse files Browse the repository at this point in the history
Signed-off-by: Phillip Kruger <[email protected]>
  • Loading branch information
phillip-kruger authored and aloubyansky committed Dec 17, 2024
1 parent 53c4219 commit 583f44d
Show file tree
Hide file tree
Showing 16 changed files with 69 additions and 33 deletions.
5 changes: 5 additions & 0 deletions bom/application/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -587,6 +587,11 @@
<artifactId>quarkus-arc</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>io.quarkus</groupId>
<artifactId>quarkus-arc-dev</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>io.quarkus</groupId>
<artifactId>quarkus-arc-deployment</artifactId>
Expand Down
4 changes: 4 additions & 0 deletions extensions/arc/deployment/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,10 @@
<groupId>io.quarkus</groupId>
<artifactId>quarkus-arc</artifactId>
</dependency>
<dependency>
<groupId>io.quarkus</groupId>
<artifactId>quarkus-arc-dev</artifactId>
</dependency>
<dependency>
<groupId>io.quarkus.arc</groupId>
<artifactId>arc-processor</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,14 @@
import io.quarkus.arc.processor.InjectionPointInfo;
import io.quarkus.arc.processor.InterceptorInfo;
import io.quarkus.arc.processor.ObserverInfo;
import io.quarkus.deployment.IsDevelopment;
import io.quarkus.deployment.IsLocalDevelopment;
import io.quarkus.deployment.annotations.BuildProducer;
import io.quarkus.deployment.annotations.BuildStep;
import io.quarkus.dev.console.DevConsoleManager;

public class ArcDevModeApiProcessor {

@BuildStep(onlyIf = IsDevelopment.class)
@BuildStep(onlyIf = IsLocalDevelopment.class)
public void collectBeanInfo(ArcConfig config, ValidationPhaseBuildItem validationPhaseBuildItem,
CompletedApplicationClassPredicateBuildItem predicate,
BuildProducer<ArcBeanInfoBuildItem> arcBeanInfoProducer) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,13 @@
import io.quarkus.arc.deployment.BeanDefiningAnnotationBuildItem;
import io.quarkus.arc.deployment.CustomScopeAnnotationsBuildItem;
import io.quarkus.arc.processor.AnnotationsTransformer;
import io.quarkus.arc.runtime.devconsole.InvocationInterceptor;
import io.quarkus.arc.runtime.devconsole.InvocationTree;
import io.quarkus.arc.runtime.devconsole.InvocationsMonitor;
import io.quarkus.arc.runtime.devconsole.Monitored;
import io.quarkus.arc.runtime.devmode.EventsMonitor;
import io.quarkus.arc.runtime.devui.ArcJsonRPCService;
import io.quarkus.deployment.IsDevelopment;
import io.quarkus.arc.runtime.dev.EventsMonitor;
import io.quarkus.arc.runtime.dev.console.InvocationInterceptor;
import io.quarkus.arc.runtime.dev.console.InvocationTree;
import io.quarkus.arc.runtime.dev.console.InvocationsMonitor;
import io.quarkus.arc.runtime.dev.console.Monitored;
import io.quarkus.arc.runtime.dev.ui.ArcJsonRPCService;
import io.quarkus.deployment.IsLocalDevelopment;
import io.quarkus.deployment.annotations.BuildProducer;
import io.quarkus.deployment.annotations.BuildStep;
import io.quarkus.devui.spi.JsonRPCProvidersBuildItem;
Expand All @@ -28,7 +28,7 @@

public class ArcDevUIProcessor {

@BuildStep(onlyIf = IsDevelopment.class)
@BuildStep(onlyIf = IsLocalDevelopment.class)
public CardPageBuildItem pages(ArcBeanInfoBuildItem arcBeanInfoBuildItem, ArcConfig config) {
DevBeanInfos beanInfos = arcBeanInfoBuildItem.getBeanInfos();

Expand Down Expand Up @@ -102,12 +102,12 @@ public CardPageBuildItem pages(ArcBeanInfoBuildItem arcBeanInfoBuildItem, ArcCon
return pageBuildItem;
}

@BuildStep(onlyIf = IsDevelopment.class)
@BuildStep(onlyIf = IsLocalDevelopment.class)
JsonRPCProvidersBuildItem createJsonRPCService() {
return new JsonRPCProvidersBuildItem(ArcJsonRPCService.class);
}

@BuildStep(onlyIf = IsDevelopment.class)
@BuildStep(onlyIf = IsLocalDevelopment.class)
void registerMonitoringComponents(ArcConfig config, BuildProducer<AdditionalBeanBuildItem> beans,
BuildProducer<AnnotationsTransformerBuildItem> annotationTransformers,
CustomScopeAnnotationsBuildItem customScopes, List<BeanDefiningAnnotationBuildItem> beanDefiningAnnotations) {
Expand Down
1 change: 1 addition & 0 deletions extensions/arc/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
<module>deployment</module>
<module>runtime</module>
<module>test-supplement</module>
<module>runtime-dev</module>
</modules>

</project>
23 changes: 23 additions & 0 deletions extensions/arc/runtime-dev/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
<parent>
<artifactId>quarkus-arc-parent</artifactId>
<groupId>io.quarkus</groupId>
<version>999-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>

<artifactId>quarkus-arc-dev</artifactId>
<name>Quarkus - ArC - Runtime Dev mode</name>
<description>Build time CDI dependency injection - Dev mode only</description>

<dependencies>
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>quarkus-arc</artifactId>
</dependency>
</dependencies>

</project>
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package io.quarkus.arc.runtime.devmode;
package io.quarkus.arc.runtime.dev;

import java.util.List;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package io.quarkus.arc.runtime.devmode;
package io.quarkus.arc.runtime.dev;

import java.lang.annotation.Annotation;
import java.lang.reflect.Type;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package io.quarkus.arc.runtime.devmode;
package io.quarkus.arc.runtime.dev;

import java.util.List;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package io.quarkus.arc.runtime.devconsole;
package io.quarkus.arc.runtime.dev.console;

import java.lang.reflect.Method;
import java.time.Instant;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package io.quarkus.arc.runtime.devconsole;
package io.quarkus.arc.runtime.dev.console;

import java.lang.annotation.Annotation;
import java.lang.reflect.Method;
Expand All @@ -19,8 +19,8 @@
import io.quarkus.arc.ArcContainer;
import io.quarkus.arc.InjectableBean;
import io.quarkus.arc.ManagedContext;
import io.quarkus.arc.runtime.devconsole.Invocation.Builder;
import io.quarkus.arc.runtime.devconsole.Invocation.Kind;
import io.quarkus.arc.runtime.dev.console.Invocation.Builder;
import io.quarkus.arc.runtime.dev.console.Invocation.Kind;

@Priority(Interceptor.Priority.LIBRARY_BEFORE)
@Monitored
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package io.quarkus.arc.runtime.devconsole;
package io.quarkus.arc.runtime.dev.console;

import java.lang.reflect.Method;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package io.quarkus.arc.runtime.devconsole;
package io.quarkus.arc.runtime.dev.console;

import java.util.ArrayList;
import java.util.Collections;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package io.quarkus.arc.runtime.devconsole;
package io.quarkus.arc.runtime.dev.console;

import static java.lang.annotation.ElementType.METHOD;
import static java.lang.annotation.ElementType.TYPE;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package io.quarkus.arc.runtime.devui;
package io.quarkus.arc.runtime.dev.ui;

import java.time.Instant;
import java.time.LocalDateTime;
Expand All @@ -14,11 +14,11 @@

import io.quarkus.arc.Arc;
import io.quarkus.arc.InjectableBean;
import io.quarkus.arc.runtime.devconsole.Invocation;
import io.quarkus.arc.runtime.devconsole.InvocationsMonitor;
import io.quarkus.arc.runtime.devmode.EventInfo;
import io.quarkus.arc.runtime.devmode.EventsMonitor;
import io.quarkus.arc.runtime.devmode.InvocationInfo;
import io.quarkus.arc.runtime.dev.EventInfo;
import io.quarkus.arc.runtime.dev.EventsMonitor;
import io.quarkus.arc.runtime.dev.InvocationInfo;
import io.quarkus.arc.runtime.dev.console.Invocation;
import io.quarkus.arc.runtime.dev.console.InvocationsMonitor;
import io.smallrye.common.annotation.NonBlocking;
import io.smallrye.mutiny.Multi;

Expand Down
13 changes: 8 additions & 5 deletions extensions/arc/runtime/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,14 @@
<plugin>
<groupId>io.quarkus</groupId>
<artifactId>quarkus-extension-maven-plugin</artifactId>
<configuration>
<capabilities>
<provides>io.quarkus.cdi</provides>
</capabilities>
</configuration>
<configuration>
<capabilities>
<provides>io.quarkus.cdi</provides>
</capabilities>
<conditionalDevDependencies>
<artifact>${project.groupId}:${project.artifactId}-dev:${project.version}</artifact>
</conditionalDevDependencies>
</configuration>
</plugin>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
Expand Down

0 comments on commit 583f44d

Please sign in to comment.