Skip to content

VS Code specific development instructions

Johannes Renner edited this page Nov 18, 2020 · 8 revisions

This is a description of how to setup Visual Studio Code for developing Uyuni, particularly to work on the Java code using the Java Extension Pack.

Preparing VS Code

  • Install the latest version of Visual Studio Code. How to do this exactly depends on your operating system and personal preferences. There are repositories available with packages for different Linux distributions from the official download site, e.g. for openSUSE.
  • Install the Java Extension Pack from the "Extensions" view. This includes the most important extensions for Java development, especially the Java language server, but also support for the most commonly used build tools like maven.
  • The Ant Target Runner can be used to resolve dependencies or to run build and deploy cycles. You might want to configure it to ignore the original build.xml file by setting manager-build.xml as Ant: Build Filenames. In case you are running VS Code from a flatpak external commands (like ant) cannot simply be called from extensions due to the sandboxing, it should work to use flatpak-spawn --host ant as the Ant: Executable though.
  • If you come from Eclipse you might want to consider installing the Eclipse Keymap.

Preparing the repository

  • Clone the repo from GitHub as described here.
  • Configure the development machine as described here.
  • Make sure to resolve the dependencies for your current branch from the commandline as described (via ant -f manager-build.xml ivy), all jar file dependencies should be in the /lib folder before proceeding. Note that switching between branches might require you to repeat this step!

Creating the workspace

  • Wait until this PR is merged (or temporarily remove java/conf/eclipse/.project from your clone of the repo).
  • Start VS Code and from the welcome screen (or the "File" menu) use "Open folder...", choose the java subdirectory of the Uyuni repository.
  • Opening any of the Java files in the editor should automatically enable the Java language server and start the compilation / project setup.
  • Referenced libraries will automatically be found in the /lib subfolder.
  • If everything went well you should see 0 errors, only warnings and info messages.
Clone this wiki locally