Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update doc after merge language server #1528

Merged
merged 5 commits into from
Jul 25, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions ARCHITECTURE.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@ This extension contains three major components:
- [A Gradle language server](./gradle-language-server) that provides language features such as code completion and diagnostics for gradle script files.
- [A Gradle project importer](./extension/jdtls.ext/com.microsoft.gradle.bs.importer) that imports Gradle projects detected by the [Gradle Build Server](https://github.com/microsoft/build-server-for-gradle) into the workspace. This importer works with the Language Support for Java extension.

# Gradle Server and Gradle Language Server
# Gradle Server

<img src="images/gradle-server-architecture.svg" />
The gradle server is a long-running Java process that include two threads: 1. Build Server 2. Task Server
The gradle server is a long-running Java process that include three threads: 1. Build Server 2. Task Server 3. Language Server

## Build Server
The Gradle Build Server communicates with the Build Client using the [Build Server Protocol](https://build-server-protocol.github.io/) through named pipes.
Expand All @@ -17,6 +17,9 @@ Due to Java's limited support for named pipes on Windows, a TypeScript layer nam

For information about the Build Server itself, visit the [Gradle Build Server](https://github.com/microsoft/build-server-for-gradle).

## Language Server
Language Server provides language features such as code completion and diagnostics for Gradle script files. It communicates with the Language Client using the [Language Server Protocol](https://microsoft.github.io/language-server-protocol/) through named pipe.

## Task Server
The task server and client using [gRPC](https://grpc.io/) as the interface between each other. It uses TypeScript (Node.js) on the client and Java on the server. A long running server provides very good performance.

Expand Down
23 changes: 11 additions & 12 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,17 @@ Start by opening an issue using one of the issue templates, or propose a change

## Running the Project

### Build Gradle Server and Gradle Language Server.
### Build Gradle Project Importer
Before proceeding with the build steps for Gradle Server , you need to build the Gradle Project Importer first.
Jiaaming marked this conversation as resolved.
Show resolved Hide resolved

1. Install [Java version >= 17](https://adoptium.net/)
2. `cd extension`
3. `git clone https://github.com/microsoft/build-server-for-gradle.git `
4. Build the Importer and Build Server jars: `../gradlew buildJars`

### Build Gradle Server
After building the Gradle Project Importer, proceed with the following steps.

1. Install [nvm](https://github.com/nvm-sh/nvm)
Jiaaming marked this conversation as resolved.
Show resolved Hide resolved
2. Install [Java version >= 17](https://adoptium.net/)
3. Change directory to the root of the project
Expand All @@ -25,12 +35,6 @@ Start by opening an issue using one of the issue templates, or propose a change

Running the build for the first time can take a bit of time, but subsequent builds should be fast.

### Build Gradle Project Importer
1. Install [Java version >= 17](https://adoptium.net/)
2. `cd extension`
3. `git clone https://github.com/microsoft/build-server-for-gradle.git `
4. Build the Importer and Build Server jars: `../gradlew buildJars`

## Debugging Gradle plugin

The extension uses a Gradle plugin (`com.microsoft.gradle.GradlePlugin`) to get a lot of information from your project's Gradle build. If you want to debug the Gradle plugin, you can follow these steps:
Expand All @@ -51,11 +55,6 @@ The extension uses a Gradle plugin (`com.microsoft.gradle.GradlePlugin`) to get
> ```
> it indicates that the connection attempt to the Gradle Server was too slow. The [GradleBuildClient](/extension/jdtls.ext/com.microsoft.gradle.bs.importer/src/com/microsoft/gradle/bs/importer/ImporterPlugin.java#L107) requires an active Gradle Server to successfully establish a connection. If you encounter this issue, please retry the connection promptly to avoid this error.

## Debugging Gradle Language Server (editing feature related)

1. Run vscode launch configuration `Debug Language Server: Launch Extension`.
2. Run vscode launch configuration `Debug Language Server: Launch Language Server`.

## Development Workflow

Open the root of the project in VS Code.
Expand Down
2 changes: 1 addition & 1 deletion images/gradle-server-architecture.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.