From bf590f114c4a8ed705a019a2b886e3e405d72447 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADctor=20Rold=C3=A1n=20Betancort?= Date: Mon, 25 Mar 2024 08:38:32 +0000 Subject: [PATCH] generate multiple java files From https://protobuf.dev/reference/java/java-generated/#invocation When the option java_multiple_files = true is enabled, Then the compiler will also create separate .java files for each of the classes/enums which it will generate for each top-level message, enumeration, and service declared in the .proto file. The goal is to have this option stop generating "OuterClass" named classes for better ergonomics. --- authzed/api/v1/core.proto | 1 + authzed/api/v1/debug.proto | 1 + authzed/api/v1/error_reason.proto | 1 + authzed/api/v1/experimental_service.proto | 1 + authzed/api/v1/openapi.proto | 1 + authzed/api/v1/permission_service.proto | 1 + authzed/api/v1/schema_service.proto | 1 + authzed/api/v1/watch_service.proto | 1 + 8 files changed, 8 insertions(+) diff --git a/authzed/api/v1/core.proto b/authzed/api/v1/core.proto index 72d98d2..1e67cab 100644 --- a/authzed/api/v1/core.proto +++ b/authzed/api/v1/core.proto @@ -3,6 +3,7 @@ package authzed.api.v1; option go_package = "github.com/authzed/authzed-go/proto/authzed/api/v1"; option java_package = "com.authzed.api.v1"; +option java_multiple_files = true; import "google/protobuf/struct.proto"; import "validate/validate.proto"; diff --git a/authzed/api/v1/debug.proto b/authzed/api/v1/debug.proto index f17cbcf..3f72f0a 100644 --- a/authzed/api/v1/debug.proto +++ b/authzed/api/v1/debug.proto @@ -8,6 +8,7 @@ import "google/protobuf/duration.proto"; option go_package = "github.com/authzed/authzed-go/proto/authzed/api/v1"; option java_package = "com.authzed.api.v1"; +option java_multiple_files = true; // DebugInformation defines debug information returned by an API call in a footer when // requested with a specific debugging header. diff --git a/authzed/api/v1/error_reason.proto b/authzed/api/v1/error_reason.proto index 1526852..b6cb014 100644 --- a/authzed/api/v1/error_reason.proto +++ b/authzed/api/v1/error_reason.proto @@ -3,6 +3,7 @@ package authzed.api.v1; option go_package = "github.com/authzed/authzed-go/proto/authzed/api/v1"; option java_package = "com.authzed.api.v1"; +option java_multiple_files = true; // Defines the supported values for `google.rpc.ErrorInfo.reason` for the // `authzed.com` error domain. diff --git a/authzed/api/v1/experimental_service.proto b/authzed/api/v1/experimental_service.proto index d24e1c8..8e5990a 100644 --- a/authzed/api/v1/experimental_service.proto +++ b/authzed/api/v1/experimental_service.proto @@ -3,6 +3,7 @@ package authzed.api.v1; option go_package = "github.com/authzed/authzed-go/proto/authzed/api/v1"; option java_package = "com.authzed.api.v1"; +option java_multiple_files = true; import "google/api/annotations.proto"; import "validate/validate.proto"; diff --git a/authzed/api/v1/openapi.proto b/authzed/api/v1/openapi.proto index 693f52a..d6bcbff 100644 --- a/authzed/api/v1/openapi.proto +++ b/authzed/api/v1/openapi.proto @@ -3,6 +3,7 @@ package authzed.api.v1; option go_package = "github.com/authzed/authzed-go/proto/authzed/api/v1"; option java_package = "com.authzed.api.v1"; +option java_multiple_files = true; import "protoc-gen-openapiv2/options/annotations.proto"; diff --git a/authzed/api/v1/permission_service.proto b/authzed/api/v1/permission_service.proto index 22afeea..9ad6c33 100644 --- a/authzed/api/v1/permission_service.proto +++ b/authzed/api/v1/permission_service.proto @@ -3,6 +3,7 @@ package authzed.api.v1; option go_package = "github.com/authzed/authzed-go/proto/authzed/api/v1"; option java_package = "com.authzed.api.v1"; +option java_multiple_files = true; import "google/protobuf/struct.proto"; import "google/api/annotations.proto"; diff --git a/authzed/api/v1/schema_service.proto b/authzed/api/v1/schema_service.proto index e13f554..08c3a66 100644 --- a/authzed/api/v1/schema_service.proto +++ b/authzed/api/v1/schema_service.proto @@ -3,6 +3,7 @@ package authzed.api.v1; option go_package = "github.com/authzed/authzed-go/proto/authzed/api/v1"; option java_package = "com.authzed.api.v1"; +option java_multiple_files = true; import "google/api/annotations.proto"; import "validate/validate.proto"; diff --git a/authzed/api/v1/watch_service.proto b/authzed/api/v1/watch_service.proto index f8f49df..263985e 100644 --- a/authzed/api/v1/watch_service.proto +++ b/authzed/api/v1/watch_service.proto @@ -3,6 +3,7 @@ package authzed.api.v1; option go_package = "github.com/authzed/authzed-go/proto/authzed/api/v1"; option java_package = "com.authzed.api.v1"; +option java_multiple_files = true; import "google/api/annotations.proto"; import "validate/validate.proto";