Manage Gradle Projects, run Gradle tasks and provide better Gradle file authoring experience in VS Code
Перейти к файлу
Richard Willis 3871fdb95a Debug server & client, AT THE SAME TIME
This is going to make development so much easier
2020-04-18 17:48:01 +01:00
.github test 2020-04-17 21:11:47 +01:00
.vscode Debug server & client, AT THE SAME TIME 2020-04-18 17:48:01 +01:00
extension Debug server & client, AT THE SAME TIME 2020-04-18 17:48:01 +01:00
gradle/wrapper Initial gradle project reorg 2020-04-15 08:12:01 +01:00
images Update README 2020-02-15 18:57:59 +01:00
proto Initial changes to support project hierarchy modelling 2020-04-16 22:33:30 +01:00
tasks-server test 2020-04-17 21:11:47 +01:00
.editorconfig Initial changes to support project hierarchy modelling 2020-04-16 22:33:30 +01:00
.envrc Initial gradle project reorg 2020-04-15 08:12:01 +01:00
.gitattributes Initial gradle project reorg 2020-04-15 08:12:01 +01:00
.gitignore Initial gradle project reorg 2020-04-15 08:12:01 +01:00
.nvmrc Debug server & client, AT THE SAME TIME 2020-04-18 17:48:01 +01:00
CHANGELOG.md Various fixes from master 2020-04-14 20:40:20 +01:00
CONTRIBUTING.md Upgrade prettier and fix linting issues 2020-04-05 07:50:30 +01:00
DOCS.md test 2020-04-17 21:11:47 +01:00
FEATURES.md Update FEATURES.md 2020-04-11 11:20:20 +01:00
LICENSE.md Revert "Move typescript and java projects into different directories" 2019-12-14 00:31:36 +01:00
README.md Update README.md 2020-04-10 22:45:37 +01:00
build.gradle test 2020-04-17 21:11:47 +01:00
gradlew Initial gradle project reorg 2020-04-15 08:12:01 +01:00
gradlew.bat Initial gradle project reorg 2020-04-15 08:12:01 +01:00
settings.gradle Run all builds with gradle 2020-04-16 08:45:36 +01:00
sonar-project.properties Initial gradle project reorg 2020-04-15 08:12:01 +01:00

README.md

VS Code Gradle Tasks

Marketplace Version Build status Security Rating Visual Studio Marketplace Installs GitHub bug issues

Run Gradle tasks in VS Code.

Screencat

Features

Requirements

  • Java >= 8 must be installed
  • Local Gradle wrapper executables must exist at the root of the workspace folders (either gradlew or gradlew.bat, depending on your environment)

Extension Settings

This extension contributes the following settings:

  • gradle.autoDetect: Automatically detect Gradle tasks
  • gradle.enableTasksExplorer: Enable an explorer view for Gradle tasks
  • gradle.taskPresentationOptions: Task presentation options, see tasks output behaviour
  • gradle.focusTaskInExplorer: Focus the task in the explorer when running a task
  • gradle.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

Release Notes

See CHANGELOG.md.

License

See LICENSE.md.