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 support for Kotlin data model classes #21

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

AlexandruGhergut
Copy link

The purpose of this PR is to add support for scanning of source files written in Kotlin.

The HollowAPIGenerator works fine with Kotlin model classes but this plugin can't pick them up due to hard-coded paths and extensions.

I have thought of two approaches in adding the support:

  1. Expose all paths/extensions as configurable properties with java defaults (allows good flexibility but more properties to set-up)
  2. Expose a property that allows you to select the language and then map that to some pre-defined settings (lower flexibility but easier to set-up)

I use the 1st approach in this PR and in theory and if the HollowAPIGenerator supports other languages, it should work not only for Kotlin.

Additional changes:

  • print a warning when no data classes were picked up

I am open to suggestions regarding the implementation. Please let me know what you think.

ping @rpalcolea @toolbear

@rpalcolea
Copy link
Member

Hi @AlexandruGhergut,

Thanks for this contribution

It looks like you need to update your branch with latest master. Mind doing it?

@AlexandruGhergut
Copy link
Author

AlexandruGhergut commented Jan 31, 2020

I will have to adapt the new compileDataModel task to work with other languages or add one per language. Not sure how to go about it, I'll investigate

@karankalra
Copy link

@AlexandruGhergut @rpalcolea Any plans to get this PR merged? Need to use this plugin for a Scala project

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.

3 participants