Skip to content

Commit

Permalink
PR & docs updates
Browse files Browse the repository at this point in the history
  • Loading branch information
badsyntax committed Apr 23, 2020
1 parent 567fd8e commit bb9fae2
Show file tree
Hide file tree
Showing 21 changed files with 159 additions and 162 deletions.
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@

# Output directories
build/
out/
target/
bin/

Expand Down
10 changes: 1 addition & 9 deletions docs/DOCS.md → ARCHITECTURE.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,4 @@
# Gradle Tasks Documentation

## Overview

This extension provides a UI layer over the Gradle Task graph. It shows Gradle projects and associated tasks and allows you to run those tasks within the context of the editor.

The extension has been built to support *Gradle*, not just *Java projects using Gradle*, but it can work alongside other extensions like the [Java language support extension](https://github.com/redhat-developer/vscode-java).

## Architecture Overview
# Architecture Overview

The extension uses client/server architecture using [gRPC](https://grpc.io/) as the interface between the client and server. It uses TypeScript (Node.js) on the client and Java on the server.

Expand Down
File renamed without changes.
4 changes: 2 additions & 2 deletions docs/FEATURES.md → FEATURES.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@
- List & run Gradle tasks in the Explorer
- Updates project configuration after running tasks, via the [Java language server](https://github.com/redhat-developer/vscode-java) (if installed)
- Uses the [Gradle Tooling API](https://docs.gradle.org/current/userguide/third_party_integration.html#embedding) to discover and run Gradle tasks
- Uses a long running websocket server which provides good performance
- Uses a long running gRPC server which provides good performance
- Supports Kotlin & Groovy build files
- Supports [multi-project builds](https://docs.gradle.org/current/userguide/multi_project_builds.html)
- Supports nested Gradle projects
- Supports multi-root workspaces
- Show flat or nested tasks in the explorer
- Gracefully stop (cancel) a running Gradle Task
- Gracefully cancel a running Gradle Task

Watch a short demo of the features: https://www.youtube.com/watch?v=n8hmndccxHI
11 changes: 7 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,12 @@ Run Gradle tasks in VS Code.

## Features

- Run [Gradle tasks](https://gradle.org/) as [VS Code tasks](https://code.visualstudio.com/docs/editor/tasks)
- List & run Gradle tasks in the Explorer
- [More Features »](./FEATURES.md)
This extension provides a UI layer over the Gradle Task graph. It shows Gradle projects and associated tasks and allows you to run those tasks within the context of the editor.

This extension supports whatever Gradle supports and is thus language/project agnostic, but it can work nicely alongside other extensions like the [Java language support extension](https://github.com/redhat-developer/vscode-java).

- 👉 [All Features](./FEATURES.md)
- 👉 [Architecture Overview](./ARCHITECTURE.md)

## Requirements

Expand Down Expand Up @@ -65,7 +68,7 @@ This extensions provides snippets for the groovy and kotlin build files:

<img src="./images/no-connection.png" width="500" />

This error means the gradle task server has stopped, or there was an error starting it. Click on "Restart Server" to restart it.
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.

Expand Down
3 changes: 0 additions & 3 deletions docs/TESTING.md

This file was deleted.

6 changes: 3 additions & 3 deletions extension/.gitignore
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
out/
/out
node_modules
*.vsix
.vscode-test
lib/**
/lib
.classpath
.settings
*nls.*.json
src/proto/
/src/proto/
15 changes: 15 additions & 0 deletions extension/i18n/es/out/client.i18n.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"client.connecting": "Cliente Gradle que se conecta al servidor ...",
"client.connected": "Cliente Gradle conectado al servidor",
"client.refreshingTasks": "{0} Gradle: tareas refrescantes",
"client.errorGettingProject": "Error al obtener el proyecto para {0}: {1}",
"client.completedTask": "Tarea completada {0}",
"client.errorRunningTask": "Error al ejecutar la tarea: {0} {1}",
"client.errorCancellingRunningTask": "Error al cancelar la tarea en ejecución: {0}",
"client.errorCancellingRunningTasks": "Error al cancelar las tareas en ejecución",
"client.errorCancellingGetProjects": "Error al cancelar proyectos get: {0}",
"client.errorConnectingToServer": "Error al conectarse al servidor gradle: {0}",
"client.runTaskCancelled": "Tarea cancelada: {0}",
"client.getProjectCancelled": "Obtener proyecto cancelado: {0}",
"client.grpcClientConstructionError": "No se puede construir el cliente gRPC: {0}"
}
9 changes: 9 additions & 0 deletions extension/i18n/es/out/commands.i18n.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"commands.errorCancellingTask": "Error al cancelar la tarea: {0}",
"commands.errorCancellingTasks": "Error al cancelar tareas: {0}",
"commands.process.viewLogs": "Ver los registros",
"commands.process.cancelProcess": "Cancelar proceso",
"commands.process.gradleTasksProcess": "Proceso de tareas de Gradle",
"commands.gradleTaskCancelling": "La tarea de Gradle se está cancelando, por favor espere",
"commands.updateProjectConfigurationError": "No se puede actualizar la configuración del proyecto Java: {0}"
}
5 changes: 5 additions & 0 deletions extension/i18n/es/out/gradleView.i18n.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"gradleView.runTask": "Ejecutar tarea",
"gradleView.noTasksFound": "No se encontraron tareas",
"gradleView.focusTaskError": "No se puede enfocar la tarea en el explorador: {0}"
}
7 changes: 7 additions & 0 deletions extension/i18n/es/out/server.i18n.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"server.gradleServerStarted": "Se inició el servidor Gradle",
"server.gradleServerErrorStarting": "Error al iniciar el servidor gradle",
"server.gradleServerStopped": "Servidor Gradle detenido",
"server.restartServer": "Reiniciar servidor",
"server.restartMessage": "Sin conexión al servidor gradle. Intenta reiniciar el servidor."
}
7 changes: 7 additions & 0 deletions extension/i18n/es/out/tasks.i18n.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"tasks.getGradleProjectsError": "No se pueden obtener las carpetas de proyectos de gradle: {0}",
"tasks.errorGettingProject": "Error al obtener el proyecto gradle",
"tasks.refreshError": "No se pueden actualizar las tareas: {0}",
"tasks.vsCodeTaskGenerateError": "No se pueden generar tareas de vscode a partir de tareas de gradle: {0}",
"tasks.runTaskWithArgsExample": "Por ejemplo: {0}"
}
6 changes: 3 additions & 3 deletions extension/i18n/es/package.i18n.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,16 @@
"extension.command.runTask.title": "Ejecutar tarea",
"extension.command.runTaskWithArgs.title": "Ejecutar tarea con Args",
"extension.command.openBuildFile.title": "Abrir archivo de compilación de tareas",
"extension.command.stopTask.title": "Detener tarea",
"extension.command.stopTreeItemTask.title": "Detener tarea",
"extension.command.cancelTask.title": "Cancelar tarea",
"extension.command.cancelTreeItemTask.title": "Cancelar tarea",
"extension.command.explorerFlat.title": "Mostrar lista plana",
"extension.command.explorerRender.title": "Render Explorer",
"extension.command.explorerTree.title": "Mostrar árbol",
"extension.command.killGradleProcess.title": "Kill Gradle proceso de tarea",
"extension.command.showProcessMessage.title": "Mostrar cuadro de mensaje de información de proceso de Gradle",
"extension.command.refresh.title": "Actualizar tareas de Gradle",
"extension.command.openSettings.title": "Configuración abierta",
"extension.command.stoppingTreeItemTaskShow.title": "Tarea de detención",
"extension.command.cancellingTreeItemTaskShow.title": "Tarea de cancelación",
"extension.config.autoDetect.description": "Controla si las tareas de Gradle deben detectarse automáticamente",
"extension.config.enableTasksExplorer.description": "Habilitar una vista de explorador para tareas de Gradle",
"extension.config.debug.description": "Mostrar información adicional de depuración en el panel de salida",
Expand Down
28 changes: 14 additions & 14 deletions extension/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -110,12 +110,12 @@
"title": "%extension.command.openBuildFile.title%"
},
{
"command": "gradle.stopTask",
"title": "%extension.command.stopTask.title%"
"command": "gradle.cancelTask",
"title": "%extension.command.cancelTask.title%"
},
{
"command": "gradle.stopTreeItemTask",
"title": "%extension.command.stopTreeItemTask.title%",
"command": "gradle.cancelTreeItemTask",
"title": "%extension.command.cancelTreeItemTask.title%",
"icon": {
"light": "resources/light/stop.svg",
"dark": "resources/dark/stop.svg"
Expand Down Expand Up @@ -166,8 +166,8 @@
}
},
{
"command": "gradle.stoppingTreeItemTask",
"title": "%extension.command.stoppingTreeItemTaskShow.title%",
"command": "gradle.cancellingTreeItemTask",
"title": "%extension.command.cancellingTreeItemTaskShow.title%",
"icon": {
"light": "resources/light/loading.svg",
"dark": "resources/dark/loading.svg"
Expand All @@ -189,11 +189,11 @@
"when": "false"
},
{
"command": "gradle.stopTask",
"command": "gradle.cancelTask",
"when": "false"
},
{
"command": "gradle.stopTreeItemTask",
"command": "gradle.cancelTreeItemTask",
"when": "false"
},
{
Expand All @@ -217,7 +217,7 @@
"when": "false"
},
{
"command": "gradle.stoppingTreeItemTask",
"command": "gradle.cancellingTreeItemTask",
"when": "false"
}
],
Expand Down Expand Up @@ -258,13 +258,13 @@
"group": "inline"
},
{
"command": "gradle.stopTreeItemTask",
"command": "gradle.cancelTreeItemTask",
"when": "view == gradleTreeView && viewItem == runningTask",
"group": "inline"
},
{
"command": "gradle.stoppingTreeItemTask",
"when": "view == gradleTreeView && viewItem == stoppingTask",
"command": "gradle.cancellingTreeItemTask",
"when": "view == gradleTreeView && viewItem == cancellingTask",
"group": "inline"
}
]
Expand Down Expand Up @@ -346,11 +346,11 @@
},
"default": {
"reveal": "always",
"focus": true,
"focus": false,
"echo": true,
"showReuseMessage": false,
"panel": "shared",
"clear": true
"clear": false
}
}
}
Expand Down
6 changes: 3 additions & 3 deletions extension/package.nls.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,16 @@
"extension.command.runTask.title": "Run Task",
"extension.command.runTaskWithArgs.title": "Run Task With Args",
"extension.command.openBuildFile.title": "Open Task Build File",
"extension.command.stopTask.title": "Stop Task",
"extension.command.stopTreeItemTask.title": "Stop Task",
"extension.command.cancelTask.title": "Cancel Task",
"extension.command.cancelTreeItemTask.title": "Cancel Task",
"extension.command.explorerFlat.title": "Show Flat List",
"extension.command.explorerRender.title": "Render explorer",
"extension.command.explorerTree.title": "Show Tree",
"extension.command.killGradleProcess.title": "Kill Gradle task process",
"extension.command.showProcessMessage.title": "Show Gradle process information message box",
"extension.command.refresh.title": "Refresh Gradle Tasks",
"extension.command.openSettings.title": "Open Settings",
"extension.command.stoppingTreeItemTaskShow.title": "Stopping Task",
"extension.command.cancellingTreeItemTaskShow.title": "Cancelling Task",
"extension.config.autoDetect.description": "Controls whether Gradle tasks should be automatically detected",
"extension.config.enableTasksExplorer.description": "Enable an explorer view for Gradle tasks",
"extension.config.debug.description": "Show extra debug information in the output panel",
Expand Down
36 changes: 15 additions & 21 deletions extension/src/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,7 @@ export class GradleTasksClient implements vscode.Disposable {
};

public handleServerReady = (): void => {
logger.debug(
// TODO
logger.info(
localize('client.connecting', 'Gradle client connecting to server')
);
this.connectToServer();
Expand All @@ -72,11 +71,7 @@ export class GradleTasksClient implements vscode.Disposable {
this.handleConnectError(err);
} else {
logger.info(
localize(
// TODO
'client.connected',
'Gradle client connected to server'
)
localize('client.connected', 'Gradle client connected to server')
);
this._onConnect.fire();
}
Expand All @@ -90,11 +85,15 @@ export class GradleTasksClient implements vscode.Disposable {
);
const deadline = new Date();
deadline.setSeconds(deadline.getSeconds() + this.connectDeadline);
// grpc.setLogVerbosity(grpc.logVerbosity.DEBUG);
this.grpcClient.waitForReady(deadline, this.handleClientReady);
} catch (err) {
// TODO
logger.error(`Unable to construct the gRPC client: ${err.message}`);
logger.error(
localize(
'client.grpcClientConstructionError',
'Unable to construct the gRPC client: {0}',
err.message
)
);
}
}

Expand Down Expand Up @@ -139,10 +138,9 @@ export class GradleTasksClient implements vscode.Disposable {
});
} catch (err) {
logger.error(
// TODO
localize(
'client.errorGettingProjectData',
'Error getting project data for {0}: {1}',
'client.errorGettingProject',
'Error getting project for {0}: {1}',
sourceDir,
err.details || err.message
)
Expand Down Expand Up @@ -228,7 +226,6 @@ export class GradleTasksClient implements vscode.Disposable {
logger.info(cancelRunTaskReply.getMessage());
} catch (err) {
logger.error(
// TODO
localize(
'client.errorCancellingRunningTask',
'Error cancelling running task: {0}',
Expand Down Expand Up @@ -261,7 +258,6 @@ export class GradleTasksClient implements vscode.Disposable {
logger.info(cancelRunTasksReply.getMessage());
} catch (err) {
logger.error(
// TODO
localize(
'client.errorCancellingRunningTasks',
'Error cancelling running tasks: {0}',
Expand Down Expand Up @@ -294,10 +290,9 @@ export class GradleTasksClient implements vscode.Disposable {
logger.info(cancelGetProjectsReply.getMessage());
} catch (err) {
logger.error(
// TODO
localize(
'client.errorCancellingGetProjects',
'Error cancelling get projects data process: {0}',
'Error cancelling get projects: {0}',
err.details || err.message
)
);
Expand All @@ -307,7 +302,7 @@ export class GradleTasksClient implements vscode.Disposable {
private handleRunTaskCancelled = (cancelled: Cancelled): void => {
logger.info(
localize(
'tasks.taskCancelled',
'client.runTaskCancelled',
'Task cancelled: {0}',
cancelled.getMessage()
)
Expand All @@ -316,11 +311,10 @@ export class GradleTasksClient implements vscode.Disposable {
};

private handleGetProjectCancelled = (cancelled: Cancelled): void => {
// TODO
logger.info(
localize(
'tasks.getProjectCancelled',
'Task cancelled: {0}',
'client.getProjectCancelled',
'Get project cancelled: {0}',
cancelled.getMessage()
)
);
Expand Down
Loading

0 comments on commit bb9fae2

Please sign in to comment.