-
Notifications
You must be signed in to change notification settings - Fork 0
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
Init project #1
Init project #1
Conversation
Also: * Remove unnecessary test suite. We're going to use `test` only. * Ensure task dependencies (just in case).
Also: * Add `prototap` tag to the Gradle plugin.
Also: * Suppress and document detekt warnings.
Also: * Document `Extension`. * Improve documentation of name constants. * Avoid star imports.
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.
@alexander-yevsyukov LGTM in general. Please see some comments.
import java.nio.file.Paths | ||
import kotlin.io.path.pathString | ||
|
||
public object Paths { |
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.
Please document.
public fun outputFile(buildDir: String, shortFileName: String): String = | ||
outputRoot(buildDir).resolve(shortFileName).pathString | ||
} | ||
|
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 line is redundant.
.withSharedTestKitDirectory() | ||
.replace("@PROTOTAP_PLUGIN_ID@", GRADLE_PLUGIN_ID) | ||
.replace("@PROTOTAP_VERSION@", version) | ||
//.withLoggingLevel(LogLevel.INFO) |
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.
I would move this line under //.enableRunnerDebug()
, because it also makes sense when investigating some issue, such as a test failure.
val bytes = Base64.getDecoder().decode(this) | ||
return String(bytes, UTF_8) | ||
} | ||
|
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 line is redundant.
import kotlin.text.Charsets.UTF_8 | ||
|
||
/** | ||
* Stores the received `CodeGeneratorRequest` to the file passed as the parameter. |
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.
I can see we do System.out.write(emptyResponse.toByteArray())
, and I don't understand how it is connected to "... file passed as the parameter."
Something doesn't feel right here. Please review.
Also: * Use encoded writing for `CodeGeneratorResponse`. This is how older McJava codegen does this. It's also what [protoc docs](https://protobuf.dev/reference/cpp/api-docs/google.protobuf.compiler.plugin.pb/) tell about it.
This PR initiates the project, providing first pre-1.0.0 draft for the implementation. The project uses the same development approach as the rest of Spine SDK sub-projects based on
config
submodule. Hence, the number of files in this PR.Basic architecture
The ProtoTap consists of the following modules:
api
— constants and functions common to all modules.gradle-plugin
— the Protobuf plugin which taps Protobuf Gradle plugin.protoc-plugin
— the plugin toprotoc
responsible for tappingCodeGeneratorRequest
.Please see
README.md
for details on the usage of the Gradle plugin.Version and publishing
The version selected for this PR is
0.8.0
meaning we expect that some changes may come from the usage experience before we put the1.0.0
stamp on the thing. Though, we don't expect too many of them.The version we put is not a snapshot, so the Gradle plugin is going to be submitted to Gradle Plugin portal, and since it is a new plugin, we expect the approval process.
Unlike ProtoData, ProtoTap uses newer (
1.2.1
) version of the com.gradle.plugin-publish plugin with shorter DSL. The procedure of the approval may also differ.