Skip to content

Commit

Permalink
generate multiple java files
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
vroldanbet committed Mar 25, 2024
1 parent 895d1dd commit bf590f1
Show file tree
Hide file tree
Showing 8 changed files with 8 additions and 0 deletions.
1 change: 1 addition & 0 deletions authzed/api/v1/core.proto
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Check failure on line 6 in authzed/api/v1/core.proto

View workflow job for this annotation

GitHub Actions / Lint

File option "java_multiple_files" changed from "false" to "true".

import "google/protobuf/struct.proto";
import "validate/validate.proto";
Expand Down
1 change: 1 addition & 0 deletions authzed/api/v1/debug.proto
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Check failure on line 11 in authzed/api/v1/debug.proto

View workflow job for this annotation

GitHub Actions / Lint

File option "java_multiple_files" changed from "false" to "true".

// DebugInformation defines debug information returned by an API call in a footer when
// requested with a specific debugging header.
Expand Down
1 change: 1 addition & 0 deletions authzed/api/v1/error_reason.proto
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Check failure on line 6 in authzed/api/v1/error_reason.proto

View workflow job for this annotation

GitHub Actions / Lint

File option "java_multiple_files" changed from "false" to "true".

// Defines the supported values for `google.rpc.ErrorInfo.reason` for the
// `authzed.com` error domain.
Expand Down
1 change: 1 addition & 0 deletions authzed/api/v1/experimental_service.proto
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Check failure on line 6 in authzed/api/v1/experimental_service.proto

View workflow job for this annotation

GitHub Actions / Lint

File option "java_multiple_files" changed from "false" to "true".

import "google/api/annotations.proto";
import "validate/validate.proto";
Expand Down
1 change: 1 addition & 0 deletions authzed/api/v1/openapi.proto
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Check failure on line 6 in authzed/api/v1/openapi.proto

View workflow job for this annotation

GitHub Actions / Lint

File option "java_multiple_files" changed from "false" to "true".

import "protoc-gen-openapiv2/options/annotations.proto";

Expand Down
1 change: 1 addition & 0 deletions authzed/api/v1/permission_service.proto
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Check failure on line 6 in authzed/api/v1/permission_service.proto

View workflow job for this annotation

GitHub Actions / Lint

File option "java_multiple_files" changed from "false" to "true".

import "google/protobuf/struct.proto";
import "google/api/annotations.proto";
Expand Down
1 change: 1 addition & 0 deletions authzed/api/v1/schema_service.proto
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Check failure on line 6 in authzed/api/v1/schema_service.proto

View workflow job for this annotation

GitHub Actions / Lint

File option "java_multiple_files" changed from "false" to "true".

import "google/api/annotations.proto";
import "validate/validate.proto";
Expand Down
1 change: 1 addition & 0 deletions authzed/api/v1/watch_service.proto
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Check failure on line 6 in authzed/api/v1/watch_service.proto

View workflow job for this annotation

GitHub Actions / Lint

File option "java_multiple_files" changed from "false" to "true".

import "google/api/annotations.proto";
import "validate/validate.proto";
Expand Down

0 comments on commit bf590f1

Please sign in to comment.