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

Control when path has not 'src' in it #197

Merged
merged 1 commit into from Dec 6, 2022

Conversation

gwydionmv
Copy link
Contributor

Fixing issue #196

An exception was being thrown when trying to substring a path not including 'src' in it. Now it's controlled that the index for the substring is valid before doing it.

Copy link
Contributor

@hbelmiro hbelmiro left a comment

Choose a reason for hiding this comment

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

@gwydionmv do you mind including a test for this use case?

@gwydionmv
Copy link
Contributor Author

I'm not exactly sure how I can manually force a Path for the execution of the plugin. I faced this issue because another plugin we are using in the project is setting it up internally

@hbelmiro
Copy link
Contributor

hbelmiro commented Dec 5, 2022

@gwydionmv can't you just define a path without src with the property?

quarkus.openapi-generator.codegen.input-base-dir=openapi-definitions

@gwydionmv
Copy link
Contributor Author

@hbelmiro the property it is relative to the project base directory. E.g. if you have a project called MyProject and decide to place the openapi file in MyProject/openapi-definitions, the property as you wrote it is valid.

The lack of src in the path is not related to the property, but to the sourceDir that's being set up automatically by maven and the quarkus compiler plugin. It's something similar to the issue we opened last week for the /test directory: it sets different paths depending on I don't know what yet. For your example tests, it adds the /test; for some of our projects, only /src/main; for others, it also includes /target/generated-sources...

To sum up, it's not something we can configure via input-base-dir property.

Copy link
Contributor

@hbelmiro hbelmiro left a comment

Choose a reason for hiding this comment

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

LGTM.
Thanks for the contribution @gwydionmv.

@gwydionmv
Copy link
Contributor Author

@ricardozanini please check this out when you have a moment to spare :)

Copy link
Member

@ricardozanini ricardozanini left a comment

Choose a reason for hiding this comment

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

I'll release a patch version to include this fix. Thank you, @gwydionmv

@ricardozanini ricardozanini merged commit fef4e17 into quarkiverse:main Dec 6, 2022
@ricardozanini ricardozanini linked an issue Dec 6, 2022 that may be closed by this pull request
hbelmiro pushed a commit that referenced this pull request Dec 8, 2022
Co-authored-by: Gwydion Martin <gmartin@theworkshop.com>
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.

Unexpected exception when sourceDir doesn't include "src"
3 participants