ATTENTION: We are currently moving the repo from github.com/florianpirchner to github.com/lunifera.
The current version of EntityDSL can be found under https://github.com/lunifera/lunifera-dsl/tree/mergeRobDSL
This short tutorial explains the steps to setup the lunifera workspace properly.
1. Install Eclipse
If you have not already done so, install the newest eclipse version. Please choose the classic version RC3 from developer builds.
Attention: Please note, that no m2e (maven /tycho) or any related bundles must be installed.
http://www.eclipse.org/downloads/index-developer.php
2. Install plugins
Information: Now we have to install some plugins. Note, they are all contained in the feature below. No additionaly steps are required here! Please just follow next steps.
2.1 Add remote repositories
Select Menu “Help” -> “Install new software” -> “Add” -> Insert “http://download.eclipse.org/technology/m2e/releases” -> “OK”
Also add the following repositories too:
- http://repository.tesla.io:8081/nexus/content/sites/m2e.extras/m2eclipse-tycho/0.6.0/N/0.6.0.201207302152/
- http://repository.tesla.io:8081/nexus/content/sites/m2e.extras/m2eclipse-buildhelper/0.15.0/N/0.15.0.201207090124/
Do NOT install the content! No further actions are required right now! Just add the repository…
2.2 Download lunifera repository
For now, lunifera does not have a remote repository location. So we have to download the repository and to add a local repository to the p2 manager.
- Download P2.zip from https://github.com/florianpirchner/lunifera-p2repo/downloads
- Add the P2.zip as a local repository to the update manager
2.3 Install the features
To install the features, select the local repository pointing to the p2.zip.
Then select the “Lunfiera IDE Setuphelper” feature. This featuer addresses all required IDE features.
Select next and wait unit the IDE requestes restart. Press “restart”. Now the m2e plugin for maven/tycho integration, Xtext 2.3.1 and EGit are becoming installed.
3. Clone git repo
To clone the git repo add the add the URI to eGit.
- read only access – https://github.com/florianpirchner/lunifera.git
- for committers – git@github.com:florianpirchner/lunifera.git
- Click button “Add repo”
- Insert URI to the git repository
- Click “Next”
- On the “Branch selection” wizard page, select the “stableBuild” branch and click “Next”
- On the “Local destination” page you can specify the directory to create the local repo. Just use defaults.
And now wait, until the repo was cloned properly.
4. Import maven projects
- In Package-Explorer – “Right click” -> “Import” -> “Maven” -> “Existing Maven Projects”
- Point the “root directory” to the location where you have cloned the local repo. (See above)
- Click “Finish”
5. Share projects with git repo
- Select all projects
- “Right Click” -> “Team” -> “Share Project” -> Select Git ->
- -> Select checkbox “Use or create repository in parent folder of project”
- “Click Finish”
WAIT UNTIL ECLIPSE DOES NOT SHOW ANY RUNNING BUILD PROCESSES.
6. Run the tycho build
Open the launch config dialog. Therefore follow the image below.
If the “root directory” ${workspace_loc:/org.lunifera} can not be resolved, then change it to ${workspace_loc:/lunifera}.
The build takes a view minutes. Please follow the log-statements at the console. (“Window “-> “Show View” -> “Console”). If the build ends with error, something bad happended. Please contact us with a the console output and we will immediatelly fix the bug.
7. Set the target platform
- Mark all projects and select “Right click” -> “Refresh”
- Open org.lunifera.p2.target.juno/lunifera-juno.target
- Wait until the target platform is resolved
- Click “Set as Target Platform”
8. Refresh maven projects
- Select project “org.lunifera” (or “lunifera” – depends)
- “Right Click” -> “Maven” -> “Update Project” -> “OK”
- No compile errors should be
9. Launch Eclipse
Attention: Now we are working in launched Eclipse instance!
Congrats, the workspace is setup properly. Now you can launch eclipse.
- Open the “launch configuration dialog” like described under “Run the tycho build”.
- You can use an existing launchconfig
- There is one launchconfig for each platform under “Eclipse Application” category
- “lunifera Eclipse Windows” launch config
- “lunifera Eclipse OSx” launch config
- Select it, open “plugins tab” and click “validate”
- If validation error occurs, click “add required”
- There is one launchconfig for each platform under “Eclipse Application” category
- Or you can create a new launch config
- Select “Eclipse Application” an click “new”
- Switch to the “plugins tab” and select “plugins selected below”
- enable all workspace plugins
- disable all “targetplatform” plugins
- disable “include optional dependencies when…”
- disable “add new workspace plug-ins to this…”
- press “add required”
- ensure that “org.eclipse.platform” is checked. Otherwise check and press “add required” again
- Switch to “arguments tab” and add “-Xms128m -Xmx1024m -XX:MaxPermSize=256m” to VM-Arguments
- Click “Run”
10. Create Example project
- Packageexplorer -> “Right Click” -> “New” -> “Java Project”
- Name it MyExample
- Finish
11. Add required jars to class path
- Select project “MyExample”
- “Right Click” -> “Properties” -> “Java Buildpath” -> Switch to “Library” -> Click “Add external jars”
- Navigate to “eclipse installation folder” then to sub folder plugins
- If bundles not available in installation, then navigate to target platform: {workspace}/.metadata/.plugins/org.eclipse.pde.core/.bundle_pool/plugins
- Select 2 jars
- javax.persistence
- org.eclipse.xtext.xbase.lib
- Press OK
These jars are required to support javax.annotations and xbase stuff.
12. Create our first model
- Select src folder -> “Right Click” -> “New” -> “Lunifera Wizards” -> “Entity Model”
- Use defaults
- If a dialog prompts to add Xtext nature select YES
- Now feel free to prepare your first model
Hint: A src-gen folder will be created by the generator. Add it as a source folder to the project.
- Select project “MyExample”
- “Right Click” -> “Properties” -> “Java Buildpath” -> Switch to “Source” -> Click “Add folder”
- Select src-gen
- OK
13. Demo model
If you prefer using configured models, just go back to IDE and copy the model files
- org.lunifera.metamodel.dsl.entity.tests.jpa.model.DefaultJPACompiler.entitymodel
- org.lunifera.metamodel.dsl.entity.tests.testmodel.model.My.entitymodel
to the src folder in the launched eclipse application. (The DefaultJPACompiler.entitymodel is a temporary workaround. Later it will be provided automatically as a dynamic template.)
February 10, 2013 at 3:15 pm
Hi Guys, the following issues I found today.
1. The Tycho 0.16.0-SNAPSHOP is not longer availabel. You need to change the org.lunifera->pom.xml.
1 Could not calculate build plan: Plugin org.eclipse.tycho:tycho-p2-director-plugin:0.16.0-SNAPSHOT or one of its dependencies could not be resolved: Failed to read artifact descriptor for org.eclipse.tycho:tycho-p2-director-plugin:jar:0.16.0-SNAPSHOT
2. Compiling error in InternalOrganizationDslLexer.java
[ERROR] Failed to execute goal org.eclipse.tycho:tycho-compiler-plugin:0.16.0:compile (default-compile) on project org.lunifera.metamodel.dsl.organization.en: Compilation failure: Compilation failure:
[ERROR] /home/mario/04_Repositories/lunifera/org.lunifera.metamodel.dsl.organization.en/src-gen/org/lunifera/metamodel/dsl/organization/en/parser/antlr/internal/InternalOrganizationDslLexer.java:[13,0]
[ERROR] @SuppressWarnings(“all”)
[ERROR] ^^^^^^^^^^^^^^^^^
[ERROR] Duplicate annotation @SuppressWarnings
[ERROR] /home/mario/04_Repositories/lunifera/org.lunifera.metamodel.dsl.organization.en/src-gen/org/lunifera/metamodel/dsl/organization/en/parser/antlr/internal/InternalOrganizationDslLexer.java:[14,0]
[ERROR] @SuppressWarnings(“all”)
[ERROR] ^^^^^^^^^^^^^^^^^
[ERROR] Duplicate annotation @SuppressWarnings
[ERROR] 2 problems (2 errors)
[ERROR] -> [Help 1]
Thanks for your good work, Mario
February 12, 2013 at 3:39 pm
Hi Mario,
sorry for late answer… And thanks for pointing us to missing notice!
Currently we are migrating the lunifera stuff from the florianpirchner repo to its own lunifera repo.
See github.com/lunifera but we did not update the setup workspace site for now. We are changing some things in the build from time to time. But think that it will be stable soon…
The EntityDSL was refactored and can be found in https://github.com/lunifera/lunifera-dsl/tree/mergeRobDSL (Branche mergeRobDSL).
It can be setup properly using the target definition under org.lunifera.dsl.target.kepler. But it is not integrated into current build for now. We will do it before we merge the branch with master!
Feel free to try the new EntityDSL prototype. The grammar is more close to JPA semantic now.
Best Florian