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

Gradle executor is not detected if only build.gradle.kts file is present #846

Closed
sndl opened this issue Sep 22, 2022 · 4 comments · Fixed by #1231
Closed

Gradle executor is not detected if only build.gradle.kts file is present #846

sndl opened this issue Sep 22, 2022 · 4 comments · Fixed by #1231
Labels
help-wanted We'd love your contributions on this issue kind/enhancement Improvements or new features resolution/fixed This issue was fixed

Comments

@sndl
Copy link

sndl commented Sep 22, 2022

gradleMarkers := []string{
"settings.gradle",
"settings.gradle.kts",
"build.gradle",
}

The code above is used to detect an executor, and if I have only build.gradle.kts file in my project, then it falls through to sbt executor

Also, this function might be worth looking at as well:

func (gradle) findGradleRoot(workdir fsys.ParentFS) (fsys.ParentFS, string, error) {
gradleRootMarkers := []string{
"settings.gradle",
"settings.gradle.kts",
}

@justinvp justinvp added the kind/bug Some behavior is incorrect or out of spec label Sep 22, 2022
@t0yv0 t0yv0 added help-wanted We'd love your contributions on this issue kind/enhancement Improvements or new features and removed kind/bug Some behavior is incorrect or out of spec labels Sep 23, 2022
@t0yv0
Copy link
Member

t0yv0 commented Sep 23, 2022

Thank you for noting this. Would you be interested in contributing a PR? Perhaps something as easy as adding build.gradle.kts to the markers list would work?

@ilya40umov
Copy link

I have run into this problem in a few projects now, and in most cases adding an empty settings.gradle.kts was doing the trick. However, the problem now is that for a multi-module project these settings.gradle.kts are causing Gradle to think that this a root module (while in fact it's sub-module of a multi-module project).

@mklueh
Copy link

mklueh commented Feb 1, 2024

Facing the same problem within a monorepo, where all the Gradle stuff is under /root and the infrastructure is in /infra

An empty settings.gradle.kts did not help and produces

Error(error: failed to discover plugin requirements: language host could not determine Pulumi packages: could not find ./gradlew, gradle on the $PATH: exec: "gradle": executable file not found in %PATH%

Btw, around November 2022 this must have worked. Maybe not with Kotlin DSL but with Groovy, as I was using it from subdirectories

@t0yv0 as you asked for a contribution, I'm wondering if something is missing with this contributed PR that would fix the problem or if it just wasn't noticed? #1231

@aweiher
Copy link

aweiher commented Feb 23, 2024

indeed, an empty settings.gradle.kts helps as it is part of the gradleRootMarkers posted

without it the error is as follows:

error: failed to discover plugin requirements: language host could not determine Pulumi packages: could not find ./sbt, sbt on the $PATH: exec: "sbt": executable file not found in $PATH

@pulumi-bot pulumi-bot added resolution/fixed This issue was fixed labels May 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help-wanted We'd love your contributions on this issue kind/enhancement Improvements or new features resolution/fixed This issue was fixed
Projects
None yet
Development

Successfully merging a pull request may close this issue.

7 participants