Skip to content

Commit c699bdf

Browse files
authored
Update examples to GLSP 2.0 (#194)
- Update `node-json-theia` template - Update `node-json-vscode` template - Update `workflow-example` and switch to workflow node server - Update `java-emf-theia` template - Update `jave-emf-eclipse` template Fixes eclipse-glsp/glsp#1012
1 parent adfa734 commit c699bdf

File tree

366 files changed

+34604
-43365
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

366 files changed

+34604
-43365
lines changed

Jenkinsfile

+27-68
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ kind: Pod
44
spec:
55
containers:
66
- name: ci
7-
image: eclipseglsp/ci:alpine-v3.1
7+
image: eclipseglsp/ci:alpine-v5.0
88
tty: true
99
resources:
1010
limits:
@@ -59,35 +59,25 @@ pipeline {
5959
environment {
6060
YARN_CACHE_FOLDER = "${env.WORKSPACE}/yarn-cache"
6161
SPAWN_WRAP_SHIM_ROOT = "${env.WORKSPACE}"
62-
EMAIL_TO= "[email protected]"
62+
EMAIL_TO= "[email protected]"
63+
PUPPETEER_SKIP_DOWNLOAD="true"
6364
}
6465

6566
stages {
6667

6768
stage('Build Workflow Example') {
6869
when {
6970
expression {
70-
sh(returnStatus: true, script: 'git diff --name-only HEAD^ | grep --quiet "^workflow/\\(glsp-client\\|glsp-server\\)"') == 0
71+
sh(returnStatus: true, script: 'git diff --name-only HEAD^ | grep --quiet "^workflow/"') == 0
7172
}
7273
}
7374
stages {
74-
stage('Build Server') {
75-
steps{
76-
timeout(30){
77-
container('ci') {
78-
dir('workflow/glsp-server/'){
79-
sh "mvn clean verify -DskipTests -B -Dcheckstyle.skip"
80-
}
81-
}
82-
}
83-
}
84-
}
85-
stage('Build Client') {
75+
stage('Build') {
8676
steps {
8777
timeout(30){
8878
container('ci') {
89-
dir('workflow/glsp-client/') {
90-
sh 'yarn --unsafe-perm'
79+
dir('workflow') {
80+
sh 'yarn install --unsafe-perm'
9181
}
9282
}
9383
}
@@ -119,7 +109,7 @@ pipeline {
119109
timeout(30){
120110
container('ci') {
121111
dir('project-templates/java-emf-theia/glsp-client') {
122-
sh 'yarn --unsafe-perm'
112+
sh 'yarn install --unsafe-perm'
123113
}
124114
}
125115
}
@@ -131,27 +121,16 @@ pipeline {
131121
stage('Build node-json-theia template') {
132122
when {
133123
expression {
134-
sh(returnStatus: true, script: 'git diff --name-only HEAD^ | grep --quiet "^project-templates/node-json-theia/\\(glsp-client\\|glsp-server\\)"') == 0
124+
sh(returnStatus: true, script: 'git diff --name-only HEAD^ | grep --quiet "^project-templates/node-json-theia/"') == 0
135125
}
136126
}
137127
stages {
138-
stage('Build server'){
128+
stage('Build'){
139129
steps{
140130
timeout(30){
141131
container('ci') {
142-
dir('project-templates/node-json-theia/glsp-server/'){
143-
sh 'yarn --unsafe-perm'
144-
}
145-
}
146-
}
147-
}
148-
}
149-
stage('Build client'){
150-
steps{
151-
timeout(30){
152-
container('ci') {
153-
dir('project-templates/node-json-theia/glsp-client') {
154-
sh 'yarn --unsafe-perm'
132+
dir('project-templates/node-json-theia') {
133+
sh 'yarn install --unsafe-perm'
155134
}
156135
}
157136
}
@@ -163,27 +142,16 @@ pipeline {
163142
stage('Build node-json-vscode template') {
164143
when {
165144
expression {
166-
sh(returnStatus: true, script: 'git diff --name-only HEAD^ | grep --quiet "^project-templates/node-json-vscode/\\(glsp-client\\|glsp-server\\)"') == 0
145+
sh(returnStatus: true, script: 'git diff --name-only HEAD^ | grep --quiet "^project-templates/node-json-vscode/"') == 0
167146
}
168147
}
169148
stages {
170-
stage('Build server'){
149+
stage('Build'){
171150
steps{
172151
timeout(30){
173152
container('ci') {
174-
dir('project-templates/node-json-vscode/glsp-server/'){
175-
sh 'yarn --unsafe-perm'
176-
}
177-
}
178-
}
179-
}
180-
}
181-
stage('Build client'){
182-
steps{
183-
timeout(30){
184-
container('ci') {
185-
dir('project-templates/node-json-vscode/glsp-client') {
186-
sh 'yarn --unsafe-perm'
153+
dir('project-templates/node-json-vscode') {
154+
sh 'yarn install --unsafe-perm'
187155
}
188156
}
189157
}
@@ -204,7 +172,7 @@ pipeline {
204172
timeout(30){
205173
container('ci') {
206174
dir('project-templates/java-emf-eclipse/glsp-client') {
207-
sh 'yarn --unsafe-perm'
175+
sh 'yarn install --unsafe-perm'
208176
}
209177
}
210178
}
@@ -229,16 +197,13 @@ pipeline {
229197
stage ('Lint workflow example') {
230198
when {
231199
expression {
232-
sh(returnStatus: true, script: 'git diff --name-only HEAD^ | grep --quiet "^workflow/\\(glsp-client\\|glsp-server\\)"') == 0
200+
sh(returnStatus: true, script: 'git diff --name-only HEAD^ | grep --quiet "^workflow/"') == 0
233201
}
234202
}
235203
steps {
236204
timeout(30) {
237205
container('ci') {
238-
dir('workflow/glsp-server'){
239-
sh 'mvn checkstyle:check'
240-
}
241-
dir('workflow/glsp-client') {
206+
dir('workflow') {
242207
sh 'yarn lint -o eslint.xml -f checkstyle'
243208
}
244209
}
@@ -259,7 +224,7 @@ pipeline {
259224
sh 'mvn checkstyle:check'
260225
}
261226
dir('project-templates/java-emf-theia/glsp-client/'){
262-
sh 'yarn lint -o eslint.xml -f checkstyle'
227+
sh 'yarn lint:ci'
263228
}
264229
}
265230
}
@@ -280,7 +245,7 @@ pipeline {
280245
sh 'mvn checkstyle:check'
281246
}
282247
dir('project-templates/java-emf-eclipse/glsp-client/'){
283-
sh 'yarn lint -o eslint.xml -f checkstyle'
248+
sh 'yarn lint:ci'
284249
}
285250
}
286251
}
@@ -290,18 +255,15 @@ pipeline {
290255
stage ('Lint node-json-theia') {
291256
when {
292257
expression {
293-
sh(returnStatus: true, script: 'git diff --name-only HEAD^ | grep --quiet "^project-templates/node-json-theia/\\(glsp-client\\|glsp-server\\)"') == 0
258+
sh(returnStatus: true, script: 'git diff --name-only HEAD^ | grep --quiet "^project-templates/node-json-theia/"') == 0
294259
}
295260
}
296261
steps {
297262
timeout(30) {
298263
container('ci') {
299-
dir('project-templates/node-json-theia/glsp-server/'){
264+
dir('project-templates/node-json-theia/'){
300265
sh 'yarn lint:ci'
301266
}
302-
dir('project-templates/node-json-theia/glsp-client/'){
303-
sh 'yarn lint -o eslint.xml -f checkstyle'
304-
}
305267
}
306268
}
307269
}
@@ -310,18 +272,15 @@ pipeline {
310272
stage ('Lint node-json-vscode') {
311273
when {
312274
expression {
313-
sh(returnStatus: true, script: 'git diff --name-only HEAD^ | grep --quiet "^project-templates/node-json-vscode/\\(glsp-client\\|glsp-server\\)"') == 0
275+
sh(returnStatus: true, script: 'git diff --name-only HEAD^ | grep --quiet "^project-templates/node-json-vscode/"') == 0
314276
}
315277
}
316278
steps {
317279
timeout(30) {
318280
container('ci') {
319-
dir('project-templates/node-json-vscode/glsp-server/'){
281+
dir('project-templates/node-json-vscode/'){
320282
sh 'yarn lint:ci'
321283
}
322-
dir('project-templates/node-json-vscode/glsp-client/'){
323-
sh 'yarn lint -o eslint.xml -f checkstyle'
324-
}
325284
}
326285
}
327286
}
@@ -340,9 +299,9 @@ pipeline {
340299

341300
// Record & publish esLint issues
342301
recordIssues enabledForFailure: true, publishAllIssues: true, aggregatingResults: true,
343-
tools: [esLint(pattern: '**/glsp-client/node_modules/**/*/eslint.xml')],
302+
tools: [esLint(pattern: '**/node_modules/**/*/eslint.xml')],
344303
qualityGates: [[threshold: 1, type: 'TOTAL', unstable: true]]
345-
304+
346305
// Record maven,java warnings
347306
recordIssues enabledForFailure: true, skipPublishingChecks:true, tools: [mavenConsole(), java()]
348307
}

README.md

+18-75
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,9 @@ Each example is self-contained and provides both, an example diagram client (`gl
99

1010
The following libraries/frameworks need to be installed on your system:
1111

12-
- [Node.js](https://nodejs.org/en/) `>=14.18.0`
13-
- [Yarn](https://classic.yarnpkg.com/en/docs/install#debian-stable) `>=1.7.0`
14-
- [Java](https://www.oracle.com/java/technologies/javase-jdk11-downloads.html) `>=11`
12+
- [Node.js](https://nodejs.org/en/) `>=16.11.0`
13+
- [Yarn](https://classic.yarnpkg.com/en/docs/install#debian-stable) `>=1.7.0 < 2.x.x`
14+
- [Java](https://www.oracle.com/java/technologies/javase-jdk11-downloads.html) `>=17`
1515
- [Maven](https://maven.apache.org/) `>=3.6.0`
1616

1717
The examples are heavily interwoven with Eclipse Theia, so please also check the [prerequisites of Theia](https://github.com/eclipse-theia/theia/blob/master/doc/Developing.md#prerequisites).
@@ -30,90 +30,34 @@ However, it's of course also possible to use any other IDE or text editor.
3030

3131
<img src="documentation/workflow-example-animated.gif" alt="drawing" width="400"/>
3232

33-
### VS Code workspaces
33+
## Building the examples & project templates
3434

35-
To work with the source code and debug the examples in VS Code dedicated VS Code Workspace files for each example are provided.
36-
These workspace include both the `glsp-client` and `glsp-server` sources and offer dedicated launch configurations for debugging purposes.
37-
38-
To open a example workspace simply start a VS Code instance and use the `Open Workspace from File..` entry from the `File` menu.
39-
Then navigate to a example or project template subdirectory (e.g. `workflow`) and open the `*.vscode-workspace` file.
40-
41-
For a smooth development experience we recommend a set of useful VS Code extensions. When a workspace is first opened VS Code will ask you wether you want to install those recommended extensions.
42-
Alternatively, you can also open the `Extension View`(Ctrl + Shift + X) and type `@recommended` into the search field to see the list of `Workspace Recommendations`.
43-
44-
## Building the examples
45-
46-
The server component of each example has to be built using Maven, the client component has to be built using yarn. Convenience scripts to build both components at once are provided.
47-
To build all examples simply execute the following in the repository root:
35+
To build all examples & project templates simply execute the following in the repository root:
4836

4937
```bash
5038
yarn build
5139
```
5240

53-
In addition, it is also possible to build each example individually:
41+
In addition, it is also possible to build each example or template individually:
5442

5543
```bash
56-
# Build only the workflow example
5744
yarn build:workflow
45+
yarn build:java-emf-theia
46+
yarn build:node-json-theia
47+
yarn build:node-json-vscode
48+
yarn build:java-emf-eclipse
5849
```
5950

60-
## Running the examples
61-
62-
Each example provides a dedicated Theia web app which can be started from the repository root with `yarn start:<example_name>`:
63-
64-
```bash
65-
# Start workflow example Theia app
66-
yarn start:workflow
67-
```
68-
69-
This will launch the example in the browser on [localhost:3000](http://localhost:3000).
51+
## Running & Debugging the examples
7052

71-
> **Note** that each example will be launched at the same port (`3000`).
72-
> Therefore it's currently not possible to launch multiple example Theia apps simultaneously.
53+
Each example and project template contains a dedicated README with detailed instructions on how to run und debug them.
7354

74-
## Debugging the examples
55+
### Debugging the Jave GLSP Server in Eclipse
7556

76-
Theia applications run in two separate process the `Theia Frontend` and the `Theia Backend` process.
77-
In addition, the GLSP Server runs in a third separated process.
78-
Each process can be debugged individually and the [example workspaces](#vscode-workspaces) provides dedicated debug configurations.
79-
80-
To start debugging open a example workspace and then navigate to the `Run and Debug` view (Ctrl + Shift + D).
81-
82-
Here you can choose between four different debug configurations:
83-
84-
- `Launch <example-name> Theia Backend (Embedded GLSP Server)`: <br>
85-
This config can be used to launch the example Theia Backend node process in Debug Mode.
86-
Breakpoints in the backend source files of the theia integration package (`<example-name>-theia`) will be picked up.
87-
The backend process includes the source files in `src/node` and `src/common`.
88-
This launch config will start the GLSP server as embedded process which means you don't have to start the server process manually beforehand.
89-
However, this also means you won't be able to debug the GLSP Server source code.
90-
- `Launch <example-name> Theia Backend (External GLSP Server)`<br>
91-
This config can be used when both the Theia Backend and the GLSP Server process should be debugged.
92-
It will launch the Theia Backend node process in Debug mode
93-
but will not start an embedded GLSP server process.
94-
It expects that the GLSP Server process is already running and has been started externally (e.g. through another VS Code launch config or in the Eclipse IDE).
95-
- `Launch <example-name> Theia Frontend`<br>
96-
This config can be used to launch the example Theia Frontend process in Debug Mode and directly debug the sources in VS Code.
97-
Breakpoints in the frontend source files of the `glsp-client` packages will be picked up. A browser window pointing to [localhost:3000](http://localhost:3000) will be opened automatically.
98-
- `Launch <example-name> GLSP Server`<br>
99-
This config can be used to launch the example GLSP server Java process in Debug Mode.
100-
Breakpoint the Java source files of the `glsp-server` directory will be picked up.
101-
In order to use this config, the Theia backed has to be launched in `External` server mode.
102-
This can either be done with the corresponding launch config or, if you are not interested in debugging the Theia backend, it can also be launched in normal mode by executing `yarn start:external` in the `glsp-client` directory.
103-
104-
Naturally the Theia frontend process can also be debugged with the built-in `Debugging Tools` of the browser.
105-
Simply go to [localhost:3000](http://localhost:3000) and open the `Debugging Tools` of your browser.
106-
For instance for Google Chrome the `Debugging Tools` can be open with `F12` or `Ctrl+ Shift + I`.
107-
108-
> **Note** Parts of the server source may be generated from a graph `.ecore` model.
109-
> Adapting this model and regenerating the source code can only be done in the Eclipse IDE because VS Code has currently no Ecore support.
110-
111-
### Debugging the GLSP Server in Eclipse
112-
113-
All example GLSP servers are maven projects which can be imported directly into the Eclipse IDE.
57+
All Java example GLSP servers are maven projects which can be imported directly into the Eclipse IDE.
11458
In contrast to the Java support in VS Code, Eclipse also offers Ecore tooling which is required to manipulate or extend the graph Ecore models (e.g. [`workflow-graph.ecore`](workflow/glsp-server/src/main/resources/workflow-graph.ecore).
11559

116-
We recommend to use the [`Eclipse Modeling Tools`](https://www.eclipse.org/downloads/packages/release/2021-12/r/eclipse-modeling-tools) package as it already provides most needed plugins out of the box.
60+
We recommend to use the [`Eclipse Modeling Tools`](https://www.eclipse.org/downloads/packages/release/2023-09/r/eclipse-modeling-tools) package as it already provides most needed plugins out of the box.
11761
Only the [`M2E` plugin](https://github.com/eclipse-m2e/m2e-core/blob/master/README.md#-installation) has to be installed on top to enable maven support in Eclipse.
11862

11963
Use the file menu to import a `glsp-server` maven project into the Workspace ( File -> Import... -> Maven -> Existing Maven Projects).
@@ -137,7 +81,6 @@ If you have questions, please raise them in the [discussions](https://github.com
13781

13882
## License
13983

140-
- [Eclipse Public License 2.0](LICENSE-EPL)
141-
- [一 (Secondary) GNU General Public License, version 2 with the GNU Classpath Exception](LICENSE-GPL)
142-
- [一 (Secondary) MIT License](LICENSE-MIT)
143-
84+
- [Eclipse Public License 2.0](LICENSE-EPL)
85+
- [一 (Secondary) GNU General Public License, version 2 with the GNU Classpath Exception](LICENSE-GPL)
86+
- [一 (Secondary) MIT License](LICENSE-MIT)

package.json

+6-12
Original file line numberDiff line numberDiff line change
@@ -26,17 +26,11 @@
2626
"scripts": {
2727
"build": "yarn build:workflow && yarn build:project-templates",
2828
"build:project-templates": "yarn build:java-emf-theia && yarn build:node-json-theia && yarn build:node-json-vscode && yarn build:java-emf-eclipse",
29-
"build:java-emf-theia": "yarn --cwd project-templates/java-emf-theia build",
30-
"build:node-json-theia": "yarn --cwd project-templates/node-json-theia build",
31-
"build:node-json-vscode": "yarn --cwd project-templates/node-json-vscode build",
32-
"build:java-emf-eclipse": "yarn --cwd project-templates/java-emf-eclipse build",
33-
"build:workflow": "yarn build:workflow:server && yarn build:workflow:client",
34-
"build:workflow:server": "mvn -f workflow/glsp-server/pom.xml clean verify",
35-
"build:workflow:client": "yarn --cwd workflow/glsp-client install",
36-
"start:workflow": "yarn --cwd workflow/glsp-client/workflow-browser-app start"
37-
},
38-
"devDependencies": {
39-
"@eclipse-glsp/config": "1.1.0-next.d03ad9f.112",
40-
"typescript": "^4.9.3"
29+
"build:java-emf-theia": "yarn --cwd project-templates/java-emf-theia install",
30+
"build:node-json-theia": "yarn --cwd project-templates/node-json-theia install",
31+
"build:node-json-vscode": "yarn --cwd project-templates/node-json-vscode install",
32+
"build:java-emf-eclipse": "yarn --cwd project-templates/java-emf-eclipse install",
33+
"build:workflow": "yarn --cwd workflow install",
34+
"start:workflow": "yarn --cwd workflow/workflow-browser-app start"
4135
}
4236
}

0 commit comments

Comments
 (0)