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

[Feature Request] Provide example of how to include in a Kotlin Gradle project #188

Closed
dtanner opened this issue Sep 25, 2024 · 4 comments
Closed
Labels
Feature New feature or request

Comments

@dtanner
Copy link

dtanner commented Sep 25, 2024

I'm using a Kotlin Gradle project with the com.google.protobuf and build.buf plugins, and am confused about how to use protovalidate-java with this setup. A reference example configuration of how to configure a Kotlin Gradle project with this library would save a lot of time and probably increase adoption.

The context of my project started as a multi-module gradle project compiling multiple proto languages, using the com.google.protobuf and build.buf plugins. I got stuck trying to figure out how to incorporate the protovalidate plugin using its directions into my gradle-flavored configurations settings in the .gradle.kts file.

Next I tried removing the com.google.protobuf plugin usage and instead use the buf generate CLI directly and pointed my IDE at the generated sources, which seems like a cleaner path anyway for a multi-language project. My code compiles, but I'm not seeing validation happen, and don't have proper IDE support for the buf/validate/validate.proto file as shown in this screenshot.

image

I can create a sample repo if it'd be useful to debug my situation, and am happy to submit a PR with a reference example if I can get past these new user issues.

@dtanner dtanner added the Feature New feature or request label Sep 25, 2024
@dtanner
Copy link
Author

dtanner commented Oct 1, 2024

@jhump helped me, and I created a working example here: https://github.com/dtanner/buf-sandbox

@dtanner
Copy link
Author

dtanner commented Oct 1, 2024

Separate problem, but I'd still like to know a clean way to import things like the validate.proto file in the IDE.

@dtanner
Copy link
Author

dtanner commented Oct 1, 2024

Just discovered this feature in IDEA; enabling Search for imported files in indexes works, at least for this library.

image

@dtanner
Copy link
Author

dtanner commented Oct 1, 2024

I'm closing this issue since I haven't heard any interest from the maintainers to add any of this to the project, but I'll keep the linked project around for anyone that finds this in the future and is looking for a working example for this timeframe.

@dtanner dtanner closed this as completed Oct 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant