Skip to content

Latest commit

 

History

History
137 lines (92 loc) · 3.54 KB

dev.md

File metadata and controls

137 lines (92 loc) · 3.54 KB

CodeStream for Jetbrains

Getting the code

git clone https://github.com/TeamCodeStream/codestream.git

Prerequisites

Before You Begin

The CodeStream clients all live in a single git mono-repo. Each IDE has their own tools for generating builds and Jetbrains is no different!

Build & Run

JVM Setup

On macos, due to a strange bug in byte-buddy or JBR jvm, you need to copy the JBR jvm to a directory without spaces. If you do not, you will not be able to run tests. (symbolic link does no twork) For example:

cd ~
mkdir jbr
cp -r  /Applications/IntelliJ\ IDEA.app/Contents/jbr/Contents/Home/* jbr/
export JAVA_HOME="$HOME/jbr"
export PATH="$JAVA_HOME/bin:$PATH"

👉 NOTE!

If you utilize JetBrains Toolbox for managing the installation of their IDEs / utilities, then your installation path will be available by clicking 'Settings' next to the application in JetBrains Toolbox. By default, it will look similar to:

/Users/<your home dir>/Library/Application Support/JetBrains/Toolbox/apps/IDEA-U/ch-0/231.8109.175

The Jetbrains JVM is required to run tests and build the plugin. The project is preconfigured to use a JVM Runtime called jbr-17. You need to setup this JMV yourself by going to File -> Project Structure and then click on SDK and in the dropdown choose Add Sdk. Choose Add JDK and browse to /Users/<your home dir>/jbr (or where ever you have copied IntelliJ java runtime) and click OK. It should have defaulted to the name jbr-17 or jbr-17 (2).

After that:

  • run gradle task buildDependencies once (it will run npm install, etc for dependencies)
  • run gradle task buildDebugDependencies
  • ensure the jb [runIde] configuration is selected and run in debug mode (click the 🐛 icon to start)

if you want a quick way to test changes in the agent/webview, then run the npm agent:watch and watch tasks and uncomment and edit those 2 lines in build.gradle

webview

to debug the webview:

with JCEF you can right-click the webview and select open dev tools

with JxBrowser, you can attach a chrome inspector to port 9222

in both cases, runIde must be ran in debug mode

Build

You can build some of the shared dependencies from a terminal. From where you have cloned the repository, execute the following command to build the agent and CodeStream for Jetbrains extension from scratch:

cd jb
npm run rebuild

👉 NOTE!

This will run a complete rebuild of the extension, webview, and agent.

To just run a quick build of the extension, use:

cd jb
npm run build

To just run a quick build of the agent, use:

cd shared/agent
npm run build

In Short

npm install --no-save... needs to be run for shared/ui, shared/agent, jb

npm run build... needs to be run for shared/agent then jb

Testing

To run the agent unit tests run the following from a terminal:

cd shared/agent
npm run test-acceptance

or

cd shared/agent
npm run test-unit

To run the webview unit tests run the following from a terminal:

cd shared/ui
npm run test

Possible Issues

Ubuntu 18.04: 'pushd not found'

If you get a 'pushd not found' error on npm run rebuild, it's because Ubuntu uses sh for the default shell. Tell npm to use bash instead:

Create a file in the vscode folder called

.npmrc

with content

script-shell=/bin/bash