Skip to content

Commit

Permalink
Upgrade Gradle and Gradle plugins (#54)
Browse files Browse the repository at this point in the history
  • Loading branch information
brfrn169 authored Sep 18, 2024
1 parent c053f93 commit e7b45ce
Show file tree
Hide file tree
Showing 5 changed files with 64 additions and 53 deletions.
6 changes: 3 additions & 3 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ plugins {
id 'idea'
id 'application'
id 'java-library-distribution'
id 'com.google.protobuf' version '0.8.8'
id 'com.github.johnrengelman.shadow' version '6.1.0'
id 'com.google.protobuf' version '0.9.1'
id 'com.github.johnrengelman.shadow' version '7.1.2'
id 'com.palantir.docker' version '0.25.0'
}
startScripts.enabled = false
Expand Down Expand Up @@ -34,7 +34,7 @@ dependencies {
implementation "io.grpc:grpc-stub:${grpcVersion}"
implementation "com.google.protobuf:protobuf-java-util:${protobufVersion}"
implementation 'dnsjava:dnsjava:3.6.1'
compileOnly 'javax.annotation:javax.annotation-api:1.2'
implementation 'javax.annotation:javax.annotation-api:1.2'
testImplementation 'junit:junit:4.12'
testImplementation 'org.assertj:assertj-core:3.9.1'
testImplementation 'org.mockito:mockito-core:2.16.0'
Expand Down
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-6.7.1-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-7.6.4-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
89 changes: 53 additions & 36 deletions src/main/grpc/com/scalar/admin/rpc/AdminGrpc.java
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,14 @@
/**
*/
@javax.annotation.Generated(
value = "by gRPC proto compiler (version 1.51.0)",
value = "by gRPC proto compiler (version 1.66.0)",
comments = "Source: scalar/protobuf/admin.proto")
@io.grpc.stub.annotations.GrpcGenerated
public final class AdminGrpc {

private AdminGrpc() {}

public static final String SERVICE_NAME = "rpc.Admin";
public static final java.lang.String SERVICE_NAME = "rpc.Admin";

// Static method descriptors that strictly reflect the proto.
private static volatile io.grpc.MethodDescriptor<com.scalar.admin.rpc.PauseRequest,
Expand Down Expand Up @@ -154,59 +154,46 @@ public AdminFutureStub newStub(io.grpc.Channel channel, io.grpc.CallOptions call

/**
*/
public static abstract class AdminImplBase implements io.grpc.BindableService {
public interface AsyncService {

/**
*/
public void pause(com.scalar.admin.rpc.PauseRequest request,
default void pause(com.scalar.admin.rpc.PauseRequest request,
io.grpc.stub.StreamObserver<com.google.protobuf.Empty> responseObserver) {
io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getPauseMethod(), responseObserver);
}

/**
*/
public void unpause(com.google.protobuf.Empty request,
default void unpause(com.google.protobuf.Empty request,
io.grpc.stub.StreamObserver<com.google.protobuf.Empty> responseObserver) {
io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getUnpauseMethod(), responseObserver);
}

/**
*/
public void checkPaused(com.google.protobuf.Empty request,
default void checkPaused(com.google.protobuf.Empty request,
io.grpc.stub.StreamObserver<com.scalar.admin.rpc.CheckPausedResponse> responseObserver) {
io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getCheckPausedMethod(), responseObserver);
}
}

/**
* Base class for the server implementation of the service Admin.
*/
public static abstract class AdminImplBase
implements io.grpc.BindableService, AsyncService {

@java.lang.Override public final io.grpc.ServerServiceDefinition bindService() {
return io.grpc.ServerServiceDefinition.builder(getServiceDescriptor())
.addMethod(
getPauseMethod(),
io.grpc.stub.ServerCalls.asyncUnaryCall(
new MethodHandlers<
com.scalar.admin.rpc.PauseRequest,
com.google.protobuf.Empty>(
this, METHODID_PAUSE)))
.addMethod(
getUnpauseMethod(),
io.grpc.stub.ServerCalls.asyncUnaryCall(
new MethodHandlers<
com.google.protobuf.Empty,
com.google.protobuf.Empty>(
this, METHODID_UNPAUSE)))
.addMethod(
getCheckPausedMethod(),
io.grpc.stub.ServerCalls.asyncUnaryCall(
new MethodHandlers<
com.google.protobuf.Empty,
com.scalar.admin.rpc.CheckPausedResponse>(
this, METHODID_CHECK_PAUSED)))
.build();
return AdminGrpc.bindService(this);
}
}

/**
* A stub to allow clients to do asynchronous rpc calls to service Admin.
*/
public static final class AdminStub extends io.grpc.stub.AbstractAsyncStub<AdminStub> {
public static final class AdminStub
extends io.grpc.stub.AbstractAsyncStub<AdminStub> {
private AdminStub(
io.grpc.Channel channel, io.grpc.CallOptions callOptions) {
super(channel, callOptions);
Expand Down Expand Up @@ -244,8 +231,10 @@ public void checkPaused(com.google.protobuf.Empty request,
}

/**
* A stub to allow clients to do synchronous rpc calls to service Admin.
*/
public static final class AdminBlockingStub extends io.grpc.stub.AbstractBlockingStub<AdminBlockingStub> {
public static final class AdminBlockingStub
extends io.grpc.stub.AbstractBlockingStub<AdminBlockingStub> {
private AdminBlockingStub(
io.grpc.Channel channel, io.grpc.CallOptions callOptions) {
super(channel, callOptions);
Expand Down Expand Up @@ -280,8 +269,10 @@ public com.scalar.admin.rpc.CheckPausedResponse checkPaused(com.google.protobuf.
}

/**
* A stub to allow clients to do ListenableFuture-style rpc calls to service Admin.
*/
public static final class AdminFutureStub extends io.grpc.stub.AbstractFutureStub<AdminFutureStub> {
public static final class AdminFutureStub
extends io.grpc.stub.AbstractFutureStub<AdminFutureStub> {
private AdminFutureStub(
io.grpc.Channel channel, io.grpc.CallOptions callOptions) {
super(channel, callOptions);
Expand Down Expand Up @@ -327,10 +318,10 @@ private static final class MethodHandlers<Req, Resp> implements
io.grpc.stub.ServerCalls.ServerStreamingMethod<Req, Resp>,
io.grpc.stub.ServerCalls.ClientStreamingMethod<Req, Resp>,
io.grpc.stub.ServerCalls.BidiStreamingMethod<Req, Resp> {
private final AdminImplBase serviceImpl;
private final AsyncService serviceImpl;
private final int methodId;

MethodHandlers(AdminImplBase serviceImpl, int methodId) {
MethodHandlers(AsyncService serviceImpl, int methodId) {
this.serviceImpl = serviceImpl;
this.methodId = methodId;
}
Expand Down Expand Up @@ -367,6 +358,32 @@ public io.grpc.stub.StreamObserver<Req> invoke(
}
}

public static final io.grpc.ServerServiceDefinition bindService(AsyncService service) {
return io.grpc.ServerServiceDefinition.builder(getServiceDescriptor())
.addMethod(
getPauseMethod(),
io.grpc.stub.ServerCalls.asyncUnaryCall(
new MethodHandlers<
com.scalar.admin.rpc.PauseRequest,
com.google.protobuf.Empty>(
service, METHODID_PAUSE)))
.addMethod(
getUnpauseMethod(),
io.grpc.stub.ServerCalls.asyncUnaryCall(
new MethodHandlers<
com.google.protobuf.Empty,
com.google.protobuf.Empty>(
service, METHODID_UNPAUSE)))
.addMethod(
getCheckPausedMethod(),
io.grpc.stub.ServerCalls.asyncUnaryCall(
new MethodHandlers<
com.google.protobuf.Empty,
com.scalar.admin.rpc.CheckPausedResponse>(
service, METHODID_CHECK_PAUSED)))
.build();
}

private static abstract class AdminBaseDescriptorSupplier
implements io.grpc.protobuf.ProtoFileDescriptorSupplier, io.grpc.protobuf.ProtoServiceDescriptorSupplier {
AdminBaseDescriptorSupplier() {}
Expand All @@ -390,9 +407,9 @@ private static final class AdminFileDescriptorSupplier
private static final class AdminMethodDescriptorSupplier
extends AdminBaseDescriptorSupplier
implements io.grpc.protobuf.ProtoMethodDescriptorSupplier {
private final String methodName;
private final java.lang.String methodName;

AdminMethodDescriptorSupplier(String methodName) {
AdminMethodDescriptorSupplier(java.lang.String methodName) {
this.methodName = methodName;
}

Expand Down
9 changes: 3 additions & 6 deletions src/main/java/com/scalar/admin/rpc/CheckPausedResponse.java

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

11 changes: 4 additions & 7 deletions src/main/java/com/scalar/admin/rpc/PauseRequest.java

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit e7b45ce

Please sign in to comment.