The example of how to build the Theia-based applications with the ecore-glsp.
Install nvm.
curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.33.5/install.sh | bash
Install npm and node.
nvm install 10
nvm use 10
Install yarn.
npm install -g yarn
You will need openjdk >= 11 on your path, as the client starts the ecore-glsp-server.
Before you start the browser or electron application you have to run the build script build.sh
in the root directory (this is also explained in the README file there). This builds the server products and publishes them into build folder of theia-ecore
package.
Run yarn in the root directory of this repository in the terminal:
yarn
Or with the default Build Task either via the menu Terminal > Run Build Task...
or the keybinding Ctrl+Shift+B.
-
Via Terminal:
yarn start
This command starts the necessary server JARs and the browser app on http://localhost:3000.
-
Via VSCode Tasks: Start the following tasks either via Ctrl+T or menu
Terminal > Run Task...
Start Browser Backend and Server Jars
Open Example in Browser
If both server and client were built successfully, the necessary server JARs are copied to uml-theia-integration/build/
.
The standard start script start
will start these JARs on application startup (process argument --startFromJar
is set).
To debug the Servers, please see the server README for more details.
In that case please use the start script start:debug
or the task Start Browser Backend in Debug Mode (expects running Server instances)
which expects running server instances (process argument --startFromJar
is NOT set).
To avoid having to perform a full build after each change, you can use the following workflow in VSCode to enable watching and automatic rebuilding.
As a prerequisite, perform a full build once (see above). Now perform the following steps to watch and automatically build on every file change in any package.
-
Via Terminal:
yarn watch
-
Via VSCode Tasks: Start the following tasks either via Ctrl+T or menu
Terminal > Run Task...
Watch all packages
To debug the Theia components, start backend and frontend via the VSCode launch configs:
- Both the Model Server and the GLSP Server are started already.
- Start debug launch configurations either:
- via the
Debug
view - via the
Debug sidebar
in the VSCode statusbar - via the
Debug command palette
, accessible with shortcut Ctrl+F11
- via the
- Start the Theia backend via the debug launch configuration
Start Browser Backend (expects running GLSP Server instance)
. - Start the chrome debug launch configuration
Launch Chrome against localhost
. - Check the outputs in the
Debug Console Panel
(open it via the menuView --> Debug Console
).
To debug the frontend components, please install the recommended Debugger for Chrome extension.
Hints:
- General documentation on Debugging in VSCode
- FYI: The Eclipse Keymap extension ports popular Eclipse keybindings to VSCode.
Create a npm user and login to the npm registry, more on npm publishing.
npm login
Publish packages with lerna to update versions properly across local packages, more on publishing with lerna.
npx lerna publish
Build the Server
mvn install -U
Start client, server and the tests. (Client and Server will shutdown after the execution of the tests).
yarn e2etest
Start the tests if client and server are already running.
yarn testcafe:start
Please keep the mouse focus on the Testcafe window during the tests. Losing focus will cause tests to fail.
To enable video capturing for failed tests, add the following configurations to .testcaferc.json.
"videoPath": "./tests/results/videos",
"videoOptions": {
"singleFile": true,
"failedOnly": true,
"pathPattern": "${DATE}_${TIME}/test-${TEST_INDEX}/${USERAGENT}/${FILE_INDEX}.mp4"
}