Skip to content

VSCode Tasks Gradle Plugin scans your gradle project and configures VS Code to be able to run all gradle tasks from within VS Code. It will create or update the tasks.json file in the .vscode folder for a workspace.

License

Notifications You must be signed in to change notification settings

Akman/vscode-tasks

Repository files navigation

VSCode Tasks Gradle Plugin

Build Status Code Coverage License

This plugin scans your gradle project and configures VS Code to be able to run all gradle tasks from within VS Code. It will create or update the tasks.json file in the .vscode folder for a workspace.

Applying the plugin

The plugin available through the Gradle plugin exchange and the configuration for your project is done in the build.gradle file.

plugins {
    id "ru.akman.vscode-tasks" version "0.4.0"
}

Tasks

There is one task available in your project:

  • vscodeTasks - create or update VS Code configuration
./gradlew vscodeTasks

Configuration

You can edit the almost all of the task's properties, but following properties are not configurable and set by the plugin itself:

  • group
  • label
  • detail

Below are shown all configurable task's properties with their default values. They apply to each task added to the VS Code configuration.

The VS Code customs tasks documentation is available here

vscodeTasks {
    prefix = ''
    type = 'shell'
    command = './gradlew'
    args = []
    options = [
        'cwd': '',
        'env': [:],
        'shell': [:]
    ]
    problemMatcher = []
    windows = [:]
    linux = [:]
    osx = [:]
    runOptions = [
        'reevaluateOnRerun': true,
        'runOn': 'default'
    ]
    promptOnClose = true
    isBackground = true
    presentation = [
        'group': 'gradle',
        'echo': true,
        'reveal': 'always',
        'revealProblems': 'never',
        'focus': true,
        'panel': 'shared',
        'showReuseMessage': true,
        'clear': false
    ]
    dependsOn = []
    dependsOrder = 'parallel'
}

Note that unlike json syntax, groovy syntax is used here. Therefore, do not forget to replace the curly braces (from json) with square brackets in the maps definitions.

  • prefix - the prefix used for a task name, if prefix is empty the group name will be used as prefix

About

VSCode Tasks Gradle Plugin scans your gradle project and configures VS Code to be able to run all gradle tasks from within VS Code. It will create or update the tasks.json file in the .vscode folder for a workspace.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published