-
Notifications
You must be signed in to change notification settings - Fork 317
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
metals doesn't detect ./gradlew
script in a project with multiple build tools
#6370
Comments
@gersonsosa Hi. I've not used verification-metadata before but I'm just trying to understand your setup. Metals should detect the If you don't have a I can't see you getting round the metadata verification without generating the metadata for |
Hi @Arthurm1
it exists, when I pass the parameter gradleScript as "./gradlew" it executes without a problem I'm not sure how to debug the detection of the file seems like something is wrong there
I manually added the verification metadata and it seems to work now, it would be awesome if based on the build tool you could get the current dependency version before attempting to use that one since there are technically two versions here the scala 2.12 (if I understand correctly) and the gradle bloop 1.6.1 |
Sorry - I don't have a mac so can't diagnose or test to see why
It's likely only the |
It does seem we are looking for |
That's good to know, so this version should also work if my project uses scala 2.13.x?
It seems that's the case, I have a particular setup because there are multiple levels of directories with "build.gradle.kts" files which might be detected as the root but as far as I see the root directory is being detected correctly I'll try to debug in my local if that's helpful but I'd love some guidance as how to do it with a flag or if I should put some debug lines in the code. |
The plugin version is completely separate from whatever version of scala your project is using |
@gersonsosa you can check if #6428 helps with your issue. |
Describe the bug
my project uses gradle 7.6.x and it requires "verification-metadata"
by looking at the code here
metals/metals/src/main/scala/scala/meta/internal/builds/GradleBuildTool.scala
Lines 24 to 37 in ba7763e
I see a specific version of gradle-bloop is used which results in the gradlew bloopInstall command failing if the verification metadata is not present
the issue happens because the "./gradlew" script is not detected by metals on startup and it attempts to use an embedded one, since the embedded one is based on gradle version 7.5 the gradle-bloop dependency is different than the one in my project (https://repo1.maven.org/maven2/ch/epfl/scala/gradle-bloop_2.13/1.6.1/)
metals/metals/src/main/scala/scala/meta/internal/builds/GradleBuildTool.scala
Lines 92 to 98 in ba7763e
I don't see any alternative to fix this rather than passing a custom script in the startup command but that seems unnecessary considering metals attempts to detect it here
metals/metals/src/main/scala/scala/meta/internal/builds/GradleBuildTool.scala
Lines 93 to 95 in ba7763e
Expected behavior
Metals detects my gradlew wrapper and use it with the version of bloop already installed
Operating system
MacOS
Editor/Extension
Neovim/nvim-metals
Version of Metals
v1.3.0
Extra context or search terms
gradle, build tools, gradle-bloop
The text was updated successfully, but these errors were encountered: