Skip to content
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

Remove importresolver package #5

Merged
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
7beadd7
Use 4 spaces instead of 2 for default indent
pranjalvachaspati-toast Oct 12, 2021
5665e73
Remove message.stg
pranjalvachaspati-toast Oct 13, 2021
2cc5b3a
Remove Descriptor template
pranjalvachaspati-toast Oct 13, 2021
7ecc79f
Remove Descriptor template
pranjalvachaspati-toast Oct 13, 2021
14bd064
Remove dead code in header template and most of services template.
pranjalvachaspati-toast Oct 13, 2021
0861dcd
Set locale for decapitalize to get rid of compiler warning.
pranjalvachaspati-toast Oct 13, 2021
1cca8d0
Remove unused templates
pranjalvachaspati-toast Oct 13, 2021
151e25c
Create subpackage for annotators.
pranjalvachaspati-toast Oct 13, 2021
945b990
Merge branch 'kotlinpoet' of https://github.com/andrewparmet/protokt …
pranjalvachaspati-toast Oct 13, 2021
e24fb1d
Move methodType to kotlinpoet and get rid of services.stg
pranjalvachaspati-toast Oct 13, 2021
0369624
Remove Oneof stringtemplates.
pranjalvachaspati-toast Oct 13, 2021
5964ab4
Get rid of a couple renderers
pranjalvachaspati-toast Oct 13, 2021
46839ce
Migrate boxing & default value renderers away from StringTemplate.
pranjalvachaspati-toast Oct 14, 2021
f12ca3c
Remove sizeof stringtemplates.
pranjalvachaspati-toast Oct 15, 2021
9981c53
Add non-stringtemplate serializer generation
pranjalvachaspati-toast Oct 15, 2021
ec526a1
Get rid of renderers stringtemplate
pranjalvachaspati-toast Oct 15, 2021
91accd6
Remove options stringtemplate
pranjalvachaspati-toast Oct 15, 2021
8aec02e
--amend
pranjalvachaspati-toast Oct 15, 2021
8223782
Merge branch 'kotlinpoet' of https://github.com/andrewparmet/protokt …
pranjalvachaspati-toast Oct 15, 2021
4f4d40a
Convert deserializer to use kotlinpoet
pranjalvachaspati-toast Oct 16, 2021
d4af5e5
Create packages for import resolution and descriptor stuff
pranjalvachaspati-toast Oct 16, 2021
f38ffed
Create packages for import resolution and descriptor stuff
pranjalvachaspati-toast Oct 16, 2021
2125158
This merge required some additional changes - mostly changing Strings…
pranjalvachaspati-toast Oct 18, 2021
9b264a3
Additional changes from Strings to CodeBlocks
pranjalvachaspati-toast Oct 18, 2021
8bb76ce
Disable non-kotlinpoet import resolution
pranjalvachaspati-toast Oct 18, 2021
db9d992
Remove importresolution package
pranjalvachaspati-toast Oct 18, 2021
764782c
Merge branch 'kotlinpoet' of https://github.com/andrewparmet/protokt …
pranjalvachaspati-toast Oct 18, 2021
1f53989
Make fixes for PR comments
pranjalvachaspati-toast Oct 19, 2021
e84eae0
Use DSL typename in DeserializerAnnotator
pranjalvachaspati-toast Oct 19, 2021
a4193df
Remove dependency on stringtemplate
pranjalvachaspati-toast Oct 19, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Remove Descriptor template
  • Loading branch information
pranjalvachaspati-toast committed Oct 13, 2021
commit 7ecc79f6981f44501b7ccd54c72f8c94331c3713
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,9 @@ import com.toasttab.protokt.codegen.protoc.Service
import com.toasttab.protokt.codegen.protoc.TopLevelType
import com.toasttab.protokt.codegen.protoc.TypeDesc

/**
* Annotates an unannotated AST. This effectively converts the protobuf AST to a Kotlin AST.
*/
object Annotator {
const val rootGoogleProto = "google.protobuf"
const val googleProto = ".google.protobuf"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,9 @@ import com.toasttab.protokt.codegen.template.Renderers.DefaultValue
import com.toasttab.protokt.codegen.template.Renderers.Standard
import com.toasttab.protokt.codegen.template.Oneof as OneofTemplate

/**
*
*/
internal class PropertyAnnotator
private constructor(
private val msg: Message,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,9 @@ import com.toasttab.protokt.codegen.model.FieldType
import com.toasttab.protokt.codegen.model.PClass
import com.toasttab.protokt.ext.Protokt

/**
* Converts a message in the format used by protoc to the unannotated AST used by protokt.
*/
fun toProtocol(ctx: ProtocolContext) =
Protocol(
FileDesc(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@ import com.toasttab.protokt.codegen.model.PClass
object Message {
object Message {

/**
* Contains metadata about the message. Does not contain information about the contents of the message.
*/
class MessageInfo(
val name: String,
val doesImplement: Boolean,
Expand All @@ -35,6 +38,9 @@ object Message {
val name: String
}

/**
* Contains type information about a protobuf field (or oneof) that is relevant to the Kotlin interface
*/
class PropertyInfo(
override val name: String,
val propertyType: String,
Expand All @@ -54,6 +60,9 @@ object Message {
val deprecation: Deprecation.RenderOptions? = null
) : FieldInfo

/**
* Information relevant to reading and writing a message (and other stuff outside the standard access interface?)
*/
interface FieldWriteInfo : FieldInfo {
val fieldName: String
val conditionals: List<ConditionalParams>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ sealed class StGroup {
val fileName
get() = "${this::class.java.simpleName.decapitalize()}.stg"

object Descriptor : StGroup()
object Header : StGroup()
object Oneof : StGroup()
object Options : StGroup()
Expand Down