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

Init project #1

Merged
merged 39 commits into from
May 1, 2024
Merged

Init project #1

merged 39 commits into from
May 1, 2024

Conversation

alexander-yevsyukov
Copy link
Contributor

@alexander-yevsyukov alexander-yevsyukov commented Apr 26, 2024

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:

  1. api — constants and functions common to all modules.
  2. gradle-plugin — the Protobuf plugin which taps Protobuf Gradle plugin.
  3. protoc-plugin — the plugin to protoc responsible for tapping CodeGeneratorRequest.

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 the 1.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.

@alexander-yevsyukov alexander-yevsyukov self-assigned this Apr 26, 2024
@alexander-yevsyukov alexander-yevsyukov marked this pull request as ready for review April 30, 2024 19:40
Copy link

@armiol armiol left a 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 {
Copy link

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
}

Copy link

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)
Copy link

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)
}

Copy link

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.
Copy link

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.

@alexander-yevsyukov alexander-yevsyukov merged commit 1883bd0 into master May 1, 2024
6 checks passed
@alexander-yevsyukov alexander-yevsyukov deleted the init-project branch May 1, 2024 14:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants