Skip to content

Latest commit

 

History

History
99 lines (70 loc) · 2.81 KB

BUILD.md

File metadata and controls

99 lines (70 loc) · 2.81 KB

Developing Extension for VS Code

Prerequisities

  • JDK, version 11 or later
  • Ant, latest version
  • Maven, latest version
  • node.js, latest LTS (to build VSIX)

Fetching and building netbeans code

$ git clone https://github.com/apache/netbeans.git
$ cd netbeans/
$ git checkout f48f91e6c197d8a40bd82fc2f2d12a4e71242afe
$ cd ..
$ ant apply-patches
$ ant build-netbeans

Building VS Code extension

To build the VS Code extension invoke:

ant build-vscode-ext

The resulting extension is then in the build directory, with the .vsix extension. The typical file name is oracle-java-0.1.0.vsix.

Building for Development

If you want to develop the extension, use these steps for building instead:

ant build-lsp-server

This target is faster than building the .vsix file. Find the instructions for running and debugging below.

Cleaning

Often it is also important to properly clean everything. Use:

ant clean-vscode-ext
cd netbeans/
netbeans$ ant clean

Testing

The java.lsp.server module has classical (as other NetBeans modules) tests. The most important one is ServerTest which simulates LSP communication and checks expected replies. In addition to that there are VS Code integration tests - those launch VS Code with the VS extension and check behavior of the TypeScript integration code:

java.lsp.server$ ant build-vscode-ext # first and then
java.lsp.server$ ant test-vscode-ext

In case you are behind a proxy, you may want to run the tests with

java.lsp.server$ npm_config_https_proxy=http://your.proxy.com:port ant test-vscode-ext

when executing the tests for the first time. That shall overcome the proxy and download an instance of code to execute the tests with.