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

Handle default package name when generating class names #13541

Closed
wants to merge 1 commit into from

Conversation

maxandersen
Copy link
Member

Fixes #13540

Replaced all occurrences of targetPackage.replace('.', '/') + "/" + baseName
with (targetPackage.isEmpty() ? "" : targetPackage.replace('.', '/') + "/") + baseName
to avoid generating file names that goes to the root (/) of the file system.

@ghost ghost added area/arc Issue related to ARC (dependency injection) area/qute The template engine area/scheduler area/vertx labels Nov 29, 2020
@maxandersen maxandersen force-pushed the defaultpage branch 3 times, most recently from 45c0aab to be2cb89 Compare November 29, 2020 22:18
@maxandersen maxandersen marked this pull request as ready for review November 29, 2020 22:27
Copy link
Contributor

@mkouba mkouba left a comment

Choose a reason for hiding this comment

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

We could create some util method/class that could be used for all occurences except the ValueResolverGenerator which is an indepenent project.

We should probably also add some tests, something similar to https://github.com/quarkusio/quarkus/blob/master/extensions/arc/deployment/src/test/java/SingleLetterDefaultPackageTest.java.

@maxandersen
Copy link
Member Author

We could create some util method/class that could be used for all occurences except the ValueResolverGenerator which is an indepenent project.

I agree it would be nice with a utility method; with this we are porbably at like 10+ changes we discovered it.

@stuartwdouglas
Copy link
Member

I wonder if we can just address this at a lower level:

  • Make Gizmo strip a leading '/' from a class name
  • Strip a leading '/' from file resources that are generated
    I think this should make this no longer an issue

@maxandersen
Copy link
Member Author

@stuartwdouglas your choice :)

for now I've updated the PR to be rebased against latest master.

@maxandersen
Copy link
Member Author

We should probably also add some tests, something similar to master/extensions/arc/deployment/src/test/java/SingleLetterDefaultPackageTest.java.

I agree we should add some but I would rather put those into some jbang tests in a separate PR if thats okey.

@mkouba
Copy link
Contributor

mkouba commented Jan 4, 2021

We should probably also add some tests, something similar to master/extensions/arc/deployment/src/test/java/SingleLetterDefaultPackageTest.java.

I agree we should add some but I would rather put those into some jbang tests in a separate PR if thats okey.

It's OK. However, I would still prefer something like io.quarkus.deployment.util.Packages#getInternalForm(String packageName) ;-).

@gsmet
Copy link
Member

gsmet commented Feb 4, 2021

I'm closing this one, it doesn't compile and looks like we might want to pursue a different path.

Please open a new one once things are sorted out.

@gsmet gsmet closed this Feb 4, 2021
@ghost ghost added the triage/invalid This doesn't seem right label Feb 4, 2021
@stuartwdouglas
Copy link
Member

I have opened #14839

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/arc Issue related to ARC (dependency injection) area/qute The template engine area/scheduler area/vertx triage/invalid This doesn't seem right
Projects
None yet
Development

Successfully merging this pull request may close these issues.

default package breaks @Scheduled
4 participants