3871fdb95a
This is going to make development so much easier |
||
---|---|---|
.github | ||
.vscode | ||
extension | ||
gradle/wrapper | ||
images | ||
proto | ||
tasks-server | ||
.editorconfig | ||
.envrc | ||
.gitattributes | ||
.gitignore | ||
.nvmrc | ||
CHANGELOG.md | ||
CONTRIBUTING.md | ||
DOCS.md | ||
FEATURES.md | ||
LICENSE.md | ||
README.md | ||
build.gradle | ||
gradlew | ||
gradlew.bat | ||
settings.gradle | ||
sonar-project.properties |
README.md
VS Code Gradle Tasks
Run Gradle tasks in VS Code.
Features
- Run Gradle tasks as VS Code tasks
- List & run Gradle tasks in the Explorer
- More Features »
Requirements
- Java >= 8 must be installed
- Local Gradle wrapper executables must exist at the root of the workspace folders (either
gradlew
orgradlew.bat
, depending on your environment)
Extension Settings
This extension contributes the following settings:
gradle.autoDetect
: Automatically detect Gradle tasksgradle.enableTasksExplorer
: Enable an explorer view for Gradle tasksgradle.taskPresentationOptions
: Task presentation options, see tasks output behaviourgradle.focusTaskInExplorer
: Focus the task in the explorer when running a taskgradle.debug
: Show extra debug info in the output panel
This extension supports the following settings:
java.home
: Absolute path to JDK home folder used to launch the gradle daemons. (Contributed by vscode-java.)
Snippets
This extensions provides snippets for the groovy and kotlin build files:
cgt
: Create a new Gradle task
Troubleshooting
View logs by selecting "Gradle Tasks" in the output panel
Task output will be shown in the Terminal panel
Set the "gradle.debug" setting to "true" to view debug logs in the output panel
"No connection to the gradle server. Try restarting the server"
This error means the gradle task server has stopped, or there was an error starting it. Click on "Restart Server" to restart it.
If you continue to get this error, view the task error messages by selecting "Gradle Tasks Server" in the Terminal panel.
The task server is started using a shell script generated by CreateStartScripts. The script uses #!/usr/bin/env sh
and is as portable as the gradle wrapper script. If there are any problems executing the start script then it's likely an issue either with your $PATH
, or java was not installed.
PATH problems
The following error demonstrates a typical issue with your $PATH
:
env: sh: No such file or directory
The terminal process terminated with exit code: 127
Use the following task to debug your shell environment within vscode:
{
"version": "2.0.0",
"tasks": [
{
"label": "Print task shell info",
"type": "shell",
"command": "echo \"Path: $PATH \nShell: $SHELL\"",
"problemMatcher": []
}
]
}
Fixing your $PATH
Check your dotfiles (eg ~/.bashrc
, ~/.bash_profile
, ~/.zshrc
) and fix any broken PATH
exports, or override the PATH
env var by setting terminal.integrated.env
in your vscode settings, for example:
"terminal.integrated.env.osx": {
"PATH": "/put/your:/paths/here",
}
Java path problems
You might see an error like:
ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
The start script should find the path to Java in the usual locations. If you get this error it suggests an issues with your $PATH
or you simply haven't installed Java. Run the gradle wrapper script (eg ./gradlew tasks
) to debug further.
Incompatibility with other extensions
This extension is incompatible with the following extensions:
The reason for the incompatibility is due to the extensions providing the same tasks types (gradle
) with different task definitions.
Contributing
Refer to CONTRIBUTING.md for instructions on how to run the project.
Support
For general support queries, use the #gradle-tasks channel in the slack development community workspace.
Credits
- Originally forked from Cazzar/vscode-gradle
- Inspired by the built-in npm extension
Release Notes
See CHANGELOG.md.
License
See LICENSE.md.