-
Notifications
You must be signed in to change notification settings - Fork 14
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Final updates to runtime and codegen fixes #352
Merged
Merged
Changes from all commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
f4d07c3
some updates
andrewparmet 6dbb5df
more fixes
andrewparmet a92ca56
more
andrewparmet f20d92c
some revert
andrewparmet 0c93cb9
compilation
andrewparmet c4fd49a
api dump
andrewparmet 02e2b2c
fix
andrewparmet c0ef0a8
fix tests
andrewparmet 4afdad2
add another test
andrewparmet 50142b6
put back non-null option as an accessor on oneof fields
andrewparmet bd2aa21
fixes
andrewparmet efa76b0
put back old files for backwards compatibility
andrewparmet 431d5a1
lint
andrewparmet File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
/* | ||
* Copyright (c) 2020 Toast, Inc. | ||
* Copyright (c) 2022 Toast, Inc. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
|
@@ -13,6 +13,4 @@ | |
* limitations under the License. | ||
*/ | ||
|
||
subprojects { | ||
group = "${rootProject.group}.thirdparty" | ||
} | ||
group = "com.toasttab.protokt.thirdparty" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This was getting clobbered by the common-conventions plugin - we've been publishing to the wrong group since that change went in. |
305 changes: 304 additions & 1 deletion
305
extensions/protokt-extensions-lite/api/protokt-extensions-lite.api
Large diffs are not rendered by default.
Oops, something went wrong.
219 changes: 219 additions & 0 deletions
219
extensions/protokt-extensions-lite/src/extensions-proto/protokt/protokt.proto
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,219 @@ | ||
/* | ||
* Copyright (c) 2019 Toast, Inc. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
syntax = "proto3"; | ||
|
||
package protokt; | ||
|
||
import "google/protobuf/descriptor.proto"; | ||
|
||
option java_package = "com.toasttab.protokt.ext"; | ||
option java_outer_classname = "ProtoktProto"; | ||
|
||
option deprecated = true; | ||
|
||
message ProtoktFileOptions { | ||
option deprecated = true; | ||
|
||
// Specify the Kotlin package for the generated file. Precedence is given | ||
// first to this Kotlin package, then to the Java package if enabled in | ||
// the plugin options, and finally to the protobuf package. | ||
string kotlin_package = 1 [deprecated = true]; | ||
|
||
// Specify the name of the Kotlin object that contains the reference to this | ||
// file's FileDescriptor object. | ||
string file_descriptor_object_name = 2 [deprecated = true]; | ||
} | ||
|
||
extend google.protobuf.FileOptions { | ||
ProtoktFileOptions file = 1072 [deprecated = true]; | ||
} | ||
|
||
message ProtoktMessageOptions { | ||
option deprecated = true; | ||
|
||
// Declares that the message class implements an interface. Scoping rules | ||
// are the same as those for declaring wrapper types. | ||
string implements = 1 [deprecated = true]; | ||
|
||
// Provides a message for deprecation | ||
string deprecation_message = 2 [deprecated = true]; | ||
} | ||
|
||
extend google.protobuf.MessageOptions { | ||
ProtoktMessageOptions class = 1072 [deprecated = true]; | ||
} | ||
|
||
message ProtoktFieldOptions { | ||
option deprecated = true; | ||
|
||
// Makes a message-type field non-nullable in the generated Kotlin code. | ||
// Beware that deserialization will NPE if the field is missing from the | ||
// protobuf payload. Adding a non-null field to an existing message is a | ||
// backwards-incompatible change. | ||
// | ||
// For example: | ||
// | ||
// message Foo { | ||
// string id = 1 [(protokt.property).non_null = true]; | ||
// } | ||
bool non_null = 1 [deprecated = true]; | ||
|
||
// Expose a wrapper class instead of a raw protobuf type. | ||
// | ||
// For example: | ||
// | ||
// message Foo { | ||
// string id = 1 [(protokt.property).wrap = "com.foo.FooId"]; | ||
// } | ||
// | ||
// data class FooId(val value: String) | ||
// | ||
// will yield: | ||
// class Foo(val id: FooId) ... | ||
// | ||
// If the Kotlin package (or Java package, if the Kotlin package is | ||
// unspecified) of this file is the same as the package of the wrapper type, | ||
// full qualification is optional. | ||
// | ||
// This option can be applied to repeated fields. | ||
string wrap = 2 [deprecated = true]; | ||
|
||
// Maps a bytes field to BytesSlice. If deserialized from a byte array, | ||
// BytesSlice will point to the source array without copying the subarray. | ||
bool bytes_slice = 3 [deprecated = true]; | ||
|
||
// Provides a message for deprecation | ||
string deprecation_message = 4 [deprecated = true]; | ||
|
||
// Expose a wrapper class instead of a raw protobuf type for the key type of | ||
// a map. | ||
// | ||
// For example: | ||
// | ||
// message Foo { | ||
// map<string, int32> map = 1 [(protokt.property).key_wrap = "com.foo.FooId"]; | ||
// } | ||
// | ||
// data class FooId(val value: String) | ||
// | ||
// will yield: | ||
// class Foo(val map: Map<FooId, String>) ... | ||
// | ||
// Scoping rules are the same as those for declaring regular field wrapper types. | ||
string key_wrap = 5 [deprecated = true]; | ||
|
||
// Expose a wrapper class instead of a raw protobuf type for the value type of | ||
// a map. | ||
// | ||
// For example: | ||
// | ||
// message Foo { | ||
// map<int32, strig> map = 1 [(protokt.property).value_wrap = "com.foo.FooId"]; | ||
// } | ||
// | ||
// data class FooId(val value: String) | ||
// | ||
// will yield: | ||
// class Foo(val map: Map<Int, FooId>) ... | ||
// | ||
// Scoping rules are the same as those for declaring regular field wrapper types. | ||
string value_wrap = 6 [deprecated = true]; | ||
} | ||
|
||
extend google.protobuf.FieldOptions { | ||
ProtoktFieldOptions property = 1072 [deprecated = true]; | ||
} | ||
|
||
message ProtoktOneofOptions { | ||
option deprecated = true; | ||
|
||
// Makes a oneof field non-nullable in generated Kotlin code. Beware that | ||
// deserialization will NPE if the field is missing from the protobuf payload. | ||
// Adding a non-null field to an existing message is a backwards-incompatible | ||
// change. | ||
// | ||
// For example: | ||
// | ||
// message Message { | ||
// oneof some_field_name { | ||
// option (protokt.oneof).non_null = true; | ||
// | ||
// string id = 1; | ||
// } | ||
// } | ||
// | ||
bool non_null = 1 [deprecated = true]; | ||
|
||
// Make the sealed class implement an interface, enforcing the presence of a | ||
// property in each possible variant. Scoping rules are the same as those | ||
// for declaring wrapper types. | ||
string implements = 2 [deprecated = true]; | ||
|
||
// Provides a message for deprecation | ||
string deprecation_message = 3 [deprecated = true]; | ||
} | ||
|
||
extend google.protobuf.OneofOptions { | ||
ProtoktOneofOptions oneof = 1072 [deprecated = true]; | ||
} | ||
|
||
message ProtoktEnumOptions { | ||
option deprecated = true; | ||
|
||
// Provides a message for deprecation | ||
string deprecation_message = 1 [deprecated = true]; | ||
} | ||
|
||
extend google.protobuf.EnumOptions { | ||
ProtoktEnumOptions enum = 1072 [deprecated = true]; | ||
} | ||
|
||
message ProtoktEnumValueOptions { | ||
option deprecated = true; | ||
|
||
// Provides a message for deprecation | ||
string deprecation_message = 1 [deprecated = true]; | ||
} | ||
|
||
extend google.protobuf.EnumValueOptions { | ||
ProtoktEnumValueOptions enum_value = 1072 [deprecated = true]; | ||
} | ||
|
||
message ProtoktServiceOptions { | ||
option deprecated = true; | ||
} | ||
|
||
extend google.protobuf.ServiceOptions { | ||
ProtoktServiceOptions service = 1072 [deprecated = true]; | ||
} | ||
|
||
message ProtoktMethodOptions { | ||
option deprecated = true; | ||
|
||
// Provides a custom request marshaller for the generated method descriptor. | ||
// Substitutes the provided expression directly for | ||
// `com.toasttab.protokt.grpc.KtMarshaller(<request_type>)` | ||
string request_marshaller = 1 [deprecated = true]; | ||
|
||
// Provides a custom response marshaller for the generated method descriptor. | ||
// Substitutes the provided expression directly for | ||
// `com.toasttab.protokt.grpc.KtMarshaller(<response_type>)` | ||
string response_marshaller = 2 [deprecated = true]; | ||
} | ||
|
||
extend google.protobuf.MethodOptions { | ||
ProtoktMethodOptions method = 1072 [deprecated = true]; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is the default value.