Skip to content

Commit

Permalink
Merge pull request quarkusio#24817 from mkouba/issue-21919
Browse files Browse the repository at this point in the history
Get rid of the split package in the gRPC extension artifacts
  • Loading branch information
Sanne authored Apr 7, 2022
2 parents dcc66b2 + dec3396 commit 51843c0
Show file tree
Hide file tree
Showing 31 changed files with 86 additions and 33 deletions.
7 changes: 6 additions & 1 deletion bom/application/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -1743,7 +1743,12 @@
</exclusions>
</dependency>
<dependency>
<groupId>io.quarkus</groupId>
<groupId>io.quarkus</groupId>
<artifactId>quarkus-grpc-api</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>io.quarkus</groupId>
<artifactId>quarkus-grpc-common</artifactId>
<version>${project.version}</version>
</dependency>
Expand Down
38 changes: 38 additions & 0 deletions extensions/grpc/api/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
<?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">
<modelVersion>4.0.0</modelVersion>
<parent>
<artifactId>quarkus-grpc-parent</artifactId>
<groupId>io.quarkus</groupId>
<version>999-SNAPSHOT</version>
</parent>

<artifactId>quarkus-grpc-api</artifactId>
<name>Quarkus - gRPC - API</name>

<dependencies>
<dependency>
<groupId>io.grpc</groupId>
<artifactId>grpc-stub</artifactId>
<exclusions>
<exclusion>
<groupId>com.google.code.findbugs</groupId>
<artifactId>jsr305</artifactId>
</exclusion>
<exclusion>
<groupId>org.checkerframework</groupId>
<artifactId>checker-qual</artifactId>
</exclusion>
<exclusion>
<groupId>org.codehaus.mojo</groupId>
<artifactId>animal-sniffer-annotations</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>jakarta.enterprise</groupId>
<artifactId>jakarta.enterprise.cdi-api</artifactId>
</dependency>
</dependencies>

</project>
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
import io.grpc.Metadata;
import io.grpc.stub.AbstractStub;
import io.grpc.stub.MetadataUtils;
import io.quarkus.grpc.runtime.MutinyClient;

/**
* gRPC client utilities
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package io.quarkus.grpc.runtime;
package io.quarkus.grpc;

/**
* Used to mark a convenient Mutiny bean generated for a gRPC service.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package io.quarkus.grpc.runtime;
package io.quarkus.grpc;

import io.grpc.stub.AbstractStub;

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

/**
* Used to mark a generated Mutiny gRPC service.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package io.quarkus.grpc.runtime;
package io.quarkus.grpc;

/**
* Used to mark a Mutiny service interface generated for a gRPC service.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package io.quarkus.grpc.runtime;
package io.quarkus.grpc;

/**
* A marker interface that represents a generated Mutiny gRPC stub.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,14 @@
import io.quarkus.grpc.GlobalInterceptor;
import io.quarkus.grpc.GrpcClient;
import io.quarkus.grpc.GrpcService;
import io.quarkus.grpc.MutinyBean;
import io.quarkus.grpc.MutinyClient;
import io.quarkus.grpc.MutinyGrpc;
import io.quarkus.grpc.MutinyService;
import io.quarkus.grpc.MutinyStub;
import io.quarkus.grpc.RegisterClientInterceptor;
import io.quarkus.grpc.RegisterInterceptor;
import io.quarkus.grpc.RegisterInterceptors;
import io.quarkus.grpc.runtime.MutinyBean;
import io.quarkus.grpc.runtime.MutinyClient;
import io.quarkus.grpc.runtime.MutinyGrpc;
import io.quarkus.grpc.runtime.MutinyService;
import io.quarkus.grpc.runtime.MutinyStub;
import io.quarkus.grpc.runtime.supports.Channels;
import io.quarkus.grpc.runtime.supports.GrpcClientConfigProvider;
import io.smallrye.common.annotation.Blocking;
Expand Down
1 change: 1 addition & 0 deletions extensions/grpc/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
<modules>
<module>protoc</module>
<module>codegen</module>
<module>api</module>
<module>stubs</module>
<module>deployment</module>
<module>runtime</module>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ package {{packageName}};

import io.grpc.BindableService;
import io.quarkus.grpc.GrpcService;
import io.quarkus.grpc.runtime.MutinyBean;
import io.quarkus.grpc.MutinyBean;

@javax.annotation.Generated(
value = "by {{classPrefix}} Grpc generator",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ package {{packageName}};

import java.util.function.BiFunction;

import io.quarkus.grpc.runtime.MutinyClient;
import io.quarkus.grpc.MutinyClient;

@javax.annotation.Generated(
value = "by {{classPrefix}} Grpc generator",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
package {{packageName}};
{{/packageName}}

import io.quarkus.grpc.runtime.MutinyService;
import io.quarkus.grpc.MutinyService;

@javax.annotation.Generated(
value = "by {{classPrefix}} Grpc generator",
Expand Down
16 changes: 8 additions & 8 deletions extensions/grpc/protoc/src/main/resources/MutinyStub.mustache
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,15 @@ import static io.grpc.stub.ServerCalls.asyncBidiStreamingCall;
@javax.annotation.Generated(
value = "by {{classPrefix}} Grpc generator",
comments = "Source: {{protoName}}")
public final class {{className}} implements io.quarkus.grpc.runtime.MutinyGrpc {
public final class {{className}} implements io.quarkus.grpc.MutinyGrpc {
private {{className}}() {}

public static {{classPrefix}}{{serviceName}}Stub new{{classPrefix}}Stub(io.grpc.Channel channel) {
return new {{classPrefix}}{{serviceName}}Stub(channel);
}

{{#javaDoc}}{{{javaDoc}}}{{/javaDoc}}
public static final class {{classPrefix}}{{serviceName}}Stub extends io.grpc.stub.AbstractStub<{{classPrefix}}{{serviceName}}Stub> implements io.quarkus.grpc.runtime.MutinyStub {
public static final class {{classPrefix}}{{serviceName}}Stub extends io.grpc.stub.AbstractStub<{{classPrefix}}{{serviceName}}Stub> implements io.quarkus.grpc.MutinyStub {
private {{serviceName}}Grpc.{{serviceName}}Stub delegateStub;

private {{classPrefix}}{{serviceName}}Stub(io.grpc.Channel channel) {
Expand All @@ -43,28 +43,28 @@ public final class {{className}} implements io.quarkus.grpc.runtime.MutinyGrpc {
{{#unaryUnaryMethods}}
{{{methodHeader}}}
public io.smallrye.mutiny.Uni<{{outputType}}> {{methodName}}({{inputType}} request) {
return io.quarkus.grpc.runtime.ClientCalls.{{mutinyCallsMethodName}}(request, delegateStub::{{methodName}});
return io.quarkus.grpc.stubs.ClientCalls.{{mutinyCallsMethodName}}(request, delegateStub::{{methodName}});
}

{{/unaryUnaryMethods}}
{{#unaryManyMethods}}
{{{methodHeader}}}
public io.smallrye.mutiny.Multi<{{outputType}}> {{methodName}}({{inputType}} request) {
return io.quarkus.grpc.runtime.ClientCalls.{{mutinyCallsMethodName}}(request, delegateStub::{{methodName}});
return io.quarkus.grpc.stubs.ClientCalls.{{mutinyCallsMethodName}}(request, delegateStub::{{methodName}});
}

{{/unaryManyMethods}}
{{#manyUnaryMethods}}
{{{methodHeader}}}
public io.smallrye.mutiny.Uni<{{outputType}}> {{methodName}}(io.smallrye.mutiny.Multi<{{inputType}}> request) {
return io.quarkus.grpc.runtime.ClientCalls.{{mutinyCallsMethodName}}(request, delegateStub::{{methodName}});
return io.quarkus.grpc.stubs.ClientCalls.{{mutinyCallsMethodName}}(request, delegateStub::{{methodName}});
}

{{/manyUnaryMethods}}
{{#manyManyMethods}}
{{{methodHeader}}}
public io.smallrye.mutiny.Multi<{{outputType}}> {{methodName}}(io.smallrye.mutiny.Multi<{{inputType}}> request) {
return io.quarkus.grpc.runtime.ClientCalls.{{mutinyCallsMethodName}}(request, delegateStub::{{methodName}});
return io.quarkus.grpc.stubs.ClientCalls.{{mutinyCallsMethodName}}(request, delegateStub::{{methodName}});
}
{{/manyManyMethods}}
}
Expand Down Expand Up @@ -153,7 +153,7 @@ public final class {{className}} implements io.quarkus.grpc.runtime.MutinyGrpc {
{{#methods}}
{{^isManyInput}}
case METHODID_{{methodNameUpperUnderscore}}:
io.quarkus.grpc.runtime.ServerCalls.{{mutinyCallsMethodName}}(({{inputType}}) request,
io.quarkus.grpc.stubs.ServerCalls.{{mutinyCallsMethodName}}(({{inputType}}) request,
(io.grpc.stub.StreamObserver<{{outputType}}>) responseObserver,
compression,
serviceImpl::{{methodName}});
Expand All @@ -172,7 +172,7 @@ public final class {{className}} implements io.quarkus.grpc.runtime.MutinyGrpc {
{{#methods}}
{{#isManyInput}}
case METHODID_{{methodNameUpperUnderscore}}:
return (io.grpc.stub.StreamObserver<Req>) io.quarkus.grpc.runtime.ServerCalls.{{mutinyCallsMethodName}}(
return (io.grpc.stub.StreamObserver<Req>) io.quarkus.grpc.stubs.ServerCalls.{{mutinyCallsMethodName}}(
(io.grpc.stub.StreamObserver<{{outputType}}>) responseObserver,
serviceImpl::{{methodName}});
{{/isManyInput}}
Expand Down
4 changes: 4 additions & 0 deletions extensions/grpc/runtime/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,10 @@
<groupId>jakarta.annotation</groupId>
<artifactId>jakarta.annotation-api</artifactId>
</dependency>
<dependency>
<groupId>io.quarkus</groupId>
<artifactId>quarkus-grpc-api</artifactId>
</dependency>
<dependency>
<groupId>io.quarkus</groupId>
<artifactId>quarkus-grpc-common</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
import java.util.Set;

import io.grpc.stub.StreamObserver;
import io.quarkus.grpc.runtime.StreamCollector;
import io.quarkus.grpc.stubs.StreamCollector;

public class DevModeStreamsCollector implements StreamCollector {
private final Set<StreamObserver<?>> streamObservers = new HashSet<>();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
import io.grpc.ServerServiceDefinition;
import io.grpc.internal.ServerImpl;
import io.quarkus.dev.testing.GrpcWebSocketProxy;
import io.quarkus.grpc.runtime.ServerCalls;
import io.quarkus.grpc.runtime.StreamCollector;
import io.quarkus.grpc.stubs.ServerCalls;
import io.quarkus.grpc.stubs.StreamCollector;
import io.quarkus.runtime.LaunchMode;
import io.quarkus.runtime.configuration.ProfileManager;
import io.vertx.grpc.VertxServer;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
import javax.interceptor.InvocationContext;

import io.grpc.stub.StreamObserver;
import io.quarkus.grpc.runtime.ServerCalls;
import io.quarkus.grpc.runtime.StreamCollector;
import io.quarkus.grpc.stubs.ServerCalls;
import io.quarkus.grpc.stubs.StreamCollector;

@CollectStreams
@Priority(1)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@

import io.grpc.Status;
import io.grpc.StatusException;
import io.quarkus.grpc.stubs.ClientCalls;
import io.quarkus.grpc.stubs.ServerCalls;
import io.smallrye.mutiny.Multi;
import io.smallrye.mutiny.Uni;

Expand Down
4 changes: 4 additions & 0 deletions extensions/grpc/stubs/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,10 @@
<name>Quarkus - gRPC - Stubs for health and reflection</name>

<dependencies>
<dependency>
<groupId>io.quarkus</groupId>
<artifactId>quarkus-grpc-api</artifactId>
</dependency>
<dependency>
<groupId>io.quarkus</groupId>
<artifactId>quarkus-grpc-codegen</artifactId>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package io.quarkus.grpc.runtime;
package io.quarkus.grpc.stubs;

import java.util.function.BiConsumer;
import java.util.function.Consumer;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package io.quarkus.grpc.runtime;
package io.quarkus.grpc.stubs;

import io.grpc.stub.StreamObserver;
import io.smallrye.mutiny.subscription.MultiEmitter;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package io.quarkus.grpc.runtime;
package io.quarkus.grpc.stubs;

import java.util.function.Consumer;
import java.util.function.Function;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package io.quarkus.grpc.runtime;
package io.quarkus.grpc.stubs;

import io.grpc.stub.StreamObserver;

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

import io.grpc.stub.StreamObserver;
import io.smallrye.mutiny.subscription.UniEmitter;
Expand Down

0 comments on commit 51843c0

Please sign in to comment.