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

Add kotlin protoc built-in when Java or Kotlin are enabled in a project #87

Merged
merged 50 commits into from
Oct 19, 2022

Conversation

alexander-yevsyukov
Copy link
Collaborator

@alexander-yevsyukov alexander-yevsyukov commented Oct 15, 2022

This PR teached ProtoData Gradle Plugin to turn kotlin protoc built-in when Java or Kotlin enabled in a project.

When working on this PR the issue of incompatibility with Android projects was discovered. We need to address it before the stable release.

Other notable changes:

  • Dependencies were simplified using the Spine object.
  • Integration tests were patched to allow running in a project which has both Java and Kotlin. We need a better way of doing this (Empty Kotlin SourceFileSet is passed to JavaPrinter #90).
  • properties sourceRoot and targetRoot were opened in SourceFileSet. Still, it did not allow to use these properties in the integration tests because tests seem to use the code embedded into mc-java rather than that defined in the build file.
  • SourceFileSet also got properties size and isEmpty. It was possible to obtain these values via count extension of Iterable, but doing it directly is a bit more efficient.

@alexander-yevsyukov alexander-yevsyukov self-assigned this Oct 17, 2022
@@ -70,6 +70,9 @@ public final class UuidJavaRenderer extends JavaRenderer {
*/
@Override
protected void render(SourceFileSet sources) {
if (!sources.sourceRoot.endsWith("java")) {
Copy link
Collaborator Author

@alexander-yevsyukov alexander-yevsyukov Oct 17, 2022

Choose a reason for hiding this comment

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

@armiol, this line breaks the build sayin that the sourceRoot property is private. It was indeed until I opened it.

It looks like indication that we test against the "dev" version, and not the one under the development. I've tried to force versions in the root build, but it didn't give much. I still get the "private" property error.

Let's discuss when time permits.

@alexander-yevsyukov alexander-yevsyukov changed the title Add kotlin Add kotlin protoc built-in when Java or Kotlin are enabled in a project Oct 18, 2022
@alexander-yevsyukov alexander-yevsyukov marked this pull request as ready for review October 18, 2022 20:06
... for the case of opening `tests` as a project in IDEA.
@alexander-yevsyukov alexander-yevsyukov merged commit 25cb2fe into master Oct 19, 2022
@alexander-yevsyukov alexander-yevsyukov deleted the add-kotlin branch October 19, 2022 09:59
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