Setup workspace

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:

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.

  1. Download P2.zip from https://github.com/florianpirchner/lunifera-p2repo/downloads
  2. 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.

  1. Click button “Add repo”
  2. Insert URI to the git repository
  3. Click “Next”
  4. On the “Branch selection” wizard page, select the “stableBuild” branch and click “Next”
  5. 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

  1. In Package-Explorer – “Right click” -> “Import” -> “Maven” -> “Existing Maven Projects”
  2. Point the “root directory” to the location where you have cloned the local repo. (See above)
  3. Click “Finish”

5. Share projects with git repo

  1. Select all projects
  2. “Right Click” -> “Team” -> “Share Project” -> Select Git ->
  3. -> Select checkbox “Use or create repository in parent folder of project”
  4. “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

  1. Mark all projects and select “Right click” -> “Refresh”
  2. Open org.lunifera.p2.target.juno/lunifera-juno.target
  3. Wait until the target platform is resolved
  4. Click “Set as Target Platform”

8. Refresh maven projects

  1. Select project “org.lunifera” (or “lunifera” – depends)
  2. “Right Click” -> “Maven” -> “Update Project” -> “OK”
  3. 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.

  1. Open the “launch configuration dialog” like described under “Run the tycho build”.
  2. You can use an existing launchconfig
    1. There is one launchconfig for each platform under “Eclipse Application” category
      1. “lunifera Eclipse Windows” launch config
      2. “lunifera Eclipse OSx” launch config
    2. Select it, open “plugins tab” and click “validate”
    3. If validation error occurs, click “add required”
  3. Or you can create a new launch config
    1. Select “Eclipse Application” an click “new”
    2. Switch to the “plugins tab” and select “plugins selected below”
      1. enable all workspace plugins
      2. disable all “targetplatform” plugins
      3. disable “include optional dependencies when…”
      4. disable “add new workspace plug-ins to this…”
      5. press “add required”
      6. ensure that “org.eclipse.platform” is checked. Otherwise check and press “add required” again
    3. Switch to “arguments tab” and add “-Xms128m -Xmx1024m -XX:MaxPermSize=256m” to VM-Arguments
  4. Click “Run”

 

10. Create Example project

  1. Packageexplorer -> “Right Click” -> “New” -> “Java Project”
  2. Name it MyExample
  3. Finish

11. Add required jars to class path

  1. Select project “MyExample”
  2. “Right Click” -> “Properties” -> “Java Buildpath” -> Switch to “Library” -> Click “Add external jars”
  3. Navigate to “eclipse installation folder” then to sub folder plugins
    1. If bundles not available in installation, then navigate to target platform: {workspace}/.metadata/.plugins/org.eclipse.pde.core/.bundle_pool/plugins
  4. Select 2 jars
    1. javax.persistence
    2. org.eclipse.xtext.xbase.lib
  5. Press OK

These jars are required to support javax.annotations and xbase stuff.

12. Create our first model

  1. Select src folder -> “Right Click” -> “New” -> “Lunifera Wizards” -> “Entity Model”
  2. Use defaults
  3. If a dialog prompts to add Xtext nature select YES
  4. 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.

  1. Select project “MyExample”
  2. “Right Click” -> “Properties” -> “Java Buildpath” -> Switch to “Source” -> Click “Add folder”
  3. Select src-gen
  4. 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.)

14. The final picture

2 Responses to “Setup workspace”

  1. Mario Says:

    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

    • Florian Pirchner Says:

      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


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: