Integration with the Eclipse build mechanism
It is time to see our generator in action: launch Eclipse, create a Java Project in the workspace, and in the src
folder, create a new .entities
file (remember to accept to convert the project to an Xtext project, otherwise the generator will not run). Continue by adding one or more entities with some attributes. Note that a src-gen
folder is automatically created as soon as you save the file. At this point, you should also add this generated folder to the projects source folders by navigating to Build Path | Use as Source Folder. Exploring the content of the src-gen
folder, you will find a generated Java class for each entity in your .entities
file. You can see an example in the following screenshot: ...
Get Implementing Domain-Specific Languages with Xtext and Xtend - Second Edition now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.