I built a simple language server following this tutorial:
http://www.eclipse.org/Xtext/documentation/102_domainmodelwalkthrough.html
In this server, I have 5 folders,
org.example.domainmodel
org.example.domainmodel.ide
org.example.domainmodel.tests
org.example.domainmodel.ui
org.example.domainmodel.ui.tests
Now I need to run this language server inside a Docker image, and need the binary directory for it. Which binary directory out of the above 5 folders should I use? The actual language servers I've explored so far are quite different from what I've created.
The above project that I had created is used to develop Eclipse plugins. To create a LS to run in a Dockerfile, it is required to create a binary file (I used fatJar) from the Eclipse Xtext project that should be created as explained in this tutorial (Should only complete up to 'Packaging the LS', inclusive). Note that when packaging the LS, it is enough to add the following code snippet in the *.ide project's build.gradle file : -
Afterwards, the parent project should be built by
gradle shadowJar
command in the command prompt. Once it is done, a .jar file will be created in the following path:*.ide/build/libs
Then you'll need to create a separate directory and copy and paste the build folder into it, and create a file named
dockerfile
(no file extension) and include the following code in it: -Then build this file using Docker, and push it to your Docker Hub account as a repo. Use the following recipe to create a new stack in Eclipse Che to use the pushed repo from Docker Hub as a language server: -
Edit the raw config and update it with the following code at the respective location in the config (Read the che doc for more information: -
Create a file in a new project in Eclipse Che with the file extension you added (.mydsl) and the LS will start to run, allowing you to write code in your DSL.
Yay!