Difference between revisions of "Eclipse b3/contributing/Setting Up Development Environment"

From Eclipsepedia

Jump to: navigation, search
(Getting The Source Code)
(Getting The Source Code)
 
(10 intermediate revisions by 3 users not shown)
Line 7: Line 7:
 
The first thing you'll need is the Eclipse 3.6 IDE for your platform. Here is a pointer (if you don't get it by heart yet) to the download page: http://www.eclipse.org/downloads/<br /> Grab the Classic version at the very bottom and unpack the archive into a convenient path.
 
The first thing you'll need is the Eclipse 3.6 IDE for your platform. Here is a pointer (if you don't get it by heart yet) to the download page: http://www.eclipse.org/downloads/<br /> Grab the Classic version at the very bottom and unpack the archive into a convenient path.
  
===Subversion support===
+
===Git support===
Subversion support is needed simply because the b3 sources are kept in an SVN repository. There are two projects providing the needed support:
+
Git support is needed simply because the b3 sources are kept in an Git repository.
* ''subclipse'' - http://subclipse.tigris.org/
+
* ''subversive'' - http://www.eclipse.org/subversive/
+
<br />
+
If you already use one of these then stick with it, otherwise follow these steps to install ''subclipse'':
+
* run your freshly installed Eclipse
+
* open the ''Help / Install New Software ''wizard
+
* browse the subclipse 1.6.x repository: http://subclipse.tigris.org/update_1.6.x
+
* select the following components:
+
** ''Core SVNKit Library / SVNKit Library''
+
** ''Optional JNA Library (recommended) / JNA Library''
+
** ''Subclipse / Subclipse (Required)''
+
** ''Subclipse / SVNKit Client Adapter (Not required)''
+
* click through the other pages of the install wizard to finish the installation (you will need to acknowledge installation of unsigned software as the subclipse components are not signed)<br />
+
<br />
+
You may want to skip the otherwise recommended restart of the workbench at this point as there will be more installations and after each of them a restart will be recommended, so it will save you some time if you restart only after the very last installation.<br /> (But don't blame me if anything goes wrong - the restart was recommended after all!)
+
 
+
===EMF===
+
EMF is the first of dependencies of b3, to install it follow these instructions:
+
  
 
* open the ''Help / Install New Software'' wizard
 
* open the ''Help / Install New Software'' wizard
* browse the EMF releases repository: http://download.eclipse.org/modeling/emf/updates/releases
+
* browse the Indigo repository
* expand the ''EMF SDK 2.5.0 (EMF + XSD)'' category (you may experiment with later releases if available)<br />
+
* expand the ''Collaboration'' category
* select all entries in the expanded category which names start with ''EMF'', except ''EMF/XSD All-In-One SDK'' (you may also omit Examples)
+
* select the ''Eclipse EGit'' and ''Eclipse JGit'' entries
 
* click through the other pages of the install wizard to finish the installation
 
* click through the other pages of the install wizard to finish the installation
 
<br />
 
<br />
Again you may want to skip the recommended workbench restart.
 
  
===Ecore Tools===
+
===EMF===
B3 works without this, but the tools include, among others, graphical editors for certain b3 language definitions which would otherwise have to be edited in plain text, which would be a pain. Installation instructions follow:
+
EMF is the first of dependencies of b3, to install it follow these instructions:
  
 
* open the ''Help / Install New Software'' wizard
 
* open the ''Help / Install New Software'' wizard
* browse the EMFT releases repository: http://download.eclipse.org/modeling/emft/updates/releases
+
* browse the Indigo repository
* expand the ''EMFT ECORETOOLS SDK (Incubation) 0.9.0'' category (you may experiment with later releases if available)<br /> '''Subject to change now that 3.6M7 is just about to be available'''
+
* expand the ''Modeling'' category
* select all entries in the expanded category, except ''Ecore Tools All-In-One Feature (Incubation)'' (you may also omit Examples)
+
* select the 'Ecore Tools SDK''
 +
* select the ''EMF - Eclipse Modeling Framework SDK''
 
* click through the other pages of the install wizard to finish the installation
 
* click through the other pages of the install wizard to finish the installation
 
<br />
 
<br />
Again you may want to skip the recommended workbench restart.
 
  
 
===Xtext===
 
===Xtext===
Line 51: Line 32:
  
 
* open the ''Help / Install New Software'' wizard
 
* open the ''Help / Install New Software'' wizard
 +
* Install Xtext and mwe2 from http://download.itemis.com/updates/releases/
 +
 +
Before Helios and Xtext release 1.0 it was required to use particular versions. Here are the older instructions for milestones and nightly builds:
 
* browse the Xtext milestones repository (latest release won't do as of writing of this document): http://download.itemis.com/updates/milestones
 
* browse the Xtext milestones repository (latest release won't do as of writing of this document): http://download.itemis.com/updates/milestones
 
* select entire following categories:
 
* select entire following categories:
Line 72: Line 56:
  
 
==Getting The Source Code==
 
==Getting The Source Code==
B3 source code is kept in the Eclipse SVN repository. There are two ways to access the repository:
+
B3 source code is kept in the [http://git.eclipse.org/c/b3/b3.git/ b3.git] repository.
* anonymous access, through the http protocol, at: '''<nowiki>http://dev.eclipse.org/svnroot/modeling/org.eclipse.emft.b3/</nowiki>'''
+
* commiters' access, through the svn+ssh protocol, at: '''svn+ssh://dev.eclipse.org/svnroot/modeling/org.eclipse.emft.b3/'''
+
<br />
+
choose whichever is appropriate for you.
+
  
 
To get the b3 sources, follow these instructions:
 
To get the b3 sources, follow these instructions:
* run Eclipse, open the ''SVN Repository Exploring'' perspective
+
* run Eclipse, open the ''File'' -> ''Import'' wizard
* add the chosen repository to the the list of SVN repositories (which should be empty at this time)
+
* Select ''Git'' -> ''Projects from Git'' and click ''Next''
* expand the repository node, then expand the ''trunk'' node
+
* Click ''Clone...''
* checkout the projects listed below from ''trunk'' as projects into your workspace
+
* Enter the URI ''<nowiki>git://git.eclipse.org/gitroot/b3/b3.git</nowiki>'' and click ''Next''
 +
* Verify that the ''master'' branch is checked and click ''Next''
 +
* Select ''Import Existing Projects'' and click ''Next''
 +
* Check the projects listed below and click ''Finish''
 
** org.eclipse.b3 [ .backend.*, .beelang.*, .build, .core ]
 
** org.eclipse.b3 [ .backend.*, .beelang.*, .build, .core ]
 
<br />
 
<br />
Line 90: Line 73:
 
Once you have all the b3 projects in your workspace you are ready to launch a b3 enabled workbench. You do it like this:
 
Once you have all the b3 projects in your workspace you are ready to launch a b3 enabled workbench. You do it like this:
 
* bring up the ''Run / Run Configurations...'' dialog
 
* bring up the ''Run / Run Configurations...'' dialog
* create a new ''Eclipse Application'' launch configuration
+
* create a new ''Eclipse Application'' launch configuration (or use the /org.eclipse.b3.beelang.tests/B3InteractiveTest.launch in the beelang.tests project mentioned below)
 
* rename it to something suitable, like ''B3''
 
* rename it to something suitable, like ''B3''
 
* launch it
 
* launch it
Line 110: Line 93:
 
<br />
 
<br />
 
Congratulations, you have just executed your first b3 code!
 
Congratulations, you have just executed your first b3 code!
 +
 
==Running b3 JUnit tests==
 
==Running b3 JUnit tests==
 
B3 has a JUnit runner that runs b3 scripts as JUnit tests. There are many tests written in b3. There is a launch configuration for running the tests - it is found here /org.eclipse.b3.beelang.tests/AllB3Tests - headless.launch - simply use this launch configuration to get the correct configuration.
 
B3 has a JUnit runner that runs b3 scripts as JUnit tests. There are many tests written in b3. There is a launch configuration for running the tests - it is found here /org.eclipse.b3.beelang.tests/AllB3Tests - headless.launch - simply use this launch configuration to get the correct configuration.

Latest revision as of 10:07, 17 August 2011

If you intend to hack b3, here is how to get started.

Contents

[edit] Installing Prerequisites

In order to work on b3 you'll need to install prerequisites described in the following paragraphs. (In the order they are presented in this document.)

[edit] Eclipse

The first thing you'll need is the Eclipse 3.6 IDE for your platform. Here is a pointer (if you don't get it by heart yet) to the download page: http://www.eclipse.org/downloads/
Grab the Classic version at the very bottom and unpack the archive into a convenient path.

[edit] Git support

Git support is needed simply because the b3 sources are kept in an Git repository.

  • open the Help / Install New Software wizard
  • browse the Indigo repository
  • expand the Collaboration category
  • select the Eclipse EGit and Eclipse JGit entries
  • click through the other pages of the install wizard to finish the installation


[edit] EMF

EMF is the first of dependencies of b3, to install it follow these instructions:

  • open the Help / Install New Software wizard
  • browse the Indigo repository
  • expand the Modeling category
  • select the 'Ecore Tools SDK
  • select the EMF - Eclipse Modeling Framework SDK
  • click through the other pages of the install wizard to finish the installation


[edit] Xtext

Xtext is the next dependency of b3. Installation instructions follow:

Before Helios and Xtext release 1.0 it was required to use particular versions. Here are the older instructions for milestones and nightly builds:

  • browse the Xtext milestones repository (latest release won't do as of writing of this document): http://download.itemis.com/updates/milestones
  • select entire following categories:
    • tmf-xtext use version 1.0 M6 or later (see below)
    • xtext-antlr use version 1.0 M6 or later (see below)
  • click through the other pages of the install wizard to finish the installation (you will need to acknowledge installation of unsigned software as some of the installed components are not signed)


The Xtext completes the installations so please restart the workbench as recommended this time!

If you are running on a 64 bit machine, a build after 20100503 will be required (soon) as there are pending changes that will cause "static intitializer exceeds size limit" errors otherwise. You can get nightly builds at http://download.itemis.com/updates/nightly/

[edit] Preparing The Workspace

In order to keep the code clean and to avoid merge problems, b3 projects should be organized with unified code style and formatting rules. Unfortunately not all the settings are available as project specific. This is why a workspace template should be used before any source code is checked out. Follow the steps below to initialize your workspace properly:

  • download the b3 workspace template archive
  • create an empty folder for the new workspace
  • extract the template archive into that folder
  • start Eclipse IDE using the new workspace
  • refresh the initial project (select the project and press F5)
  • follow the steps described in the README.txt file (which is initially opened in the Eclipse IDE text editor)


[edit] Getting The Source Code

B3 source code is kept in the b3.git repository.

To get the b3 sources, follow these instructions:

  • run Eclipse, open the File -> Import wizard
  • Select Git -> Projects from Git and click Next
  • Click Clone...
  • Enter the URI git://git.eclipse.org/gitroot/b3/b3.git and click Next
  • Verify that the master branch is checked and click Next
  • Select Import Existing Projects and click Next
  • Check the projects listed below and click Finish
    • org.eclipse.b3 [ .backend.*, .beelang.*, .build, .core ]


Done!

[edit] Running It

Once you have all the b3 projects in your workspace you are ready to launch a b3 enabled workbench. You do it like this:

  • bring up the Run / Run Configurations... dialog
  • create a new Eclipse Application launch configuration (or use the /org.eclipse.b3.beelang.tests/B3InteractiveTest.launch in the beelang.tests project mentioned below)
  • rename it to something suitable, like B3
  • launch it


A new workbench should start, perform the following actions in the new workbench:

  • checkout the following project: http://dev.eclipse.org/svnroot/modeling/org.eclipse.emft.b3/trunk/org.eclipse.b3.beelang.tests
  • switch to the Package Explorer view and open the /src-b3/smoketestFunctionArithmetic.b3 file in the checked out project
    • the file should open in an editor supporting syntax highlighting
    • there should be an outline view with a root node of BeeModel
  • right click the BeeModel node in the outline view a select the Run Main Function option
    • a console window with the following content should show up:
      Running the main function...
      Result = true


Congratulations, you have just executed your first b3 code!

[edit] Running b3 JUnit tests

B3 has a JUnit runner that runs b3 scripts as JUnit tests. There are many tests written in b3. There is a launch configuration for running the tests - it is found here /org.eclipse.b3.beelang.tests/AllB3Tests - headless.launch - simply use this launch configuration to get the correct configuration.

At the time this instruction was updated there are three outstanding failures in the test (for which there are bugzillas logged) - one failure because repository syntax has changed and impl is not yet working, and two are related to b3's java integration.