|
|
## Create standard Xtext Project.
|
|
|
|
|
|
1. File -> New -> Project... -> Xtext -> XText Project
|
|
|
2. Choose the name, for demonstration purposes we take the default name as it is proposed by XText.
|
|
|
3. Preferred Build System must be Maven, Build Language Server can be set to None, since it is not in the scope of this tutorial.
|
|
|
|
|
|
## Create Empty Plugin-Project.
|
|
|
|
|
|
1. File -> New -> Project... -> Plugin Development -> Plugin Project
|
|
|
2. It is good to choose the project name in a such way, that it contains the prefix of our xtext project, i.e. org.xtext.mydsl.pluginname.
|
|
|
3. Uncheck `This Project will make contributions to the UI` and set `Create a rich client application` to `no`
|
|
|
4. Choose `Headles Hello RCP` template and click `finish`
|
|
|
5. Create an empty pom.xml
|
|
|
6. Paste the xml-code provided bellow into the pom.xml
|
|
|
|
|
|
|
|
|
```
|
|
|
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
|
|
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
|
|
<modelVersion>4.0.0</modelVersion>
|
|
|
<parent>
|
|
|
<groupId>org.xtext.example.mydsl</groupId>
|
|
|
<artifactId>org.xtext.example.mydsl.parent</artifactId>
|
|
|
<version>1.0.0-SNAPSHOT</version>
|
|
|
</parent>
|
|
|
<artifactId>org.xtext.example.mydsl.cli</artifactId>
|
|
|
<packaging>eclipse-plugin</packaging>
|
|
|
|
|
|
</project>
|
|
|
|
|
|
```
|
|
|
## Create empty project.
|
|
|
1. File -> New -> Other -> General -> Project
|
|
|
2. Now we need to create a product file. Right click on the project -> New -> Other -> Plugin Development-> Product Configuration
|
|
|
3. In the wizard select, `Create a configuration file with basic settings `
|
|
|
4. Set file name to org.xtext.example.mydsl.product
|
|
|
5. Click Finish
|
|
|
6. Create pom with the content shown below
|
|
|
|
|
|
```
|
|
|
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
|
|
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
|
|
<modelVersion>4.0.0</modelVersion>
|
|
|
<parent>
|
|
|
<groupId>org.xtext.example.mydsl</groupId>
|
|
|
<artifactId>org.xtext.example.mydsl.parent</artifactId>
|
|
|
<version>1.0.0-SNAPSHOT</version>
|
|
|
</parent>
|
|
|
<artifactId>org.xtext.example.mydsl.product</artifactId>
|
|
|
<packaging>eclipse-plugin</packaging>
|
|
|
|
|
|
</project>
|
|
|
|
|
|
```
|
|
|
7. Create META-INF folder and create Manifest.MF file inside it.
|
|
|
|
|
|
## Make Plugin project and product project children of parent
|
|
|
1.Remove all projects from the Eclipse (do not delete the on disk!) and close it.
|
|
|
2. Navigate to the directory of your eclipse workspace.
|
|
|
3. Put the folders asociated with the plugin and product projects inside the parent folder of the XText project.
|
|
|
4. Open the parent folder and edit the pom file inside. You must add the plugin project to the list of the modules of the XText child projects:
|
|
|
|
|
|
```
|
|
|
<modules>
|
|
|
<module>org.xtext.example.mydsl</module>
|
|
|
<module>org.xtext.example.mydsl.ide</module>
|
|
|
<module>org.xtext.example.mydsl.ui</module>
|
|
|
<module>org.xtext.example.mydsl.target</module>
|
|
|
<module>org.xtext.example.mydsl.tests</module>
|
|
|
<module>org.xtext.example.mydsl.ui.tests</module>
|
|
|
<!-- add these projects -->
|
|
|
<module>org.xtext.example.mydsl.cli</module>
|
|
|
<module>org.xtext.example.mydsl.product</module>
|
|
|
</modules>
|
|
|
```
|
|
|
|
|
|
5. Start eclipse and import the XText project as Maven project.
|
|
|
You should see in the project explorer that the plugin and prodct projects are now seen as children of org.xtext.example.mydsl.parent project. |