Skip to content

fuinorg/emt-xtext-archetype

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

40 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

emt-xtext-archetype

Eclipse Maven Tycho Xtext Archetype

Continuous Integration

Build Status Maven Central LGPLv3 License

Summary

Maven archetype that creates an Xtext project with a multi module Maven layout and Tycho (manifest-first approach). The archetype was created using the Maven Xtext Example.

Generated structure

>com.mycompany.mydsl
|-- com.mycompany.mydsl
|-- com.mycompany.mydsl.ide
|-- com.mycompany.mydsl.sdk
|-- com.mycompany.mydsl.tests
|-- com.mycompany.mydsl.ui
|-- com.mycompany.mydsl.updatesite
`-- example-project
`-- example-project-gradle
  • .mydsl Grammar and base classes for the DSL.
  • .mydsl.ide Standalone setup.
  • .mydsl.sdk The feature.
  • .mydsl.tests Contains the tests.
  • .mydsl.ui UI related parts.
  • .mydsl.updatesite Creates a P2 repository that contains the plugin.
  • example-project Example Maven DSL project
  • example-project-gradle Example Gradle DSL project

Prerequisites

  • Java JDK 1.7 is installed
  • Maven 3 is installed.
  • Eclipse with Xtext is installed (Download Pre-Configured Eclipse With Xtext)
  • M2E Eclipse Plugin is installed (Help / Eclipse Market Place... / Find "M2E" / Install "Maven Integration for Eclipse (Juno and newer)")
  • M2E Tycho Connector is installed (Window /Prefences / Maven / Discovery / Open Catalog / Install M2E Connectors / Find "Tycho" / Install "Tycho Configurator")
  • The Eclipse and Xtext repositories are added to your .m2/settings.xml to make them accessible for Maven:
<repositories>
    <repository>
        <id>eclipse-neon</id>
        <layout>p2</layout>
        <url>http://download.eclipse.org/releases/neon</url>
    </repository>
    <repository>
        <id>xtext-update-site</id>
        <layout>p2</layout>
        <url>http://download.eclipse.org/modeling/tmf/xtext/updates/composite/releases/</url>
    </repository>
</repositories>

Create project

Mandatory Parameters

mvn archetype:generate \
     -DarchetypeGroupId=org.fuin.archetypes \
     -DarchetypeArtifactId=emt-xtext-archetype \
     -DarchetypeVersion=0.2.1

All Parameters

mvn archetype:generate \
     -DarchetypeGroupId=org.fuin.archetypes \
     -DarchetypeArtifactId=emt-xtext-archetype \
     -DarchetypeVersion=0.2.1 \
     -DgroupId="com.mycompany.mydsl" \
	 -DartifactId="com.mycompany.mydsl" \
	 -Dversion="0.1.0-SNAPSHOT" \
	 -DeclipseVersion="0.1.0.qualifier" \
	 -Dpackage="com.mycompany.mydsl" \
	 -DpackagePath="com/mycompany/mydsl" \
	 -DbasePackage="com.mycompany" \
	 -DbasePackagePath="com/mycompany" \
	 -DdslName="MyDSL" \
	 -DtechName="mydsl" \
	 -DdslExtension="mydsl" \
	 -DfullName="My DSL" \
	 -Durl="http://www.mycompany.com/"

Explanation

ParameterDefault ValueDescription
groupIdcom.mycompany.mydslMaven 'groupId'
artifactIdcom.mycompany.mydslMaven 'artifactId'
version0.1.0-SNAPSHOTMaven 'version'
eclipseVersion0.1.0.qualifierEclipse version - Should be identical to the Maven version except for snapshots (with a '.qualifier' instead of '-SNAPSHOT')
packagecom.mycompany.mydslJava Package (Should be most of the times identical to the 'groupId')
packagePathcom/mycompany/mydslSame as package, but instead of '.' the '/' is used as separator
dslNameMyDSLUnique short name of the DSL - Only upper and lower case characters ('A'-'Z', 'a'-'z', No spaces)
techNamemydslA short technical name of the DSL - Only lower case characters ('a'-'z', No spaces)
dslExtensionmydslFile extension for the DSL model files
fullNameMy DSLA short descriptive name of the DSL
urlhttp://www.mycompany.com/Company URL - Used for example in the Eclipse 'product' description

Snapshots

Snapshots can be found on the OSS Sonatype Snapshots Repository.

Add the following to your .m2/settings.xml to enable snapshots:

<repository>
    <id>sonatype.oss.snapshots</id>
    <name>Sonatype OSS Snapshot Repository</name>
    <url>http://oss.sonatype.org/content/repositories/snapshots</url>
    <releases>
        <enabled>false</enabled>
    </releases>
    <snapshots>
        <enabled>true</enabled>
    </snapshots>
</repository>

More Archteypes

If you're looking for more Maven archetypes, take a look at Open Archetypes.

with-Eclipse logo

About

Eclipse Maven Tycho XText Archetype

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 3

  •  
  •  
  •  

Languages