EclipseCon Europe 2016 – I’m coming!

130x130 I'm Speaking logo

I’m sitting now in the train on my way to Ludwigsburg. For sure I cannot miss this great event, where so many smart people and friends come together. Although ECE is always at the same time of the year and I knew for long that I want to go there again, it comes not at the best time for me – or better: for my family. The reason is a really positive one: Almost 3 weeks ago on October 4th I became for the second time father of a lovely daughter, Sophia.

IMG_1433.jpg

I am missing her already deeply, and my wife would need some supporting hands at home right now. However she understands that EclipseCon is important for me and supports me. The past weeks I did not get much sleep, but the reason was mostly not Sophia, but mainly preparing my talks – in the late evening and night it was most suitable. I will definitely enjoy EclipseCon, but this year I will also be happy when I can leave towards home again and will take 3 days off afterwards for regeneration and caring for the family.

This year’s EclipseCon will be fully packed for me. Today, on Sunday, it will start with a small pre-conference event at the Rossknecht, where the Eclipse Scout community comes together. Tomorrow at the Unconference day I will attend the Eclipse Scout User Day, which I attended the past two years already. At the moment I do not work with Scout, but I really enjoyed working with this framework in the past and would like to do another project with it again. The recent year Scout has much evolved, and I am keen to learn all the news.

On tuesday the Xtext developers plan to schedule a BoF Session. A beta of Xtext 2.11 was released this week, and we have to work much now to make the 2.11 release round. I plan to invest quite some time on this, and we have to talk about the concrete tasks and collaboration. Since we are now a team spanning several companies, it is important to have the chance to get the whole team together at EclipseCon.

On wednesday it is time for action. I was recently contacted that the proposal for the session “Recipes to build Code Generators for Non-Xtext Models with Xtend” got picked from the waiting list. I will perform the talk with my colleague and friend Holger Schill.

screenshot 68.png

We give this talk because Xtend is a very nice language when it comes to developing template based code generators, but is mostly only used in the context of Xtext. Xtext projects seamlessly integrate a generator infrastructure with Xtend, but it is not that common to use Xtend based generators with models that are not Xtext DSL files. We will show how simple it can be to integrate Xtend for other use cases, e.g. with JSON as input.

After that talk we will participate at the Modeling Symposium (17:45 Theater Stage). There we will shortly (7 minutes slot only) present a generator fragment that creates an extension package for VisualStudio Code to embed support for a DSL with an embedded language server. The Language Server Protocol support is the main feature for Xtext 2.11. We plan to contribute the created generator fragment to the Xtext project.

On thursday it is time for my talk “From stairway to heaven onto the highway to hell with Xtext” (11:00 Theater Stage). In this talk I will explain why I love Xtext and why it is used successfully in so many projects first, but then discuss where users have or run into trouble when using the framework. We see in many projects that first steps are easily done and don’t require much experience, but as requirements grow the complexity of DSL projects also grow and extensive experience with details of Xtext and the technologies behind is crucial. I hopefully compiled an informative set of issues.

screenshot 69.png

One Xpand user less, one happy Xtend user more

This week I am consulting a customer who had introduced a model based development approach based almost 10 years ago and used it with success since then. At the time back then Xpand was the most powerful code generation engine and UML models were often used to generate code from. Xtext did not even exist at that time. The customer uses Enterprise Architect and the Enterprise Architect exporter from the components4oaw. The last release was in 2011 and the project has not been developed further. For my customer the component just did what it should, so there was no direct need to change anything at the process. The EA exporter has its flaws, especially since it needs an Enterprise Architect installation and this means it only works on Windows machines. For Enterprise Architect users who do model based development, we therefore offer the YAKINDU Enterprise Architect Bridge, which scales better and can process .eap models on any platform.

My task was to help the customer to modernize their tool chain. To be fair, Xpand is not the right choice anymore. The Xtend Language combines the strengths from Xpand (great templating support, functional programming, static typing, polymorphic dispatch, mature Eclipse tooling) and resolved some weaknesses (performance, compiled code instead of interpreted, Java integration, extensibility of expressions).

For the customer who never had used Xtend so far, but was quite familiar with Xpand, it was quite a surprise how close both languages really are. Most of the concepts can be mapped 1:1 from good old Xpand to Xtend. We created a small generator from scratch and copied functions and templates and translated them manually for demonstration. They understood Xtend within minutes then. Most of the work is monkey-see-monkey-do. For such cases I wrote a small migration script which can translate Xpand,Xtend(1) and Check code to Xtend(2) classes. We used that script now for an initial translation.

One of the reasons why this migration script is not published is that cannot translate Xpand code completely to Xtend. The tool parses Xpand templates and traverses the AST to transform the expressions to Xtend equivalents. But it does not know about the type system which is used by the generator.

And here Xtend is not as powerful as Xpand, especially when using UML. In Xpand, the UML type system adapter analyzed the applied profiles of a model to create virtual types for stereotypes. Elements with stereotypes applied can be processed as if they were of a subtype of the extended type, and tagged values became attributes. In Xtend, there is only the Java type system, and for processing UML models this means that templates have to use the UML metamodel directly. The old “feeling” of a real type system can be simulated with a set of extension functions. I usually introduce an extension class per profile which offers for example a method per tagged value. The creation of such an extension class can again be automated by generating it from a profile .uml model.

Another disadvantage against the Xpand framework is that Xtend is not a code generation framework, but a general purpose programming language. How a generator component looks like that invokes the templates, where to produce output to, how to integrate constraint checks, this all is not provided.

What I usually do here is to use Xtext’s infrastructure like the IGenerator interface and validation based on Xtext’s AbstractDeclarativeValidator and @Check annotations. I reuse Xtext’s MWE Reader and Generator component. However, this requires some work and advanced knowledge. The basic approach is here to make UML models recognized by Xtext as a generic EMF resource. To actually use the Xtext components, a generator specific Guice module has to be created which extends AbstractGenericResourceRuntimeModule and satisfy several dependencies which an Xtext language already as configured by default. A good part of the approach was described by Christian Dietrich in his blog posts “Xtend2 Code Generators with Non-Xtext Models” and “Xtext 2.0 and UML“. I may go into details in a later blog post.

Although Xtend is such a natural choice for writing code generators and it is so well-integrated in the Xtext ecosystem, there is framework support missing for non-Xtext models. It is easy to write a trivial framework, but why should everyone start writing their own when good infrastructure already exists in the Xtext framework? From what I experienced again, there is need to have some more framework support for this use case. I doubt that it could be part of Xtext itself, but maybe we will provide a framework for Xtend based code generators in the future.

At the end we were able to show and demonstrate a migration path in one single workshop day. The customer was happy to save several days or weeks of time. The workshop costs were compensated by far for them. From a sales perspective it might not be wise to leave a customer in a state where he is not dependent on our services in the next time, but this is not how we work. For me it feels right.

Give a man a fish and you feed him for a day; teach a man to fish and you feed him for a lifetime.

Preparations for CodeGeneration 2013

As I am addicted to code generation and DSLs, the CodeGeneration conference in Cambridge is always a must each year. Last year I could not make it, since I had the chance to speak at EclipseCon North America, which was in the same week. This year Mark took EclipseCon into his considerations (it was last week), so me and my colleagues from itemis will be there again. Actually, this year we will be more itemis guys then ever. Mark already assumed in his opening words at CG2011 that almost everyone from itemis would be there, this year we prove itemis is larger. I think our company is so close related to the conference theme that it is natural that we have lots to present, and much interest to hear others about what they are doing and have learned in the past.

screenshot 2013-04-05 um 10.55.19

Before the actual CodeGeneration conference starts on Wednesday, there are some pre-conference activities. My colleagues Holger Schill and Moritz Eysholdt will hold an intensive 2-day Xtext workshop on monday and tuesday.

I will arrive monday noon, since I take the early flight directly from my hometown Dortmund to London Luton. From there, I have to take a 2 hour bus trip to Cambridge. In the evening, I plan to meet Holger, Moritz, Meinte Boersma and hopefully some others in the Castle Inn pub. When you arrive on monday, drop into the Castle Inn roughly at 20 PM (I guess we go to a restaurant before). You can reach me there on my mobile phone: screenshot 2013-04-05 um 12.30.02

DSC00412

On tuesday this year’s Language Workbench Challenge summit takes place. We have 14 submissions (wow!) for the LWC13 assignment. I have been working on the Xtext submission together with 2 colleagues, Johannes Dicks and Thomas Kutz. The results are available as open-source project lwc13-xtext at Eclipselabs. We have prepared a detailed step-by-step tutorial as submission paper. The resulting document LWC13-XtextSubmission.pdf is available for download. On the project homepage I have placed today a quick start tutorial. Oh boy, this project did cost some time. The actual solution is not much code, but as often, it is harder to write less code than more. It could be even less, but we took care of that the code is readable and understandable. And writing the document is at least that much work as the implementation.

screenshot 2013-04-08 um 13.52.06

Every presenter has only 15 minutes to present their approach. 15 minutes presentation for that much work. I guess that the other participants did invest also quite some time. Both of my co-authors got the chance to visit the conference, and Thomas will support me with the presentation. He will demo the resulting JSF application and DSL source code while I do the main talking. We did a test run of the talk yesterday evening, and easily exceeded 20 minutes. I think Angelo will bring his egg timer again, which begs no pardon with the talk time of speakers. But only that way we will be able to run 14 talks on one day. We will have to restrict on the most important aspects only.

Besides my colleagues Thomas and Johannes also Sven Lange will join us then. I have the pleasure to work with him in my long-time project at Deutsche Börse (German Stock Exchange), now since over half a year. Sven is a highly motivated, skilled and smart person. It is still the same project I have reported about at CodeGeneration 2009 together with my former colleague Heiko Behrens. Sven is full-time working on this project, while I am for 20% scheduled. We have migrated here a huge code generator project from Xpand to Xtend. This alone would be worth an experience report session. Sven is working on Xtend support for IntelliJ, which he might present in a Lightning Talk on wednesday.

Wednesday the conference will start. I will have my main talk “Alive and Kicking with Code Generation” together with Dr. Boris Baginski from ATOSS Software AG after lunch at 13:45.

screenshot 2013-04-05 um 10.57.34

Currently we are finalizing our presentation slides. Boris has been ill for some days and busy with a new release of their ASES product, a workforce management suite. This is really an interesting customer and project. They are evolving this product now for 25 years, and they make use of code generation for ages. I think one can say that it helped them to survive in their business, some contestants did not manage to make larger platform shifts and died. Most of them tried a big-bang replacement, but the business is too fast evolving so that the target is moving steadily. Boris and I will speak about this product and how it has been evolved over the years. ATOSS was one of the first major projects using openArchitectureWare 4 (which mainly means Xpand), and now they are currently preparing a shift to Xtend.

I am glad that this talk is already on wednesday, I never come to rest until I finished some talk. After it, I can just relax and enjoy the conference. I am expecting some interesting insights on different approaches. Especially experience reports are interesting for me. I did not finally decide which sessions I will attend. At the moment I plan to see John Hutchinson with “The Use of Model-Driven Development in Industry” in the morning, and Darius Silingas with “Why MDA Fails: Analysis of Unsuccessful Cases” in the afternoon.

In the evening it is again time for the punting boat tour. I already attended three times, but it will be great fun again for sure. Let’s hope the weather is not too bad. I saw a prediction of ~10°C and possibility of light shower. In the past we had luck, and on a warm, sunny day the tour is double fun. However, I’ll better put an umbrella into the suitcase.

On thursday I have again an active part in the hands-on session “Have Your Language Built While You Wait”, which is hosted by Risto Pohjonen from MetaCase. The idea of this session is that attendees can get a DSL with the language workbench of their choice built with the help of experts for this workbench. Of course I will assist on Xtext. If you had no chance to visit the Xtext workshop this might be your chance to get some hands on Xtext. This session was already run last year successfully. Last year my colleague Benjamin Schwertfeger took over the Xtext part, since we were at EclipseCon.

There are also some other talks around Xtext and Xtend. Both have been released in version 2.4 on March 20th, which brings some interesting new features. Most notably in regard to code generation are the Active Annotations. I guess this is also part of what Sven Efftinge will adress as future of code generation in his keynote “The Past, Present and Future of Code Generation” wednesday morning. More details he will present together with Sebastian Zarnekow in the tutorial “Internal DSLs with Xtend” (thursday 10:45-12:00). The last Xtext related talk will be from Moritz Eysholdt, called “Executable Specifications for Xtext Languages” (friday 10:45-12:15). I am actually not sure which of these talks I will attend personally. They are most relevant for my work, and I don’t work close enough with them to catch everything new in Xtext on my own. Thus, I’ll definetely would learn important aspects. On the other side, there are also other interesting talks in parallel.

The coming week will be an intensive experience with lots to learn and interesting persons to meet. Although I will really enjoy this time, I will be glad when I finally come back home. At the moment, my family is ill and I hope that I get not infected these days. I have been looking forward and worked for this event, so I am crossing fingers when I can board monday morning healthy.

I am sure the organizing team around Mark and Jacqui will do again a great job.

DSC00363

See you there and let’s make this event special!

Fornax Workflow Plugin 3.4.0 released

Finally I have managed to release a new version of the Fornax Maven Workflow Plugin again. This Maven plugin allows execution of MWE and MWE2 workflows from Maven, which is typically the case if you want to automate the build of Xtext or Xpand based projects with Maven.

The new version has some interesting new features which may be worth upgrading:

  • m2e lifecycle metadata
  • workflow dependencies can be configured as plugin dependencies
  • more options to detect changes that trigger the build
  • force/skip parameter to configure workflow execution overrides per configuration
  • log level detection when running in forked JVM

I have especially to thank Dieter Schulten from escalon, who has been willing to contribute to this release. He has mainly contributed the m2e configuration and some tests for the plugin.

Xtext Content Assist: Escape identifiers conflicting with keywords

I have faced in Spray the situation that a segment of a package name of a qualified Java type conflicts with a keyword of the Spray language. Specifically you can refer to custom features with the custom keyword, and the referred type was in a package containing also the name custom.

When inserting the proposed qualified name this results in an error due to the keyword collision.

The qualified name is usually combined through a sequence of ID rules, which allows escaping an identifier by prefixing it with the ^ character in the case of conflict with a keyword.

For content assist it would now be useful if the inserted string would be automatically escaped. So here is a way to solve this.

My first approach was to override the completeJvmParameterizedTypeReference_Type() method from the proposal provider and modify the proposals through a custom ICompletionProposalAcceptor. Sebastian Zarnekow commented that the proper way would be to register a IValueConverter for QualifiedName. I tried to do so, but was not successful. Actually there is already an QualifiedNameValueConverter registered.

My next solution is now to subclass JdtTypesProposalProvider and pass a custom IValueConverter. The overridden methods just pass null as converter, thus do no conversion. I am reusing the QualifiedNameValueConverter here, since it does the necessary keyword escaping.

public class SprayJdtTypesProposalProvider extends JdtTypesProposalProvider {
    @Inject
    private QualifiedNameValueConverter qnValueConverter;

    /**
     * Overridden to pass a default value converter
     */
    @Override
    public void createSubTypeProposals(JvmType superType, ICompletionProposalFactory proposalFactory, ContentAssistContext context, EReference typeReference, Filter filter, ICompletionProposalAcceptor acceptor) {
        createSubTypeProposals(superType, proposalFactory, context, typeReference, filter, getConverter(), acceptor);
    }

    /**
     * Overridden to pass a default value converter
     */
    @Override
    public void createTypeProposals(ICompletionProposalFactory proposalFactory, ContentAssistContext context, EReference typeReference, Filter filter, ICompletionProposalAcceptor acceptor) {
        createTypeProposals(proposalFactory, context, typeReference, filter, getConverter(), acceptor);
    }

    private AbstractValueConverter<String> getConverter() {
        return new AbstractValueConverter<String>() {
            /**
             * Remove ^ character from escaped segments
             */
            @Override
            public String toValue(String string, INode node) throws ValueConverterException {
                return string.replace("^", "");
            }

            /**
             * Escape segments colliding with keywords with ^ character
             */
            @Override
            public String toString(String value) throws ValueConverterException {
                // this converter will escape keywords with ^
                return qnValueConverter.toString(value);
            }
        };
    }
}

This custom implementation must be bound to the UI module:

public class SprayUiModule extends AbstractSprayUiModule {
    @Override
    public Class<? extends ITypesProposalProvider> bindITypesProposalProvider() {
        return SprayJdtTypesProposalProvider.class;
    }
}

Now the inserted qualified type name will be automatically replaced.

Spray – a quick way to create Graphiti

Last week was the CodeGeneration 2011 conference in Cambridge/UK, the melting pot for model driven development. It was once again a great conference, even bigger and more inspiring than the recent years. You will find some good summaries of the conference and the Language Workbench Competition workshop in the blogs from Angelo Hulshout, Johan den Haan and Marco Brambini.

At this conference I had an experience report talk together with Bernhard Merkle from Sick (“Graphiti + Xtext: mixing graphical and textual DSLs for sprayers/designers“) on wednesday, where we discussed the integration of Xtext and Graphiti for combining textual and visual DSLs. It is also obvious for us that although Graphiti – more maybe because – has a quite good API the work to actually create Graphiti based editors is repetitive and thus a candidate for code generation and a more abstract description by a DSL. On thursday Marko Boger, former grounder of Gentleware and now professor at the University of Konstanz, showed how they developed exactly such tooling (i.e. textual DSLs with Xtext and code generators with Xpand) to create visual modeling tools. In fact, the newest version of Poseidon for UML was created that way and with the developed tooling visual DSLs can be developed very fast. However, they generate against their own Poseidon runtime and wish to change that to Graphiti in the future. Right after that session, Jos Warmer showed in his talk “Developing an Insurance Product Modeling Workbench” that he already did that for his current customer. Means, he has developed a DSL with Xtext and code generators with Xpand that create Graphiti editors.

There was obviously high interest in this approach, thus we scheduled a Birds-of-a-feather session for thursday evening in the Castle Inn Pub nearby to discuss model-driven development of Graphiti DSLs. About 20 persons crowded the far to small table, and we had a lively discussion.

As a result we decided to join our efforts in an Open Source project. Jos named his DSL “Spray” and I think this is a perfectly fitting name for the project. Further we decided to host that project at Eclipselabs, since parts of it will be potentially contributed to Graphiti or its umbrella project, the Graphical Modeling Project.

The BoF session thus was the birth of project “Spray“. Right after the BoF session was the conference dinner, and I founded the project on my iPhone while waiting for entrance. Maybe this is the first Eclipse related project founded with the iPhone? Jos subtitled it with “a quick way to create Graphiti”, which again perfectly describes what the project will be about. He already uploaded an overview of Spray (extracted from his CG2011 presentation) , and its implementation will be soon contributed as a first version of Spray. We contacted the Graphiti team about our idea and got positive feedback and even one developer who wants to contribute to the project. Also the internal feedback at itemis showed that the project may find some volunteers here.

The overwhealming high interest in contributing to this project is of course good, but now the project must challenge to actually find a concrete vision. Jos’ contribution will be a good start for that, and the experience and requirements of the other interested parties will hopefully be constructive and shape the project. This is a great chance to create something really useful together with real experts on every needed skill. I hope to find enough time myself to contribute and maybe even customers who have a concrete need for it, so that we can provide a working solution in the near future.

Project Spray: http://code.google.com/a/eclipselabs.org/p/spray

Setting up a RCP product for a Xtext DSL

How can I produce a standalone application with the DSL editor I created? This question pops up sometimes in the forum. I will show you how to set up a rather minimal RCP application that enables using the DSL editor created with Xtext. As an example I take the simple Xtext project that you get when you create Xtext projects with the default settings.

Sources for the example project can be downloaded here.

1. Create the Xtext project

Open the menu File / New / Project / Xtext and select Xtext Project. Click Next and then Finish.

You will get the three projects

  • org.xtext.example.mydsl
  • org.xtext.example.mydsl.generator
  • org.xtext.example.mydsl.ui

2. Create a Plugin Project for your product

  1. Create a new Plug-in project with File / New / Project / Plug-in Development / Plug-in Project and press Next.
  2. Enter the project name “org.xtext.example.mydsl.product” and press Next.
  3. In the Options section deselect “Generate an activator…” and “This plug-in will make contributions to the UI”
  4. Press Finish
  5. Generate the DSL implementation by right-click on the GenerateMyDsl.mwe2 and select Run As / MWE2 Workflow.

3. Create a Feature Project for your DSL

Now we will create a Feature that contains only our DSL specific plugins.

  1. Create a new Feature projectwith File / New / Project / Plug-in Development / Feature Project and press Next.
  2. Give it the name “org.xtext.example.mydsl.feature” and press Finish.
  3. Open the feature.xml and go to the Plug-ins page.
  4. Add your DSL plugins:
    • org.xtext.example.mydsl
    • org.xtext.example.mydsl.generator
    • org.xtext.example.mydsl.product
    • org.xtext.example.mydsl.ui

4. Create a Feature Project for the Runtime

A second feature should bundle all the plugins that are required to get the DSL editor running on the RCP platform. This is indeed the most cumbersome work. What exectly is required in a minimal setup to get the editor working? Your DSL editor might need some more plugins than the ones listed here, but for the minimal Xtext project that comes out of the wizard the following list will give you a good starting point.

Now create another Feature Project “org.xtext.example.mydsl.platform.feature” like above. Add the following plugins:

ATTENTION: Xtext currently requires com.google.collect in a version < 1.0. You might have installed different versions of the plugin in your IDE, and to be sure that the right one will be picked, specify the version of that plugin explicitly. In my environment the version is v201008251220. You can identify the right version if you open the Plugin-Dependencies of the org.xtext.example.mydsl project in the Package Explorer and search for the com.google.collect plugin.

5. Define the org.eclipse.core.runtime.products extension

  1. Open the MANIFEST.MF in org.xtext.example.mydsl.product.
  2. Go to the “Dependencies” page and add org.eclipse.core.runtime as required plugin.
  3. Now go to the Extensions page. Click the “Add…” button and select the org.eclipse.core.runtime.products extension point.
  4. Select the extension and enter ID “product” in the Extension Details
  5. Right-click on the extension and select New / product.
  6. Enter value for application: org.eclipse.ui.ide.workbench
  7. Enter the name property for the product (“MyDSL”)
  8. Right-click on “MyDSL (product)” and select New / property.
  9. Enter name=appName, value=MyDSL in the Extension Element Details.

Go to the “plugin.xml” page. The content should now be:

<?xml version="1.0" encoding="UTF-8"?>
<?eclipse version="3.4"?>
<plugin>

   <extension
         id="product"
         point="org.eclipse.core.runtime.products">
      <product
            application="org.eclipse.ui.ide.workbench"
            name="MyDSL">
         <property
               name="appName"
               value="MyDSL">
         </property>
      </product>
   </extension>

</plugin>

6. Create the Product Configuration

In the org.xtext.example.mydsl.product project create a new Product Configuration file “MyDSL.product” (File / New / Plug-in Development / Product Configuration).

Open the MyDSL.product file. On the Overview page do:

  1. set name “MyDSL”
  2. select Product org.xtext.example.mydsl.product.product
  3. select Application org.eclipse.ui.ide.workbench
  4. select “The product conifguration is based : features

Go to the Dependencies page and add the both features

  • org.xtext.example.mydsl.feature
  • org.xtext.example.mydsl.platform.feature

7. Starting the product for testing

On the Overview page you can directly start the product by clicking on the link “Launch an Eclipse Application”. In ideal case it should already work, but you might have to adjust the run configuration that was created. If you see in the console log errors like

MESSAGE Bundle org.eclipse.xtext_1.0.1.v201008251220 [167] was not resolved.
!SUBENTRY 2 org.eclipse.xtext 2 0 2010-11-12 14:00:47.803
!MESSAGE Missing required bundle org.eclipse.xtext.util_1.0.1.
!SUBENTRY 2 org.eclipse.xtext 2 0 2010-11-12 14:00:47.803
!MESSAGE Missing optionally required bundle org.eclipse.emf.codegen_2.5.0.

then close the application again (which should have started instead of these errors). Your DSL editor won’t work then.

Open Run / Run Configurations / Eclipse Application / MyDSL.product and open the Plug-ins page. Press the “Validate Plug-ins” button. If the validation fails for Xtext plugins then we have a problem.

The validation failures for the plugins

  • javax.servlet.jsp
  • org.apache.commos.el
  • org.apache.jasper
  • org.eclipse.equinox.jsp.jasper

can be ignored.

The possible problem causing these errors can be again the wrong version of com.google.collect that was selected for the run configuration. Make sure that version 0.8.0 is selected and 1.0.0 not.

Press “Validate Plug-ins” again. Now no Xtext plugin should fail validation. The others mentioned above can be ignored for now.

You might have to adjust also the memory settings if you experience OutOfMemory problems. This can be done on the Arguments page in the “VM argument” field. The settings I have chosen are:

-Xmx400m -XX:MaxPermSize=150m

8. Test the product

If everything is now configured correctly start the application again. The application should now start successfully and show a minimal Eclipse IDE.

Now it is time to test our DSL editor. To do so do the following:

  1. Create a new Project “MyDSLTest”
  2. In the Project Explorer right-click on the project and select Configure / Add Xtext Nature
  3. Create a new file “test.mydsl”.
  4. Enter “Hello Xtext!”. The word “Hello” should be colored purple and the Outline view should contain “Xtext”

9. Creating an executable application

Once the product has been tested successfully you can export it with the Eclipse Product export wizard. There is a direct link to it on the Overview page of the MyDSL.product file or run the Export wizard through File / Export / Plug-in Development / Eclipse product.

That’s it!

Now you have a small decent IDE that contains an editor for your DSL! Of course, depending on the requirements, you need to add more.

  • If your DSL requires more features to run add them to the feature.xml of org.xtext.example.mydsl.platform.feature
  • You might generate code for your DSL models. You should read about Xtext Build Participants. The Xtext Domainmodel example, which can be created with the New Project Wizard, demonstrates this also.
  • Add further IDE features (SVN, …) for your product to the Feature dependencies of the Product Configuration.
  • Set up a headless build for your product. Consider to use Maven 3 / Tycho for this.