microsoft / vscode-gradle

Manage Gradle Projects, run Gradle tasks and provide better Gradle file authoring experience in VS Code
https://marketplace.visualstudio.com/items?itemName=vscjava.vscode-gradle
MIT License
124 stars 51 forks source link

The behavior is not the same with using ./gradlew.bat. #1472

Open jhd147350 opened 7 months ago

jhd147350 commented 7 months ago

Extension Name: vscode-gradle Extension Version: v3.13.5 OS Version: Windows_NT x64 10.0.19045 VSCode version: 1.86.2 Gradle version: 7.4

Describe the bug Run the gradle task using vscode-gradle extention, the behavior is not the same with using ./gradlew.bat.

To Reproduce Steps to reproduce the behavior. The following is my test code in build.gralde file.

task getRuntimePath(){
    def dir = 'cmd /c dir'
    println(dir.execute().text.trim())
}

Then I run the task in terminal. image This is the right output.

When I click the "run task" button, the output is not the same. image image

Moldoteck commented 3 months ago

Something similar is happening to me. We have a custom gradlew. If we manually run ./gradlew build - it totally works, but if we press Refresh Gradle Projects - it fails, in our case the local.properties file is not found in .../gradle/dist/..version../ path , but with simple ./gradlew build it is found. This leads me to the idea that maybe this extension is not running our custom gradlew from the proper path? Or maybe this extension does have another output path... P.s. this is happening on macos