Unable to create Eclipse Product from the sample MyDsl projects [message #1844460] |
Tue, 14 September 2021 13:30 |
Franck De Bruijn Messages: 7 Registered: July 2013 |
Junior Member |
|
|
Hi,
I try to create an Eclipse product from the standard example DSL by using the wizards in Eclipse to create an XTEXT project.
I create the mydsl projects with the options 'Eclipse plug-in', 'Create Feature', 'Create Update Site', 'Testing Support', 'Maven', 'None' and 'Plain' (see also the attached picture wizard.png).
After I run the MWE2 workflow, I can then run the Eclipse application from Eclipse (Run As > Eclipse Application).
The maven build successfully builds the feature and the update site. I have been able to install the newly created feature into a vanilla Eclipse application.
So, that all works nicely out-of-the-box (many thanks for that, by the way, really appreciated).
Now my final step is to create an Eclipse product. I have followed a bunch of books, tutorials (Vogella) and blogs (https://kthoms.wordpress.com/2010/11/12/setting-up-a-rcp-product-for-a-dsl/) and also tried downloading all kinds of projects from GitHub, but I don't seem to get it working. I have the feeling that all this information has become outdated.
As a last resort I tried to compile an Eclipse product configuration by hand, but that resulted in dependency problems (when I chose 'Features', I could not include the google plugins; when I chose 'Plug-ins' I drowned in the dependencies).
Is there anyone who could highlight the steps I need to take to get this to work? Or point me to some actual GitHub repository where I can have a look at?
I am using Eclipse 2021-06.
Any help is appreciated!
Many thanks,
Franck
-
Attachment: wizard.png
(Size: 26.38KB, Downloaded 60 times)
|
|
|
Re: Unable to create Eclipse Product from the sample MyDsl projects [message #1844462 is a reply to message #1844460] |
Tue, 14 September 2021 13:36 |
|
My blog post can be outdated, the general approach will still be valid. I apologize that I don't have the time to update it.
I hope you are in general familiar with building RCP products.
Maybe you start first setting up a build process for a vanilla feature-based RCP product. Once you get that running you can add the DSL feature to it, potentially add missing dependencies and it should work.
|
|
|
|
|
|
|
Re: Unable to create Eclipse Product from the sample MyDsl projects [message #1844551 is a reply to message #1844472] |
Thu, 16 September 2021 13:48 |
Franck De Bruijn Messages: 7 Registered: July 2013 |
Junior Member |
|
|
Thanks for both your support Christian and Karsten. Highly appreciated. With your help I have been able to get this to work.
Maybe other people stumble across the same problems I encountered. Below a list of steps that I took to get this to work. Maybe it is useful.
- Download/Install 'Eclipse IDE for Java and DSL Developers' from https://www.eclipse.org/downloads/packages/. Start with an empty workspace.
- Install the Eclipse plugin 'Tycho Project Configurations' from SonaType, Inc. Needed later to prevent errors in the maven pom.xml files.
- Create an XTEXT project with all the default settings (org.xtext.example.mydsl.MyDsl). On the 2nd page select the options 'Eclipse plug-in', 'Create Feature', 'Create Update Site', 'Preferred Build System = Maven', 'Build Language Server = None', 'Source Layout = Plain'.
- Create a general project 'org.xtext.example.mydsl.product' in the location <path to workspace>/org.xtext.example.mydsl.parent/org.xtext.example.mydsl.product.
- Within the 'product' project, create the product configuration file 'org.xtext.example.mydsl.product.product' and populate it with the content as listed below in this post.
- Within the 'product' project, create the maven configuration file 'pom.xml' and populate it with the content as listed below in this post.
- In the pom.xml of the project 'org.xtext.example.mydsl.parent' add 'org.xtext.example.mydsl.product' in the <modules> section below the module 'org.xtext.example.mydsl.repository'.
- In the same pom.xml as the previous step, add Eclipse to the list of repositories (within the <repositories> tag), like this (the url should match the repository location in the org.xtext.example.mydsl.target.target file):
<repository>
<id>eclipse</id>
<url>https://download.eclipse.org/releases/2021-03</url>
<layout>p2</layout>
</repository>
- Run the pom.xml of the project 'org.xtext.example.mydsl.parent' with the goals 'clean verify'
- If all goes well (you should see 'SUCCESS'), refresh your workspace. No errors should popup. You can fetch your product from 'org.xtext.example.mydsl.product\target\products\org.xtext.example.mydsl.product\win32\win32\x86_64'
NOTE: You should also not forget to change the 'Plug-in Development > Target Platform' in your preferences to 'org.xtext.example.mydsl.target'.
It's quite simple, really, once you know it ...
Cheers,
Franck
Product configuration file:
<?xml version="1.0" encoding="UTF-8"?>
<?pde version="3.5"?>
<product name="XTEXT Example DSL" uid="org.xtext.example.mydsl.product" id="org.eclipse.platform.ide" application="org.eclipse.ui.ide.workbench" version="1.0.0.qualifier" useFeatures="true" includeLaunchers="true">
<configIni use="default">
</configIni>
<launcherArgs>
<vmArgs>-Xms1024m
-Xmx2048m
</vmArgs>
<vmArgsMac>-XstartOnFirstThread -Dorg.eclipse.swt.internal.carbon.smallFonts
</vmArgsMac>
</launcherArgs>
<launcher>
<win useIco="false">
<bmp/>
</win>
</launcher>
<vm>
</vm>
<plugins>
</plugins>
<features>
<feature id="org.xtext.example.mydsl.feature" version="1.0.0.qualifier"/>
<feature id="org.eclipse.platform"/>
<feature id="org.eclipse.help"/>
<feature id="org.eclipse.equinox.p2.core.feature"/>
<feature id="org.eclipse.equinox.p2.extras.feature"/>
<feature id="org.eclipse.equinox.p2.user.ui"/>
<feature id="org.eclipse.equinox.p2.rcp.feature"/>
</features>
<configurations>
<plugin id="org.apache.felix.scr" autoStart="true" startLevel="2" />
<plugin id="org.eclipse.core.runtime" autoStart="true" startLevel="4" />
<plugin id="org.eclipse.equinox.common" autoStart="true" startLevel="2" />
<plugin id="org.eclipse.equinox.simpleconfigurator" autoStart="true" startLevel="1" />
<plugin id="org.eclipse.update.configurator" autoStart="true" startLevel="4" />
</configurations>
</product>
Maven Configuration File:
<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-repository</packaging>
<build>
<plugins>
<plugin>
<groupId>org.eclipse.tycho</groupId>
<artifactId>tycho-p2-director-plugin</artifactId>
<version>${tycho-version}</version>
<executions>
<execution>
<goals>
<goal>materialize-products</goal>
</goals>
<id>materialize-products</id>
</execution>
<execution>
<goals>
<goal>archive-products</goal>
</goals>
<id>archive-products</id>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>
|
|
|
Powered by
FUDForum. Page generated in 0.03887 seconds