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

Introduce a UserProjectRootBuildItem #44013

Open
ia3andy opened this issue Oct 22, 2024 · 5 comments
Open

Introduce a UserProjectRootBuildItem #44013

ia3andy opened this issue Oct 22, 2024 · 5 comments
Labels
kind/enhancement New feature or request

Comments

@ia3andy
Copy link
Contributor

ia3andy commented Oct 22, 2024

Description

This code is copied in 3 or 4 extensions already, having a build-item would be best :)

    private static Path findProjectRoot(Path outputDirectory) {
        Path currentPath = outputDirectory;
        do {
            if (Files.exists(currentPath.resolve(Paths.get("src", "main")))
                    || Files.exists(currentPath.resolve(Paths.get("config", "application.properties")))
                    || Files.exists(currentPath.resolve(Paths.get("config", "application.yaml")))
                    || Files.exists(currentPath.resolve(Paths.get("config", "application.yml")))) {
                return currentPath.normalize();
            }
            if (currentPath.getParent() != null && Files.exists(currentPath.getParent())) {
                currentPath = currentPath.getParent();
            } else {
                return null;
            }
        } while (true);
    }

Implementation ideas

No response

@ia3andy ia3andy added the kind/enhancement New feature or request label Oct 22, 2024
@mcruzdev
Copy link
Contributor

mcruzdev commented Oct 22, 2024

I would like to care about it @ia3andy :) Could you say what extensions are using (besides roq of course)?

@ia3andy
Copy link
Contributor Author

ia3andy commented Oct 22, 2024

I would like to care about it @ia3andy :) Could you say what extensions are using (besides roq of course)?

Quinoa and soon the Web Bundler, I believe there are others as I found this code in some extension in the past so do a search in Quarkus core and Quarkiverse to notify developers when it's done

@ia3andy
Copy link
Contributor Author

ia3andy commented Oct 22, 2024

We might also want to move PathUtils from Roq to Quarkus core (runtime)

@melloware
Copy link
Contributor

I am pretty sure I am using it in Quarkus JasperReports also or something similar.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/enhancement New feature or request
Projects
None yet
4 participants