Introduce PipelineSetup testing utility#230
Merged
alexander-yevsyukov merged 49 commits intomasterfrom May 9, 2024
Merged
Conversation
Also: * Introduce `protodata-testlib` module. * Open access to `SettingsDirectory.directory` property.
Also: * Migrate `FormatSpec` to Kotest assertions.
Also: * Fix doc language grammar and punctuation.
Also: * Exclude unnecessary files from fat JAR.
Also: * Add general description for the `PipelineSetup`. * Improve parameter names.
Also: * Add `@see` links.
armiol
requested changes
May 9, 2024
Collaborator
armiol
left a comment
There was a problem hiding this comment.
@alexander-yevsyukov LGTM with some comments.
buildSrc/src/main/kotlin/io/spine/internal/gradle/kotlin/KotlinConfig.kt
Show resolved
Hide resolved
testlib/src/main/kotlin/io/spine/protodata/testing/PipelineSetup.kt
Outdated
Show resolved
Hide resolved
Also: * Improve layout of code blocks. * Fix misspelling.
armiol
approved these changes
May 9, 2024
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
This PR initiates
protodata-testlibartifact with thePipelineSetuputility.Code generation process for a ProtoData plugin requires an instance of
Pipeline.Its constructor accepts
CodeGeneratorRequestinstance.There are simplest cases of code generation (e.g.
TypeAnnotationand derived classes) that do not require much from the information coming fromprotoc. For such cases we can passCodeGeneratorRequest.getDefaultInstance(). More sophisticated codegen needs a legitimateCodeGeneratorRequestbecausePipelineproduces numerous events about the Protobuf code out of it.PipelineSetupclass can be created in two ways. The first way, through the primary constructor, is for the rare cases of having the generated code andCodeGeneratorRequestinstance already available some way. The second, recommended, way is through the factory methodbyResources, which assumes having ProtoTap Gradle Plugin added to the project. Please see the documentation for thePipelineSetupclass for more details.Other notable changes
SettingsDirectory.directoryproperty was renamed topathfor better readability at the use sites.Formatenum items were sorted in the order from most to least expected.main()of the ProtoDataprotocplugin.