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

Separate modules for plugin and ProtoData model #3

Merged
merged 10 commits into from
Oct 26, 2023
Merged

Conversation

Oleg-Melnik
Copy link
Contributor

@Oleg-Melnik Oleg-Melnik commented Oct 23, 2023

This PR introduces two separate modules: one for the Protobuf definitions and the other for the plugin itself. This is necessary because the ProtoData plugin should be compiled and deployed before the ProtoData model can be processed.

@Oleg-Melnik Oleg-Melnik self-assigned this Oct 23, 2023
@Oleg-Melnik Oleg-Melnik changed the title Codegen plugin Sparate modules for plugin and protodata model Oct 23, 2023
@Oleg-Melnik Oleg-Melnik requested a review from armiol October 23, 2023 15:26
@Oleg-Melnik Oleg-Melnik marked this pull request as ready for review October 23, 2023 15:28
@armiol armiol changed the title Sparate modules for plugin and protodata model Separate modules for plugin and ProtoData model Oct 24, 2023
Copy link
Contributor

@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.

@Oleg-Melnik please see my comments.

Also, "ProtoData" is a name of the library. I have fixed the original PR title, but please address the typo in the PR description.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's put this file back.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

/**
* The alias for typed extensions functions related to modules of this project.
*/
typealias Module = Project
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Most (if not all) of the settings from here down, are applicable to both Gradle modules. Let's move them back to the root build.gradle.kts, and apply them to sub-projects.

Ideally, model should just speak of Protobuf settings and ProtoData.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

@Oleg-Melnik Oleg-Melnik requested a review from armiol October 26, 2023 11:03
@armiol
Copy link
Contributor

armiol commented Oct 26, 2023

@Oleg-Melnik Let's fix the PR description: we don't have any "prototype definitions". We have Protobuf definitions.

Copy link
Contributor

@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.

@Oleg-Melnik LGTM with some minor comments to address prior to merging.

build.gradle.kts Outdated
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile

object BuildSettings {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In Gradle, buildscript section is a special one. It tells how to perform the build itself in terms of classpath etc. One should think of it as of a configuration for Gradle, so to speak. It is also isolated from the rest of the build in classpath, imports and variables.

In plugins sections our allowed actions are also limited. For instance, AFAIK, we cannot use external variables inside of it.

Therefore I suggest to move BuildSettings to go even after plugins, right before the actual code which we write to describe the build stages.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

build.gradle.kts Outdated
}

/**
* The alias for typed extensions functions related to modules of this project.
*/
typealias Module = Project

project.run {
fun Module.applyConfiguration() {
configureJava()
configureKotlin()
setupTests()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think, that's a typo in the original PR. It should be setUpTests (where "set up" is a verb), not setup (where "setup" is a noun).

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

@Oleg-Melnik Oleg-Melnik merged commit ceb3eb7 into master Oct 26, 2023
2 checks passed
@Oleg-Melnik Oleg-Melnik deleted the codegen-plugin branch October 26, 2023 11:52
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